diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 39e5c32..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Tests -on: [push] - -jobs: - build: - name: Tests - runs-on: ubuntu-latest - - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: pimcore_test - ports: - - 33306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - name: Setup DB - run: | - mysql --version - mysql -u root -proot -e "SET GLOBAL innodb_file_format=Barracuda;" - mysql -u root -proot -e "SET GLOBAL innodb_large_prefix=1;" - - - name: PHP Runner - uses: nanasess/setup-php@master - with: - php-version: '7.3' - - - name: Checkout Repository - uses: actions/checkout@v1 - - - name: Install Project - env: - DB_HOST: "localhost" - DB_PORT: "3306" - DB_USERNAME: "root" - DB_PASSWORD: "root" - DB_DATABASE: "pimcore_test" - PIMCORE_ENVIRONMENT: "test" - PIMCORE_TEST: "1" - PIMCORE_TEST_DB_DSN: "mysql://root:root@localhost/pimcore_test" - run: | - ./scripts/install.sh - - - name: Unit Tests - env: - PIMCORE_TEST_DB_DSN: "mysql://root:root@localhost/pimcore_test" - run: | - cd tmp - ./vendor/bin/phpunit --coverage-text - - - name: Functional Tests - env: - PIMCORE_TEST_DB_DSN: "mysql://root:root@localhost/pimcore_test" - run: | - cd tmp - ./vendor/bin/codecept run -c tests/codeception.dist.yml diff --git a/readme.md b/readme.md index 7db53f1..4f99ebf 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,5 @@ # Scheduled Export [![Analysis Actions](https://github.com/DivanteLtd/pimcore-scheduled-export/workflows/Analysis/badge.svg?branch=master)](https://github.com/DivanteLtd/pimcore-scheduled-export/actions) -[![Tests Actions](https://github.com/DivanteLtd/pimcore-scheduled-export/workflows/Tests/badge.svg?branch=master)](https://github.com/DivanteLtd/pimcore-scheduled-export/actions) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/2c51a42a456c47c9971a7e2a48bcd6f4)](https://www.codacy.com/app/Divante/pimcore-scheduled-export?utm_source=github.com&utm_medium=referral&utm_content=DivanteLtd/pimcore-scheduled-export&utm_campaign=Badge_Grade) [![Latest Stable Version](https://poser.pugx.org/divante-ltd/pimcore-scheduled-export/v/stable)](https://packagist.org/packages/divante-ltd/pimcore-scheduled-export) [![Total Downloads](https://poser.pugx.org/divante-ltd/pimcore-scheduled-export/downloads)](https://packagist.org/packages/divante-ltd/pimcore-scheduled-export) @@ -24,7 +23,7 @@ Scheduled Export lets you run ordinary grid exports in the background or using c ## Compatibility -This module is compatible with Pimcore 5.5.0 and higher. +This module is compatible with Pimcore 6.3.0 and higher. ## Installing @@ -34,7 +33,6 @@ composer require divante-ltd/pimcore-scheduled-export Make sure the dependencies are enabled and installed: ```bash -./bin/console pimcore:bundle:enable PimcoreDevkitBundle ./bin/console pimcore:bundle:enable ProcessManagerBundle ./bin/console pimcore:bundle:install ProcessManagerBundle ``` @@ -46,8 +44,7 @@ Enable the Bundle: ## Requirements -* Pimcore 5 or 6 -* Pimcore Devkit +* Pimcore 6.3 * ProcessManager ## Usage diff --git a/src/ScheduledExportBundle/Export/Export.php b/src/ScheduledExportBundle/Export/Export.php index d51b828..b3bd8a6 100644 --- a/src/ScheduledExportBundle/Export/Export.php +++ b/src/ScheduledExportBundle/Export/Export.php @@ -68,14 +68,9 @@ class Export /** * Export constructor. - * @param string $gridConfig - * @param string $objectsFolder - * @param string $assetFolder * @param ContainerInterface $container - * @param string|null $condition - * @param string|null $fileName - * @param string $timestamp - * @param string $onlyChanges + * @param $input + * @param $output * @throws \Exception */ public function __construct( @@ -106,6 +101,9 @@ public function __construct( $this->types = str_replace(' ', '', (string) $input->getOption("types")); } + /** + * @return WebsiteSetting + */ public function getExportSetting() : WebsiteSetting { $settings = WebsiteSetting::getByName($this->gridConfig->getId() . @@ -239,7 +237,7 @@ public function getTimestampFormat(): string } /** - * @param mixed $timestampFormat + * @param string $timestampFormat */ public function setTimestampFormat(string $timestampFormat): void { @@ -287,11 +285,13 @@ public function export(): void } } $this->process->progress(count($objectIdBatch)); - $this->process->setMessage(sprintf("Running (%d/%d)", $this->process->getProgress(), $this->process->getTotal())); + $this->process->setMessage( + sprintf("Running (%d/%d)", $this->process->getProgress(), $this->process->getTotal()) + ); $this->process->save(); \Pimcore::collectGarbage(); - } + $this->process->setMessage("Saving results"); $this->process->save(); $this->saveFileInAssets($filenames); @@ -305,6 +305,8 @@ public function export(): void } /** + * @param array $objectIds + * @param string $filename * @return Request */ protected function prepareRequest(array $objectIds, string $filename): Request @@ -360,7 +362,7 @@ protected function prepareListing(): void protected function getObjectIds(): array { $objectIds = []; - for($i = 0; $i <= $this->process->getTotal(); $i = $i + self::INTERNAL_BATCH_SIZE) { + for ($i = 0; $i <= $this->process->getTotal(); $i = $i + self::INTERNAL_BATCH_SIZE) { $this->listing->setOffset($i); $this->listing->setLimit(self::INTERNAL_BATCH_SIZE); $objectIds[] = $this->listing->loadIdList(); @@ -407,7 +409,9 @@ protected function setHelperColumnsInSession($fieldsRaw): void } /** + * @param array $filenames * @return void + * @throws \Exception */ protected function saveFileInAssets(array $filenames): void { @@ -427,14 +431,14 @@ protected function saveFileInAssets(array $filenames): void $firstFile = false; } - if($this->input->getOption('divide_file')) { + if ($this->input->getOption('divide_file')) { $line = strtok($content, $separator); $header = $line; $counter = 0; $fileCounter = 0; $subContent = ""; while ($line !== false) { - $line = strtok( $separator ); + $line = strtok($separator); $subContent .= $line . "\r\n"; $counter++; if ($counter % $this->input->getOption('divide_file') == 0) { @@ -456,14 +460,14 @@ protected function saveFileInAssets(array $filenames): void $assetFile->setData($content); $assetFile->save(); } - } /** * @param string $assetFolder + * @param int|null $index * @return Asset */ - protected function prepareAssetFile($assetFolder, ?int $index = null): Asset + protected function prepareAssetFile(string $assetFolder, ?int $index = null): Asset { $assetFile = new Asset(); diff --git a/tests/_support/FunctionalTester.php b/tests/_support/FunctionalTester.php deleted file mode 100644 index 431d625..0000000 --- a/tests/_support/FunctionalTester.php +++ /dev/null @@ -1,26 +0,0 @@ -getScenario()->runStep(new \Codeception\Step\Action('getPimcoreModule', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * @return \Symfony\Component\HttpKernel\Kernel|Kernel - * @see \Pimcore\Tests\Helper\Pimcore::getKernel() - */ - public function getKernel() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('getKernel', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * @return \Symfony\Component\DependencyInjection\ContainerInterface - * @see \Pimcore\Tests\Helper\Pimcore::getContainer() - */ - public function getContainer() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('getContainer', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Set pimcore into admin state - * @see \Pimcore\Tests\Helper\Pimcore::setAdminMode() - */ - public function setAdminMode() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('setAdminMode', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Set pimcore into non-admin state - * @see \Pimcore\Tests\Helper\Pimcore::unsetAdminMode() - */ - public function unsetAdminMode() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('unsetAdminMode', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * HOOK to be executed when config changes with `_reconfigure`. - * @see \Codeception\Module\Symfony::onReconfigure() - */ - public function onReconfigure($settings = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('onReconfigure', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Get service $serviceName and add it to the lists of persistent services. - * If $isPermanent then service becomes persistent between tests - * - * @param string $serviceName - * @param boolean $isPermanent - * @see \Codeception\Module\Symfony::persistService() - */ - public function persistService($serviceName, $isPermanent = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('persistService', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Remove service $serviceName from the lists of persistent services. - * - * @param string $serviceName - * @see \Codeception\Module\Symfony::unpersistService() - */ - public function unpersistService($serviceName) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('unpersistService', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Invalidate previously cached routes. - * @see \Codeception\Module\Symfony::invalidateCachedRouter() - */ - public function invalidateCachedRouter() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('invalidateCachedRouter', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Opens web page using route name and parameters. - * - * ``` php - * amOnRoute('posts.create'); - * $I->amOnRoute('posts.show', array('id' => 34)); - * ?> - * ``` - * - * @param $routeName - * @param array $params - * @see \Codeception\Module\Symfony::amOnRoute() - */ - public function amOnRoute($routeName, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnRoute', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that current url matches route. - * - * ``` php - * seeCurrentRouteIs('posts.index'); - * $I->seeCurrentRouteIs('posts.show', array('id' => 8)); - * ?> - * ``` - * - * @param $routeName - * @param array $params - * @see \Codeception\Module\Symfony::seeCurrentRouteIs() - */ - public function seeCurrentRouteIs($routeName, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentRouteIs', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that current url matches route. - * - * ``` php - * seeCurrentRouteIs('posts.index'); - * $I->seeCurrentRouteIs('posts.show', array('id' => 8)); - * ?> - * ``` - * - * @param $routeName - * @param array $params - * @see \Codeception\Module\Symfony::seeCurrentRouteIs() - */ - public function canSeeCurrentRouteIs($routeName, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentRouteIs', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that current url matches route. - * Unlike seeCurrentRouteIs, this can matches without exact route parameters - * - * ``` php - * seeCurrentRouteMatches('my_blog_pages'); - * ?> - * ``` - * - * @param $routeName - * @see \Codeception\Module\Symfony::seeInCurrentRoute() - */ - public function seeInCurrentRoute($routeName) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentRoute', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that current url matches route. - * Unlike seeCurrentRouteIs, this can matches without exact route parameters - * - * ``` php - * seeCurrentRouteMatches('my_blog_pages'); - * ?> - * ``` - * - * @param $routeName - * @see \Codeception\Module\Symfony::seeInCurrentRoute() - */ - public function canSeeInCurrentRoute($routeName) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentRoute', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks if the desired number of emails was sent. - * If no argument is provided then at least one email must be sent to satisfy the check. - * - * ``` php - * seeEmailIsSent(2); - * ?> - * ``` - * - * @param null|int $expectedCount - * @see \Codeception\Module\Symfony::seeEmailIsSent() - */ - public function seeEmailIsSent($expectedCount = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeEmailIsSent', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks if the desired number of emails was sent. - * If no argument is provided then at least one email must be sent to satisfy the check. - * - * ``` php - * seeEmailIsSent(2); - * ?> - * ``` - * - * @param null|int $expectedCount - * @see \Codeception\Module\Symfony::seeEmailIsSent() - */ - public function canSeeEmailIsSent($expectedCount = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeEmailIsSent', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that no email was sent. This is an alias for seeEmailIsSent(0). - * - * @part email - * @see \Codeception\Module\Symfony::dontSeeEmailIsSent() - */ - public function dontSeeEmailIsSent() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeEmailIsSent', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that no email was sent. This is an alias for seeEmailIsSent(0). - * - * @part email - * @see \Codeception\Module\Symfony::dontSeeEmailIsSent() - */ - public function cantSeeEmailIsSent() { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeEmailIsSent', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Grabs a service from Symfony DIC container. - * Recommended to use for unit testing. - * - * ``` php - * grabService('doctrine'); - * ?> - * ``` - * - * @param $service - * @return mixed - * @part services - * @see \Codeception\Module\Symfony::grabService() - */ - public function grabService($service) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('grabService', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Reboot client's kernel. - * Can be used to manually reboot kernel when 'rebootable_client' => false - * - * ``` php - * rebootClientKernel(); - * ... - * perform other requests - * ... - * - * ?> - * ``` - * - * @see \Codeception\Module\Symfony::rebootClientKernel() - */ - public function rebootClientKernel() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('rebootClientKernel', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Authenticates user for HTTP_AUTH - * - * @param $username - * @param $password - * @see \Codeception\Lib\InnerBrowser::amHttpAuthenticated() - */ - public function amHttpAuthenticated($username, $password) { - return $this->getScenario()->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Sets the HTTP header to the passed value - which is used on - * subsequent HTTP requests through PhpBrowser. - * - * Example: - * ```php - * haveHttpHeader('X-Requested-With', 'Codeception'); - * $I->amOnPage('test-headers.php'); - * ?> - * ``` - * - * To use special chars in Header Key use HTML Character Entities: - * Example: - * Header with underscore - 'Client_Id' - * should be represented as - 'Client_Id' or 'Client_Id' - * - * ```php - * haveHttpHeader('Client_Id', 'Codeception'); - * ?> - * ``` - * - * @param string $name the name of the request header - * @param string $value the value to set it to for subsequent - * requests - * @see \Codeception\Lib\InnerBrowser::haveHttpHeader() - */ - public function haveHttpHeader($name, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('haveHttpHeader', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Deletes the header with the passed name. Subsequent requests - * will not have the deleted header in its request. - * - * Example: - * ```php - * haveHttpHeader('X-Requested-With', 'Codeception'); - * $I->amOnPage('test-headers.php'); - * // ... - * $I->deleteHeader('X-Requested-With'); - * $I->amOnPage('some-other-page.php'); - * ?> - * ``` - * - * @param string $name the name of the header to delete. - * @see \Codeception\Lib\InnerBrowser::deleteHeader() - */ - public function deleteHeader($name) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Opens the page for the given relative URI. - * - * ``` php - * amOnPage('/'); - * // opens /register page - * $I->amOnPage('/register'); - * ``` - * - * @param string $page - * @see \Codeception\Lib\InnerBrowser::amOnPage() - */ - public function amOnPage($page) { - return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Perform a click on a link or a button, given by a locator. - * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. - * For buttons, the "value" attribute, "name" attribute, and inner text are searched. - * For links, the link text is searched. - * For images, the "alt" attribute and inner text of any parent links are searched. - * - * The second parameter is a context (CSS or XPath locator) to narrow the search. - * - * Note that if the locator matches a button of type `submit`, the form will be submitted. - * - * ``` php - * click('Logout'); - * // button of form - * $I->click('Submit'); - * // CSS button - * $I->click('#form input[type=submit]'); - * // XPath - * $I->click('//form/*[@type="submit"]'); - * // link in context - * $I->click('Logout', '#nav'); - * // using strict locator - * $I->click(['link' => 'Login']); - * ?> - * ``` - * - * @param $link - * @param $context - * @see \Codeception\Lib\InnerBrowser::click() - */ - public function click($link, $context = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current page contains the given string (case insensitive). - * - * You can specify a specific HTML element (via CSS or XPath) as the second - * parameter to only search within that element. - * - * ``` php - * see('Logout'); // I can suppose user is logged in - * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page - * $I->see('Sign Up', '//body/h1'); // with XPath - * $I->see('Sign Up', ['css' => 'body h1']); // with strict CSS locator - * ``` - * - * Note that the search is done after stripping all HTML tags from the body, - * so `$I->see('strong')` will return true for strings like: - * - * - `

