This commit is contained in:
2020-10-06 14:27:47 +07:00
commit 586be80cf6
16613 changed files with 3274099 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
use Codeception\Util\JsonArray;
use Codeception\Util\Shared\Asserts;
/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
*
* @SuppressWarnings(PHPMD)
*/
class AngularGuy extends \Codeception\Actor
{
use Asserts;
use _generated\AngularGuyActions;
public function seeInFormResult($expected)
{
$jsonArray = new JsonArray($this->grabTextFrom(['id' => 'data']));
$this->assertTrue($jsonArray->containsArray($expected), var_export($jsonArray->toArray(), true));
}
public function submit()
{
$this->click('Submit');
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void haveFriend($name, $actorClass = null)
*
* @SuppressWarnings(PHPMD)
*/
class CliGuy extends \Codeception\Actor
{
use _generated\CliGuyActions;
/**
* @param $file
*/
public function seeInSupportDir($file)
{
$this->seeFileFound($file, 'tests/support');
}
}

View File

@@ -0,0 +1,41 @@
<?php
namespace Codeception\Module;
// here you can define custom functions for CliGuy
class CliHelper extends \Codeception\Module
{
public function _beforeSuite($settings = [])
{
$this->debug('Building actor classes for claypit');
$this->getModule('Cli')->runShellCommand('php ' . codecept_root_dir() . 'codecept build -c ' . codecept_data_dir() . 'claypit');
}
public function _before(\Codeception\TestInterface $test)
{
codecept_debug('creating dirs');
$this->getModule('Filesystem')->copyDir(codecept_data_dir() . 'claypit', codecept_data_dir() . 'sandbox');
}
public function _after(\Codeception\TestInterface $test)
{
codecept_debug('deleting dirs');
$this->getModule('Filesystem')->deleteDir(codecept_data_dir() . 'sandbox');
chdir(\Codeception\Configuration::projectDir());
}
public function executeCommand($command, $fail = true)
{
$this->getModule('Cli')->runShellCommand('php ' . \Codeception\Configuration::projectDir() . 'codecept ' . $command . ' -n', $fail);
}
public function executeFailCommand($command)
{
$this->getModule('Cli')->runShellCommand('php '.\Codeception\Configuration::projectDir().'codecept '.$command.' -n', false);
}
public function seeDirFound($dir)
{
$this->assertTrue(is_dir($dir) && file_exists($dir), "Directory does not exist");
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void haveFriend($name, $actorClass = null)
*
* @SuppressWarnings(PHPMD)
*/
class CodeGuy extends \Codeception\Actor
{
use _generated\CodeGuyActions;
/**
* Define custom actions here
*/
}

View File

@@ -0,0 +1,8 @@
<?php
namespace Codeception\Module;
// here you can define custom functions for CodeGuy
class CodeHelper extends \Codeception\Module
{
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void haveFriend($name, $actorClass = null)
*
* @SuppressWarnings(PHPMD)
*/
class CoverGuy extends \Codeception\Actor
{
use _generated\CoverGuyActions;
/**
* Define custom actions here
*/
public function seeCoverageStatsNotEmpty()
{
$this->seeInShellOutput(
<<<EOF
info
Methods: 100.00% ( 1/ 1) Lines: 100.00% ( 4/ 4)
EOF
);
}
}

View File

@@ -0,0 +1,6 @@
<?php
namespace Codeception\Module;
class CoverHelper extends \Codeception\Module
{
}

View File

@@ -0,0 +1,25 @@
<?php
namespace Codeception\Module;
// here you can define custom functions for CodeGuy
class EmulateModuleHelper extends \Codeception\Module
{
public $assertions = 0;
public function seeEquals($expected, $actual)
{
\PHPUnit_Framework_Assert::assertEquals($expected, $actual);
$this->assertions++;
}
public function seeFeaturesEquals($expected)
{
\PHPUnit_Framework_Assert::assertEquals($expected, $this->feature);
}
public function _before(\Codeception\TestInterface $test)
{
$this->feature = $test->getMetadata()->getFeature();
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
*
* @SuppressWarnings(PHPMD)
*/
class FacebookGuy extends \Codeception\Actor
{
use _generated\FacebookGuyActions;
/**
* Define custom actions here
*/
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Helper;
// here you can define custom actions
// all public methods declared in helper class will be available in $I
class Angular extends \Codeception\Module
{
}

View File

@@ -0,0 +1,6 @@
<?php
namespace Helper;
class Shire extends \Codeception\Module
{
}

View File

@@ -0,0 +1,25 @@
<?php
namespace Shire\Codeception\Module;
// here you can define custom functions for CodeGuy
class EmulateModuleHelper extends \Codeception\Module
{
public $assertions = 0;
public function seeEquals($expected, $actual)
{
\PHPUnit_Framework_Assert::assertEquals($expected, $actual);
$this->assertions++;
}
public function seeFeaturesEquals($expected)
{
\PHPUnit_Framework_Assert::assertEquals($expected, $this->scenario->getFeature());
}
public function _before(\Codeception\TestInterface $test)
{
$this->scenario = $test->getScenario();
}
}

View File

@@ -0,0 +1,9 @@
<?php
namespace Codeception\Module;
// here you can define custom functions for TestGuy
class TestHelper extends \Codeception\Module
{
}

View File

@@ -0,0 +1,17 @@
<?php
namespace Codeception\Module;
class UniversalFramework extends \Codeception\Lib\Framework
{
public function __construct()
{
$index = '/app/index.php';
$this->client = new \Codeception\Lib\Connector\Universal();
$this->client->setIndex(\Codeception\Configuration::dataDir().$index);
}
public function useUniversalFramework()
{
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = null)
*
* @SuppressWarnings(PHPMD)
*/
class WebGuy extends \Codeception\Actor
{
use _generated\WebGuyActions;
/**
* Define custom actions here
*/
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Codeception\Module;
// here you can define custom functions for WebGuy
class WebHelper extends \Codeception\Module
{
public function changeBrowser($browser)
{
$this->getModule('WebDriver')->_restart(['browser' => $browser]);
}
}