I am Stronger than thou

` - * - `` - * - * But will *not* be true for strings like: - * - * - `Home` - * - `
Home` - * - `` - * - * For checking the raw source code, use `seeInSource()`. - * - * @param string $text - * @param array|string $selector optional - * @see \Codeception\Lib\InnerBrowser::see() - */ - public function see($text, $selector = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the current page contains the given string (case insensitive). - * - * You can specify a specific HTML element (via CSS or XPath) as the second - * parameter to only search within that element. - * - * ``` php - * see('Logout'); // I can suppose user is logged in - * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page - * $I->see('Sign Up', '//body/h1'); // with XPath - * $I->see('Sign Up', ['css' => 'body h1']); // with strict CSS locator - * ``` - * - * Note that the search is done after stripping all HTML tags from the body, - * so `$I->see('strong')` will return true for strings like: - * - * - `

I am Stronger than thou

` - * - `` - * - * But will *not* be true for strings like: - * - * - `Home` - * - `
Home` - * - `` - * - * For checking the raw source code, use `seeInSource()`. - * - * @param string $text - * @param array|string $selector optional - * @see \Codeception\Lib\InnerBrowser::see() - */ - public function canSee($text, $selector = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current page doesn't contain the text specified (case insensitive). - * Give a locator as the second parameter to match a specific region. - * - * ```php - * dontSee('Login'); // I can suppose user is already logged in - * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page - * $I->dontSee('Sign Up','//body/h1'); // with XPath - * $I->dontSee('Sign Up', ['css' => 'body h1']); // with strict CSS locator - * ``` - * - * Note that the search is done after stripping all HTML tags from the body, - * so `$I->dontSee('strong')` will fail on strings like: - * - * - `

I am Stronger than thou

` - * - `` - * - * But will ignore strings like: - * - * - `Home` - * - `
Home` - * - `` - * - * For checking the raw source code, use `seeInSource()`. - * - * @param string $text - * @param array|string $selector optional - * @see \Codeception\Lib\InnerBrowser::dontSee() - */ - public function dontSee($text, $selector = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSee', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the current page doesn't contain the text specified (case insensitive). - * Give a locator as the second parameter to match a specific region. - * - * ```php - * dontSee('Login'); // I can suppose user is already logged in - * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page - * $I->dontSee('Sign Up','//body/h1'); // with XPath - * $I->dontSee('Sign Up', ['css' => 'body h1']); // with strict CSS locator - * ``` - * - * Note that the search is done after stripping all HTML tags from the body, - * so `$I->dontSee('strong')` will fail on strings like: - * - * - `

I am Stronger than thou

` - * - `` - * - * But will ignore strings like: - * - * - `Home` - * - `
Home` - * - `` - * - * For checking the raw source code, use `seeInSource()`. - * - * @param string $text - * @param array|string $selector optional - * @see \Codeception\Lib\InnerBrowser::dontSee() - */ - public function cantSee($text, $selector = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current page contains the given string in its - * raw source code. - * - * ``` php - * seeInSource('

Green eggs & ham

'); - * ``` - * - * @param $raw - * @see \Codeception\Lib\InnerBrowser::seeInSource() - */ - public function seeInSource($raw) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the current page contains the given string in its - * raw source code. - * - * ``` php - * seeInSource('

Green eggs & ham

'); - * ``` - * - * @param $raw - * @see \Codeception\Lib\InnerBrowser::seeInSource() - */ - public function canSeeInSource($raw) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInSource', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current page contains the given string in its - * raw source code. - * - * ```php - * dontSeeInSource('

Green eggs & ham

'); - * ``` - * - * @param $raw - * @see \Codeception\Lib\InnerBrowser::dontSeeInSource() - */ - public function dontSeeInSource($raw) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInSource', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the current page contains the given string in its - * raw source code. - * - * ```php - * dontSeeInSource('

Green eggs & ham

'); - * ``` - * - * @param $raw - * @see \Codeception\Lib\InnerBrowser::dontSeeInSource() - */ - public function cantSeeInSource($raw) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that there's a link with the specified text. - * Give a full URL as the second parameter to match links with that exact URL. - * - * ``` php - * seeLink('Logout'); // matches Logout - * $I->seeLink('Logout','/logout'); // matches Logout - * ?> - * ``` - * - * @param string $text - * @param string $url optional - * @see \Codeception\Lib\InnerBrowser::seeLink() - */ - public function seeLink($text, $url = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that there's a link with the specified text. - * Give a full URL as the second parameter to match links with that exact URL. - * - * ``` php - * seeLink('Logout'); // matches Logout - * $I->seeLink('Logout','/logout'); // matches Logout - * ?> - * ``` - * - * @param string $text - * @param string $url optional - * @see \Codeception\Lib\InnerBrowser::seeLink() - */ - public function canSeeLink($text, $url = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the page doesn't contain a link with the given string. - * If the second parameter is given, only links with a matching "href" attribute will be checked. - * - * ``` php - * dontSeeLink('Logout'); // I suppose user is not logged in - * $I->dontSeeLink('Checkout now', '/store/cart.php'); - * ?> - * ``` - * - * @param string $text - * @param string $url optional - * @see \Codeception\Lib\InnerBrowser::dontSeeLink() - */ - public function dontSeeLink($text, $url = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeLink', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the page doesn't contain a link with the given string. - * If the second parameter is given, only links with a matching "href" attribute will be checked. - * - * ``` php - * dontSeeLink('Logout'); // I suppose user is not logged in - * $I->dontSeeLink('Checkout now', '/store/cart.php'); - * ?> - * ``` - * - * @param string $text - * @param string $url optional - * @see \Codeception\Lib\InnerBrowser::dontSeeLink() - */ - public function cantSeeLink($text, $url = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that current URI contains the given string. - * - * ``` php - * seeInCurrentUrl('home'); - * // to match: /users/1 - * $I->seeInCurrentUrl('/users/'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() - */ - public function seeInCurrentUrl($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that current URI contains the given string. - * - * ``` php - * seeInCurrentUrl('home'); - * // to match: /users/1 - * $I->seeInCurrentUrl('/users/'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() - */ - public function canSeeInCurrentUrl($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URI doesn't contain the given string. - * - * ``` php - * dontSeeInCurrentUrl('/users/'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() - */ - public function dontSeeInCurrentUrl($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInCurrentUrl', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the current URI doesn't contain the given string. - * - * ``` php - * dontSeeInCurrentUrl('/users/'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() - */ - public function cantSeeInCurrentUrl($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URL is equal to the given string. - * Unlike `seeInCurrentUrl`, this only matches the full URL. - * - * ``` php - * seeCurrentUrlEquals('/'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() - */ - public function seeCurrentUrlEquals($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the current URL is equal to the given string. - * Unlike `seeInCurrentUrl`, this only matches the full URL. - * - * ``` php - * seeCurrentUrlEquals('/'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() - */ - public function canSeeCurrentUrlEquals($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URL doesn't equal the given string. - * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. - * - * ``` php - * dontSeeCurrentUrlEquals('/'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() - */ - public function dontSeeCurrentUrlEquals($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCurrentUrlEquals', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the current URL doesn't equal the given string. - * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. - * - * ``` php - * dontSeeCurrentUrlEquals('/'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() - */ - public function cantSeeCurrentUrlEquals($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URL matches the given regular expression. - * - * ``` php - * seeCurrentUrlMatches('~^/users/(\d+)~'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() - */ - public function seeCurrentUrlMatches($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the current URL matches the given regular expression. - * - * ``` php - * seeCurrentUrlMatches('~^/users/(\d+)~'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() - */ - public function canSeeCurrentUrlMatches($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that current url doesn't match the given regular expression. - * - * ``` php - * dontSeeCurrentUrlMatches('~^/users/(\d+)~'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() - */ - public function dontSeeCurrentUrlMatches($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCurrentUrlMatches', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that current url doesn't match the given regular expression. - * - * ``` php - * dontSeeCurrentUrlMatches('~^/users/(\d+)~'); - * ?> - * ``` - * - * @param string $uri - * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() - */ - public function cantSeeCurrentUrlMatches($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Executes the given regular expression against the current URI and returns the first capturing group. - * If no parameters are provided, the full URI is returned. - * - * ``` php - * grabFromCurrentUrl('~^/user/(\d+)/~'); - * $uri = $I->grabFromCurrentUrl(); - * ?> - * ``` - * - * @param string $uri optional - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl() - */ - public function grabFromCurrentUrl($uri = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the specified checkbox is checked. - * - * ``` php - * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms - * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. - * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); - * ?> - * ``` - * - * @param $checkbox - * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() - */ - public function seeCheckboxIsChecked($checkbox) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the specified checkbox is checked. - * - * ``` php - * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms - * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. - * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); - * ?> - * ``` - * - * @param $checkbox - * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() - */ - public function canSeeCheckboxIsChecked($checkbox) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Check that the specified checkbox is unchecked. - * - * ``` php - * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms - * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. - * ?> - * ``` - * - * @param $checkbox - * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() - */ - public function dontSeeCheckboxIsChecked($checkbox) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCheckboxIsChecked', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Check that the specified checkbox is unchecked. - * - * ``` php - * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms - * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. - * ?> - * ``` - * - * @param $checkbox - * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() - */ - public function cantSeeCheckboxIsChecked($checkbox) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given input field or textarea *equals* (i.e. not just contains) the given value. - * Fields are matched by label text, the "name" attribute, CSS, or XPath. - * - * ``` php - * seeInField('Body','Type your comment here'); - * $I->seeInField('form textarea[name=body]','Type your comment here'); - * $I->seeInField('form input[type=hidden]','hidden_value'); - * $I->seeInField('#searchform input','Search'); - * $I->seeInField('//form/*[@name=search]','Search'); - * $I->seeInField(['name' => 'search'], 'Search'); - * ?> - * ``` - * - * @param $field - * @param $value - * @see \Codeception\Lib\InnerBrowser::seeInField() - */ - public function seeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the given input field or textarea *equals* (i.e. not just contains) the given value. - * Fields are matched by label text, the "name" attribute, CSS, or XPath. - * - * ``` php - * seeInField('Body','Type your comment here'); - * $I->seeInField('form textarea[name=body]','Type your comment here'); - * $I->seeInField('form input[type=hidden]','hidden_value'); - * $I->seeInField('#searchform input','Search'); - * $I->seeInField('//form/*[@name=search]','Search'); - * $I->seeInField(['name' => 'search'], 'Search'); - * ?> - * ``` - * - * @param $field - * @param $value - * @see \Codeception\Lib\InnerBrowser::seeInField() - */ - public function canSeeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that an input field or textarea doesn't contain the given value. - * For fuzzy locators, the field is matched by label text, CSS and XPath. - * - * ``` php - * dontSeeInField('Body','Type your comment here'); - * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); - * $I->dontSeeInField('form input[type=hidden]','hidden_value'); - * $I->dontSeeInField('#searchform input','Search'); - * $I->dontSeeInField('//form/*[@name=search]','Search'); - * $I->dontSeeInField(['name' => 'search'], 'Search'); - * ?> - * ``` - * - * @param $field - * @param $value - * @see \Codeception\Lib\InnerBrowser::dontSeeInField() - */ - public function dontSeeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInField', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that an input field or textarea doesn't contain the given value. - * For fuzzy locators, the field is matched by label text, CSS and XPath. - * - * ``` php - * dontSeeInField('Body','Type your comment here'); - * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); - * $I->dontSeeInField('form input[type=hidden]','hidden_value'); - * $I->dontSeeInField('#searchform input','Search'); - * $I->dontSeeInField('//form/*[@name=search]','Search'); - * $I->dontSeeInField(['name' => 'search'], 'Search'); - * ?> - * ``` - * - * @param $field - * @param $value - * @see \Codeception\Lib\InnerBrowser::dontSeeInField() - */ - public function cantSeeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks if the array of form parameters (name => value) are set on the form matched with the - * passed selector. - * - * ``` php - * seeInFormFields('form[name=myform]', [ - * 'input1' => 'value', - * 'input2' => 'other value', - * ]); - * ?> - * ``` - * - * For multi-select elements, or to check values of multiple elements with the same name, an - * array may be passed: - * - * ``` php - * seeInFormFields('.form-class', [ - * 'multiselect' => [ - * 'value1', - * 'value2', - * ], - * 'checkbox[]' => [ - * 'a checked value', - * 'another checked value', - * ], - * ]); - * ?> - * ``` - * - * Additionally, checkbox values can be checked with a boolean. - * - * ``` php - * seeInFormFields('#form-id', [ - * 'checkbox1' => true, // passes if checked - * 'checkbox2' => false, // passes if unchecked - * ]); - * ?> - * ``` - * - * Pair this with submitForm for quick testing magic. - * - * ``` php - * 'value', - * 'field2' => 'another value', - * 'checkbox1' => true, - * // ... - * ]; - * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); - * // $I->amOnPage('/path/to/form-page') may be needed - * $I->seeInFormFields('//form[@id=my-form]', $form); - * ?> - * ``` - * - * @param $formSelector - * @param $params - * @see \Codeception\Lib\InnerBrowser::seeInFormFields() - */ - public function seeInFormFields($formSelector, $params) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks if the array of form parameters (name => value) are set on the form matched with the - * passed selector. - * - * ``` php - * seeInFormFields('form[name=myform]', [ - * 'input1' => 'value', - * 'input2' => 'other value', - * ]); - * ?> - * ``` - * - * For multi-select elements, or to check values of multiple elements with the same name, an - * array may be passed: - * - * ``` php - * seeInFormFields('.form-class', [ - * 'multiselect' => [ - * 'value1', - * 'value2', - * ], - * 'checkbox[]' => [ - * 'a checked value', - * 'another checked value', - * ], - * ]); - * ?> - * ``` - * - * Additionally, checkbox values can be checked with a boolean. - * - * ``` php - * seeInFormFields('#form-id', [ - * 'checkbox1' => true, // passes if checked - * 'checkbox2' => false, // passes if unchecked - * ]); - * ?> - * ``` - * - * Pair this with submitForm for quick testing magic. - * - * ``` php - * 'value', - * 'field2' => 'another value', - * 'checkbox1' => true, - * // ... - * ]; - * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); - * // $I->amOnPage('/path/to/form-page') may be needed - * $I->seeInFormFields('//form[@id=my-form]', $form); - * ?> - * ``` - * - * @param $formSelector - * @param $params - * @see \Codeception\Lib\InnerBrowser::seeInFormFields() - */ - public function canSeeInFormFields($formSelector, $params) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks if the array of form parameters (name => value) are not set on the form matched with - * the passed selector. - * - * ``` php - * dontSeeInFormFields('form[name=myform]', [ - * 'input1' => 'non-existent value', - * 'input2' => 'other non-existent value', - * ]); - * ?> - * ``` - * - * To check that an element hasn't been assigned any one of many values, an array can be passed - * as the value: - * - * ``` php - * dontSeeInFormFields('.form-class', [ - * 'fieldName' => [ - * 'This value shouldn\'t be set', - * 'And this value shouldn\'t be set', - * ], - * ]); - * ?> - * ``` - * - * Additionally, checkbox values can be checked with a boolean. - * - * ``` php - * dontSeeInFormFields('#form-id', [ - * 'checkbox1' => true, // fails if checked - * 'checkbox2' => false, // fails if unchecked - * ]); - * ?> - * ``` - * - * @param $formSelector - * @param $params - * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() - */ - public function dontSeeInFormFields($formSelector, $params) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInFormFields', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks if the array of form parameters (name => value) are not set on the form matched with - * the passed selector. - * - * ``` php - * dontSeeInFormFields('form[name=myform]', [ - * 'input1' => 'non-existent value', - * 'input2' => 'other non-existent value', - * ]); - * ?> - * ``` - * - * To check that an element hasn't been assigned any one of many values, an array can be passed - * as the value: - * - * ``` php - * dontSeeInFormFields('.form-class', [ - * 'fieldName' => [ - * 'This value shouldn\'t be set', - * 'And this value shouldn\'t be set', - * ], - * ]); - * ?> - * ``` - * - * Additionally, checkbox values can be checked with a boolean. - * - * ``` php - * dontSeeInFormFields('#form-id', [ - * 'checkbox1' => true, // fails if checked - * 'checkbox2' => false, // fails if unchecked - * ]); - * ?> - * ``` - * - * @param $formSelector - * @param $params - * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() - */ - public function cantSeeInFormFields($formSelector, $params) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Submits the given form on the page, with the given form - * values. Pass the form field's values as an array in the second - * parameter. - * - * Although this function can be used as a short-hand version of - * `fillField()`, `selectOption()`, `click()` etc. it has some important - * differences: - * - * * Only field *names* may be used, not CSS/XPath selectors nor field labels - * * If a field is sent to this function that does *not* exist on the page, - * it will silently be added to the HTTP request. This is helpful for testing - * some types of forms, but be aware that you will *not* get an exception - * like you would if you called `fillField()` or `selectOption()` with - * a missing field. - * - * Fields that are not provided will be filled by their values from the page, - * or from any previous calls to `fillField()`, `selectOption()` etc. - * You don't need to click the 'Submit' button afterwards. - * This command itself triggers the request to form's action. - * - * You can optionally specify which button's value to include - * in the request with the last parameter (as an alternative to - * explicitly setting its value in the second parameter), as - * button values are not otherwise included in the request. - * - * Examples: - * - * ``` php - * submitForm('#login', [ - * 'login' => 'davert', - * 'password' => '123456' - * ]); - * // or - * $I->submitForm('#login', [ - * 'login' => 'davert', - * 'password' => '123456' - * ], 'submitButtonName'); - * - * ``` - * - * For example, given this sample "Sign Up" form: - * - * ``` html - *
- * Login: - *
- * Password: - *
- * Do you agree to our terms? - *
- * Select pricing plan: - * - * - *
- * ``` - * - * You could write the following to submit it: - * - * ``` php - * submitForm( - * '#userForm', - * [ - * 'user' => [ - * 'login' => 'Davert', - * 'password' => '123456', - * 'agree' => true - * ] - * ], - * 'submitButton' - * ); - * ``` - * Note that "2" will be the submitted value for the "plan" field, as it is - * the selected option. - * - * You can also emulate a JavaScript submission by not specifying any - * buttons in the third parameter to submitForm. - * - * ```php - * submitForm( - * '#userForm', - * [ - * 'user' => [ - * 'login' => 'Davert', - * 'password' => '123456', - * 'agree' => true - * ] - * ] - * ); - * ``` - * - * This function works well when paired with `seeInFormFields()` - * for quickly testing CRUD interfaces and form validation logic. - * - * ``` php - * 'value', - * 'field2' => 'another value', - * 'checkbox1' => true, - * // ... - * ]; - * $I->submitForm('#my-form', $form, 'submitButton'); - * // $I->amOnPage('/path/to/form-page') may be needed - * $I->seeInFormFields('#my-form', $form); - * ``` - * - * Parameter values can be set to arrays for multiple input fields - * of the same name, or multi-select combo boxes. For checkboxes, - * you can use either the string value or boolean `true`/`false` which will - * be replaced by the checkbox's value in the DOM. - * - * ``` php - * submitForm('#my-form', [ - * 'field1' => 'value', - * 'checkbox' => [ - * 'value of first checkbox', - * 'value of second checkbox', - * ], - * 'otherCheckboxes' => [ - * true, - * false, - * false - * ], - * 'multiselect' => [ - * 'first option value', - * 'second option value' - * ] - * ]); - * ``` - * - * Mixing string and boolean values for a checkbox's value is not supported - * and may produce unexpected results. - * - * Field names ending in `[]` must be passed without the trailing square - * bracket characters, and must contain an array for its value. This allows - * submitting multiple values with the same name, consider: - * - * ```php - * submitForm('#my-form', [ - * 'field[]' => 'value', - * 'field[]' => 'another value', // 'field[]' is already a defined key - * ]); - * ``` - * - * The solution is to pass an array value: - * - * ```php - * submitForm('#my-form', [ - * 'field' => [ - * 'value', - * 'another value', - * ] - * ]); - * ``` - * - * @param $selector - * @param $params - * @param $button - * @see \Codeception\Lib\InnerBrowser::submitForm() - */ - public function submitForm($selector, $params, $button = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Fills a text field or textarea with the given string. - * - * ``` php - * fillField("//input[@type='text']", "Hello World!"); - * $I->fillField(['name' => 'email'], 'jon@mail.com'); - * ?> - * ``` - * - * @param $field - * @param $value - * @see \Codeception\Lib\InnerBrowser::fillField() - */ - public function fillField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('fillField', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Selects an option in a select tag or in radio button group. - * - * ``` php - * selectOption('form select[name=account]', 'Premium'); - * $I->selectOption('form input[name=payment]', 'Monthly'); - * $I->selectOption('//form/select[@name=account]', 'Monthly'); - * ?> - * ``` - * - * Provide an array for the second argument to select multiple options: - * - * ``` php - * selectOption('Which OS do you use?', array('Windows','Linux')); - * ?> - * ``` - * - * Or provide an associative array for the second argument to specifically define which selection method should be used: - * - * ``` php - * selectOption('Which OS do you use?', array('text' => 'Windows')); // Only search by text 'Windows' - * $I->selectOption('Which OS do you use?', array('value' => 'windows')); // Only search by value 'windows' - * ?> - * ``` - * - * @param $select - * @param $option - * @see \Codeception\Lib\InnerBrowser::selectOption() - */ - public function selectOption($select, $option) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('selectOption', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Ticks a checkbox. For radio buttons, use the `selectOption` method instead. - * - * ``` php - * checkOption('#agree'); - * ?> - * ``` - * - * @param $option - * @see \Codeception\Lib\InnerBrowser::checkOption() - */ - public function checkOption($option) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('checkOption', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Unticks a checkbox. - * - * ``` php - * uncheckOption('#notify'); - * ?> - * ``` - * - * @param $option - * @see \Codeception\Lib\InnerBrowser::uncheckOption() - */ - public function uncheckOption($option) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Attaches a file relative to the Codeception `_data` directory to the given file upload field. - * - * ``` php - * attachFile('input[@type="file"]', 'prices.xls'); - * ?> - * ``` - * - * @param $field - * @param $filename - * @see \Codeception\Lib\InnerBrowser::attachFile() - */ - public function attachFile($field, $filename) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('attachFile', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * If your page triggers an ajax request, you can perform it manually. - * This action sends a GET ajax request with specified params. - * - * See ->sendAjaxPostRequest for examples. - * - * @param $uri - * @param $params - * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest() - */ - public function sendAjaxGetRequest($uri, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * If your page triggers an ajax request, you can perform it manually. - * This action sends a POST ajax request with specified params. - * Additional params can be passed as array. - * - * Example: - * - * Imagine that by clicking checkbox you trigger ajax request which updates user settings. - * We emulate that click by running this ajax request manually. - * - * ``` php - * sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST - * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET - * - * ``` - * - * @param $uri - * @param $params - * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest() - */ - public function sendAjaxPostRequest($uri, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * If your page triggers an ajax request, you can perform it manually. - * This action sends an ajax request with specified method and params. - * - * Example: - * - * You need to perform an ajax request specifying the HTTP method. - * - * ``` php - * sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title')); - * - * ``` - * - * @param $method - * @param $uri - * @param $params - * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest() - */ - public function sendAjaxRequest($method, $uri, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Saves current page's HTML into a temprary file. - * Use this method in debug mode within an interactive pause to get a source code of current page. - * - * ```php - * makePageSnapshot('edit_page'); - * // saved to: tests/_output/debug/edit_page.html - * $I->makePageSnapshot(); - * // saved to: tests/_output/debug/2017-05-26_14-24-11_4b3403665fea6.html - * ``` - * - * @param null $name - * @see \Codeception\Lib\InnerBrowser::makeHtmlSnapshot() - */ - public function makeHtmlSnapshot($name = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('makeHtmlSnapshot', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Finds and returns the text contents of the given element. - * If a fuzzy locator is used, the element is found using CSS, XPath, - * and by matching the full page source by regular expression. - * - * ``` php - * grabTextFrom('h1'); - * $heading = $I->grabTextFrom('descendant-or-self::h1'); - * $value = $I->grabTextFrom('~ - * ``` - * - * @param $cssOrXPathOrRegex - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::grabTextFrom() - */ - public function grabTextFrom($cssOrXPathOrRegex) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Grabs the value of the given attribute value from the given element. - * Fails if element is not found. - * - * ``` php - * grabAttributeFrom('#tooltip', 'title'); - * ?> - * ``` - * - * - * @param $cssOrXpath - * @param $attribute - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom() - */ - public function grabAttributeFrom($cssOrXpath, $attribute) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Grabs either the text content, or attribute values, of nodes - * matched by $cssOrXpath and returns them as an array. - * - * ```html - * First - * Second - * Third - * ``` - * - * ```php - * grabMultiple('a'); - * - * // would return ['#first', '#second', '#third'] - * $aLinks = $I->grabMultiple('a', 'href'); - * ?> - * ``` - * - * @param $cssOrXpath - * @param $attribute - * @return string[] - * @see \Codeception\Lib\InnerBrowser::grabMultiple() - */ - public function grabMultiple($cssOrXpath, $attribute = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * @param $field - * - * @return array|mixed|null|string - * @see \Codeception\Lib\InnerBrowser::grabValueFrom() - */ - public function grabValueFrom($field) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Sets a cookie with the given name and value. - * You can set additional cookie params like `domain`, `path`, `expires`, `secure` in array passed as last argument. - * - * ``` php - * setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); - * ?> - * ``` - * - * @param $name - * @param $val - * @param array $params - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::setCookie() - */ - public function setCookie($name, $val, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Grabs a cookie value. - * You can set additional cookie params like `domain`, `path` in array passed as last argument. - * - * @param $cookie - * - * @param array $params - * @return mixed - * @see \Codeception\Lib\InnerBrowser::grabCookie() - */ - public function grabCookie($cookie, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Grabs current page source code. - * - * @throws ModuleException if no page was opened. - * - * @return string Current page source code. - * @see \Codeception\Lib\InnerBrowser::grabPageSource() - */ - public function grabPageSource() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('grabPageSource', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that a cookie with the given name is set. - * You can set additional cookie params like `domain`, `path` as array passed in last argument. - * - * ``` php - * seeCookie('PHPSESSID'); - * ?> - * ``` - * - * @param $cookie - * @param array $params - * @return mixed - * @see \Codeception\Lib\InnerBrowser::seeCookie() - */ - public function seeCookie($cookie, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that a cookie with the given name is set. - * You can set additional cookie params like `domain`, `path` as array passed in last argument. - * - * ``` php - * seeCookie('PHPSESSID'); - * ?> - * ``` - * - * @param $cookie - * @param array $params - * @return mixed - * @see \Codeception\Lib\InnerBrowser::seeCookie() - */ - public function canSeeCookie($cookie, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that there isn't a cookie with the given name. - * You can set additional cookie params like `domain`, `path` as array passed in last argument. - * - * @param $cookie - * - * @param array $params - * @return mixed - * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() - */ - public function dontSeeCookie($cookie, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCookie', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that there isn't a cookie with the given name. - * You can set additional cookie params like `domain`, `path` as array passed in last argument. - * - * @param $cookie - * - * @param array $params - * @return mixed - * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() - */ - public function cantSeeCookie($cookie, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Unsets cookie with the given name. - * You can set additional cookie params like `domain`, `path` in array passed as last argument. - * - * @param $cookie - * - * @param array $params - * @return mixed - * @see \Codeception\Lib\InnerBrowser::resetCookie() - */ - public function resetCookie($name, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given element exists on the page and is visible. - * You can also specify expected attributes of this element. - * - * ``` php - * seeElement('.error'); - * $I->seeElement('//form/input[1]'); - * $I->seeElement('input', ['name' => 'login']); - * $I->seeElement('input', ['value' => '123456']); - * - * // strict locator in first arg, attributes in second - * $I->seeElement(['css' => 'form input'], ['name' => 'login']); - * ?> - * ``` - * - * @param $selector - * @param array $attributes - * @return - * @see \Codeception\Lib\InnerBrowser::seeElement() - */ - public function seeElement($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the given element exists on the page and is visible. - * You can also specify expected attributes of this element. - * - * ``` php - * seeElement('.error'); - * $I->seeElement('//form/input[1]'); - * $I->seeElement('input', ['name' => 'login']); - * $I->seeElement('input', ['value' => '123456']); - * - * // strict locator in first arg, attributes in second - * $I->seeElement(['css' => 'form input'], ['name' => 'login']); - * ?> - * ``` - * - * @param $selector - * @param array $attributes - * @return - * @see \Codeception\Lib\InnerBrowser::seeElement() - */ - public function canSeeElement($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given element is invisible or not present on the page. - * You can also specify expected attributes of this element. - * - * ``` php - * dontSeeElement('.error'); - * $I->dontSeeElement('//form/input[1]'); - * $I->dontSeeElement('input', ['name' => 'login']); - * $I->dontSeeElement('input', ['value' => '123456']); - * ?> - * ``` - * - * @param $selector - * @param array $attributes - * @see \Codeception\Lib\InnerBrowser::dontSeeElement() - */ - public function dontSeeElement($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeElement', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the given element is invisible or not present on the page. - * You can also specify expected attributes of this element. - * - * ``` php - * dontSeeElement('.error'); - * $I->dontSeeElement('//form/input[1]'); - * $I->dontSeeElement('input', ['name' => 'login']); - * $I->dontSeeElement('input', ['value' => '123456']); - * ?> - * ``` - * - * @param $selector - * @param array $attributes - * @see \Codeception\Lib\InnerBrowser::dontSeeElement() - */ - public function cantSeeElement($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that there are a certain number of elements matched by the given locator on the page. - * - * ``` php - * seeNumberOfElements('tr', 10); - * $I->seeNumberOfElements('tr', [0,10]); // between 0 and 10 elements - * ?> - * ``` - * @param $selector - * @param mixed $expected int or int[] - * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() - */ - public function seeNumberOfElements($selector, $expected) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that there are a certain number of elements matched by the given locator on the page. - * - * ``` php - * seeNumberOfElements('tr', 10); - * $I->seeNumberOfElements('tr', [0,10]); // between 0 and 10 elements - * ?> - * ``` - * @param $selector - * @param mixed $expected int or int[] - * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() - */ - public function canSeeNumberOfElements($selector, $expected) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given option is selected. - * - * ``` php - * seeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> - * ``` - * - * @param $selector - * @param $optionText - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() - */ - public function seeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the given option is selected. - * - * ``` php - * seeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> - * ``` - * - * @param $selector - * @param $optionText - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() - */ - public function canSeeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given option is not selected. - * - * ``` php - * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> - * ``` - * - * @param $selector - * @param $optionText - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() - */ - public function dontSeeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeOptionIsSelected', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the given option is not selected. - * - * ``` php - * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> - * ``` - * - * @param $selector - * @param $optionText - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() - */ - public function cantSeeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Asserts that current page has 404 response status code. - * @see \Codeception\Lib\InnerBrowser::seePageNotFound() - */ - public function seePageNotFound() { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Asserts that current page has 404 response status code. - * @see \Codeception\Lib\InnerBrowser::seePageNotFound() - */ - public function canSeePageNotFound() { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that response code is equal to value provided. - * - * ```php - * seeResponseCodeIs(200); - * - * // recommended \Codeception\Util\HttpCode - * $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - * ``` - * - * @param $code - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() - */ - public function seeResponseCodeIs($code) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that response code is equal to value provided. - * - * ```php - * seeResponseCodeIs(200); - * - * // recommended \Codeception\Util\HttpCode - * $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); - * ``` - * - * @param $code - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() - */ - public function canSeeResponseCodeIs($code) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that response code is between a certain range. Between actually means [from <= CODE <= to] - * - * @param $from - * @param $to - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIsBetween() - */ - public function seeResponseCodeIsBetween($from, $to) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIsBetween', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that response code is between a certain range. Between actually means [from <= CODE <= to] - * - * @param $from - * @param $to - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIsBetween() - */ - public function canSeeResponseCodeIsBetween($from, $to) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIsBetween', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that response code is equal to value provided. - * - * ```php - * dontSeeResponseCodeIs(200); - * - * // recommended \Codeception\Util\HttpCode - * $I->dontSeeResponseCodeIs(\Codeception\Util\HttpCode::OK); - * ``` - * @param $code - * @see \Codeception\Lib\InnerBrowser::dontSeeResponseCodeIs() - */ - public function dontSeeResponseCodeIs($code) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeResponseCodeIs', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that response code is equal to value provided. - * - * ```php - * dontSeeResponseCodeIs(200); - * - * // recommended \Codeception\Util\HttpCode - * $I->dontSeeResponseCodeIs(\Codeception\Util\HttpCode::OK); - * ``` - * @param $code - * @see \Codeception\Lib\InnerBrowser::dontSeeResponseCodeIs() - */ - public function cantSeeResponseCodeIs($code) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseCodeIs', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the response code 2xx - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIsSuccessful() - */ - public function seeResponseCodeIsSuccessful() { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIsSuccessful', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the response code 2xx - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIsSuccessful() - */ - public function canSeeResponseCodeIsSuccessful() { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIsSuccessful', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the response code 3xx - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIsRedirection() - */ - public function seeResponseCodeIsRedirection() { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIsRedirection', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the response code 3xx - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIsRedirection() - */ - public function canSeeResponseCodeIsRedirection() { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIsRedirection', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the response code is 4xx - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIsClientError() - */ - public function seeResponseCodeIsClientError() { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIsClientError', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the response code is 4xx - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIsClientError() - */ - public function canSeeResponseCodeIsClientError() { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIsClientError', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the response code is 5xx - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIsServerError() - */ - public function seeResponseCodeIsServerError() { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIsServerError', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the response code is 5xx - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIsServerError() - */ - public function canSeeResponseCodeIsServerError() { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIsServerError', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the page title contains the given string. - * - * ``` php - * seeInTitle('Blog - Post #1'); - * ?> - * ``` - * - * @param $title - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::seeInTitle() - */ - public function seeInTitle($title) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the page title contains the given string. - * - * ``` php - * seeInTitle('Blog - Post #1'); - * ?> - * ``` - * - * @param $title - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::seeInTitle() - */ - public function canSeeInTitle($title) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the page title does not contain the given string. - * - * @param $title - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() - */ - public function dontSeeInTitle($title) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInTitle', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * [!] Conditional Assertion: Test won't be stopped on fail - * Checks that the page title does not contain the given string. - * - * @param $title - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() - */ - public function cantSeeInTitle($title) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Switch to iframe or frame on the page. - * - * Example: - * ``` html - *