diff --git a/.devbox/.ddev/config.yaml b/.devbox/.ddev/config.yaml index 7a00ec02f..961749e29 100644 --- a/.devbox/.ddev/config.yaml +++ b/.devbox/.ddev/config.yaml @@ -26,6 +26,7 @@ hooks: - exec: /var/www/html/bin/typo3 cache:flush - exec: /var/www/html/bin/typo3 cache:warmup - exec: /var/www/html/bin/typo3 backend:unlock + - exec: mkdir -p /var/www/html/var/lock omit_containers: [ dba, ddev-ssh-agent ] webimage_extra_packages: [ cron ] use_dns_when_possible: true diff --git a/.devbox/.ddev/docker-compose.selenium.yaml b/.devbox/.ddev/docker-compose.selenium.yaml index 8c5306781..f4b16613b 100644 --- a/.devbox/.ddev/docker-compose.selenium.yaml +++ b/.devbox/.ddev/docker-compose.selenium.yaml @@ -1,6 +1,3 @@ -# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-beta-channel.yml up` -# Add the `-d` flag at the end for detached execution -# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-beta-channel.yml down` version: "3" services: chrome: diff --git a/.github/workflows/Acceptance.yml b/.github/workflows/Acceptance.yml index 023a9810e..36ab2003f 100644 --- a/.github/workflows/Acceptance.yml +++ b/.github/workflows/Acceptance.yml @@ -55,7 +55,7 @@ jobs: sed -i "s|$FROM_PATH|$TO_PATH|g" .ddev/docker-compose.volume.yaml ddev restart rm -rf vendor composer.lock - ddev composer require typo3/cms-core=${{ matrix.typo3 }} + ddev composer require typo3/cms-core=${{ matrix.typo3 }} tomasnorre/crawler=dev-$BRANCH_NAME ddev exec sudo apt remove -y php${{ matrix.php }}-uploadprogress ddev exec bin/typo3 backend:lock ddev exec bin/typo3 extension:setup diff --git a/Resources/Private/Templates/Backend/ShowLog.html b/Resources/Private/Templates/Backend/ShowLog.html index edce2c50a..91a02d337 100644 --- a/Resources/Private/Templates/Backend/ShowLog.html +++ b/Resources/Private/Templates/Backend/ShowLog.html @@ -1,203 +1,240 @@ - +

- - - - - - - - + + + + + + + +

-
- - - -
-
- - - - - - - - - - - -
- - - - - -
-   - -
-   - -
-
-
+ + + + +
+
+ + + + + + + + + + + +
+ + + + + +
+   + +
+   + +
+
+
- - - - : - now -
- - -

-
+ + + + : + now +
+ + +

+
+ +
+ Status: {queueStatus}
+ {queueDetails -> f:format.raw()} +

+
+ + + + + + + + + + + +
- Status: {queueStatus}
- {queueDetails -> f:format.raw()} -

- - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+
- - - -   - - - - - - - - - - - - - - - - TSFE->idTSFE->gr_list
{logEntry.title -> f:format.raw()}
+ + + + + + - + - - - + + + + + + + + + + + + + + + + + + + + + + + - + - + + + - + - + + + + + + + + + - + + + + + + + + + - - - - - - - - - - - - + + - - -
+ + + +  {logEntry.noEntries} + + {logEntry.qid.link-text}{logEntry.refresh.link-text -> f:format.raw()} {logEntry.refresh.warning -> f:format.raw()} + + + + + + + + + + + + + + TSFE->idTSFE->gr_list
{logEntry.title -> f:format.raw()}{logEntry.columns.result_log}{logEntry.noEntries} {logEntry.qid.link-text}{logEntry.refresh.link-text + -> f:format.raw()} {logEntry.refresh.warning -> f:format.raw()} + - - {logEntry.columns.result_log} {logEntry.columns.scheduled} + + {logEntry.columns.scheduled}{logEntry.columns.exec_time} {logEntry.columns.exec_time}{logEntry.columns.result_status}{logEntry.columns.url -> f:format.raw()}{logEntry.columns.feUserGroupList}{logEntry.columns.procInstructions}{logEntry.columns.set_id}{logEntry.columns.tsfe_id}{logEntry.columns.tsfe_gr_list} {logEntry.columns.result_status}{logEntry.columns.url -> f:format.raw()}{logEntry.columns.feUserGroupList}{logEntry.columns.procInstructions}{logEntry.columns.set_id}{logEntry.columns.tsfe_id}{logEntry.columns.tsfe_gr_list}
-
-
+ + + + + + +
+ + + + + +
+
+ +
+ +
diff --git a/Tests/Acceptance/BackendModule/BackendModuleCest.php b/Tests/Acceptance/BackendModule/BackendModuleCest.php index 5b3b70ca2..4b7e2ed3c 100644 --- a/Tests/Acceptance/BackendModule/BackendModuleCest.php +++ b/Tests/Acceptance/BackendModule/BackendModuleCest.php @@ -20,6 +20,7 @@ * The TYPO3 project - inspiring people to share! */ +use AOE\Crawler\Tests\Acceptance\Support\Helper\ModalDialog; use AOE\Crawler\Tests\Acceptance\Support\Helper\PageTree; use AOE\Crawler\Tests\Acceptance\Support\Step\Acceptance\Admin; use Step\Acceptance\BackendModule; @@ -196,30 +197,38 @@ public function crawlerUrlsContinueAndShowLogCheckDepthDropdown( $I->waitForText('https://crawler-devbox.ddev.site/access-restricted-page', 10); } - public function flushVisibleEntries(BackendModule $I, Admin $adminStep, PageTree $pageTree): void - { + public function flushVisibleEntries( + BackendModule $I, + Admin $adminStep, + PageTree $pageTree, + ModalDialog $modalDialog + ): void { // Will test twice, but done to avoid duplicate code $this->crawlerUrlsContinueAndShowLogCheckDepthDropdown($I, $adminStep, $pageTree); $I->click('Flush entire queue'); - $I->switchToMainFrame(); - $I->seeInPopup('Are you sure?'); - $I->click('OK'); - $I->switchToContentFrame(); $I->wait(3); + $modalDialog->canSeeDialog(); + $modalDialog->clickButtonInDialog('OK'); + $I->wait(1); $I->canSeeNumberOfElements('a.refreshLink', 0); $this->crawlerUrlsContinueAndShowLogCheckDepthDropdown($I, $adminStep, $pageTree); $I->canSeeNumberOfElements('a.refreshLink', 9); - $I->selectOption('logDisplay', 'Finished'); + $I->selectOption('displayLog', 'Finished'); $I->canSeeNumberOfElements('a.refreshLink', 0); $I->click('Flush visible entries'); - $I->acceptPopup(); $I->wait(3); - $I->selectOption('logDisplay', 'All'); + $modalDialog->canSeeDialog(); + $modalDialog->clickButtonInDialog('OK'); + $I->wait(1); + $I->switchToContentFrame(); + $I->selectOption('displayLog', 'All'); $I->canSeeNumberOfElements('a.refreshLink', 9); - $I->selectOption('logDisplay', 'Pending'); + $I->selectOption('displayLog', 'Pending'); $I->click('Flush visible entries'); - $I->acceptPopup(); $I->wait(3); + $modalDialog->canSeeDialog(); + $modalDialog->clickButtonInDialog('OK'); + $I->wait(1); $I->canSeeNumberOfElements('a.refreshLink', 0); } diff --git a/Tests/Acceptance/Support/Helper/ModalDialog.php b/Tests/Acceptance/Support/Helper/ModalDialog.php new file mode 100644 index 000000000..aedb1ab45 --- /dev/null +++ b/Tests/Acceptance/Support/Helper/ModalDialog.php @@ -0,0 +1,86 @@ + + * + * This file is part of the TYPO3 Crawler Extension. + * + * It is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, either version 2 + * of the License, or any later version. + * + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + * + * The TYPO3 project - inspiring people to share! + */ + +/** + * This is copied from + * https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Tests/Acceptance/Support/Helper/ModalDialog.php + */ + +namespace AOE\Crawler\Tests\Acceptance\Support\Helper; + +use AcceptanceTester; +use TYPO3\TestingFramework\Core\Acceptance\Helper\AbstractModalDialog; + +final class ModalDialog extends AbstractModalDialog +{ + /** + * Selector for a visible modal window + * Adapted for Boostrap 5 + * + * @var string + */ + public static $openedModalSelector = '.modal.show'; + + /** + * Selector for the container in the modal where the buttons are located + * Adapted for Boostrap 5 + * + * @var string + */ + public static $openedModalButtonContainerSelector = '.modal.show .modal-footer'; + + /** + * @var AcceptanceTester + */ + protected $tester; + + /** + * Inject our core AcceptanceTester actor into ModalDialog + */ + public function __construct(AcceptanceTester $I) + { + $this->tester = $I; + } + + /** + * Perform a click on a link or a button, given by a locator. + * + * @param string $buttonLinkLocator the button title + * @see \Codeception\Module\WebDriver::click() + */ + public function clickButtonInDialog(string $buttonLinkLocator): void + { + $I = $this->tester; + $this->canSeeDialog(); + $I->click($buttonLinkLocator, self::$openedModalButtonContainerSelector); + $I->waitForElementNotVisible(self::$openedModalSelector); + } + + /** + * Check if modal dialog is visible in top frame + */ + public function canSeeDialog(): void + { + $I = $this->tester; + $I->switchToIFrame(); + $I->waitForElement(self::$openedModalSelector); + // I will wait two seconds to prevent failing tests + $I->wait(2); + } +} diff --git a/Tests/Acceptance/Support/_generated/AcceptanceTesterActions.php b/Tests/Acceptance/Support/_generated/AcceptanceTesterActions.php index 8db170867..fbd8e90f9 100644 --- a/Tests/Acceptance/Support/_generated/AcceptanceTesterActions.php +++ b/Tests/Acceptance/Support/_generated/AcceptanceTesterActions.php @@ -1,9 +1,9 @@ -getScenario()->runStep(new \Codeception\Step\Action('debugWebDriverLogs', func_get_args())); + public function debugWebDriverLogs(?\Codeception\TestInterface $test = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('debugWebDriverLogs', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Test won't be stopped on fail. Error won't be logged * Print out latest Selenium Logs in debug mode - * - * @param \Codeception\TestInterface $test * @see \Codeception\Module\WebDriver::debugWebDriverLogs() */ - public function tryToDebugWebDriverLogs(?\Codeception\TestInterface $test = NULL) { + public function tryToDebugWebDriverLogs(?\Codeception\TestInterface $test = NULL): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('debugWebDriverLogs', func_get_args())); - } + } /** * [!] Method is generated. * @@ -60,23 +56,19 @@ public function retryDebugWebDriverLogs(?\Codeception\TestInterface $test = NULL * * ``` php * amOnSubdomain('user'); * $I->amOnPage('/'); - * // moves to http://user.mysite.com/ - * ?> + * // moves to https://user.mysite.com/ * ``` * - * @param $subdomain - * - * @return mixed * @see \Codeception\Module\WebDriver::amOnSubdomain() */ - public function amOnSubdomain($subdomain) { - return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args())); + public function amOnSubdomain(string $subdomain): void { + $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args())); } @@ -93,12 +85,10 @@ public function amOnSubdomain($subdomain) { * $I->makeScreenshot(); * // saved to: tests/_output/debug/2017-05-26_14-24-11_4b3403665fea6.png * ``` - * - * @param $name * @see \Codeception\Module\WebDriver::makeScreenshot() */ - public function makeScreenshot($name = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('makeScreenshot', func_get_args())); + public function makeScreenshot(?string $name = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('makeScreenshot', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -114,13 +104,11 @@ public function makeScreenshot($name = NULL) { * $I->makeScreenshot(); * // saved to: tests/_output/debug/2017-05-26_14-24-11_4b3403665fea6.png * ``` - * - * @param $name * @see \Codeception\Module\WebDriver::makeScreenshot() */ - public function tryToMakeScreenshot($name = NULL) { + public function tryToMakeScreenshot(?string $name = NULL): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('makeScreenshot', func_get_args())); - } + } /** * [!] Method is generated. * @@ -130,7 +118,7 @@ public function tryToMakeScreenshot($name = NULL) { * * @see \Codeception\Module\WebDriver::makeScreenshot() */ - public function retryMakeScreenshot($name = NULL) { + public function retryMakeScreenshot(?string $name = NULL) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('makeScreenshot', func_get_args(), $retryNum, $retryInterval)); @@ -151,11 +139,11 @@ public function retryMakeScreenshot($name = NULL) { * // saved to: tests/_output/debug/2017-05-26_14-24-11_4b3403665fea6.png * ``` * - * @param $name + * @param WebDriverBy|array $selector * @see \Codeception\Module\WebDriver::makeElementScreenshot() */ - public function makeElementScreenshot($selector, $name = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('makeElementScreenshot', func_get_args())); + public function makeElementScreenshot($selector, ?string $name = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('makeElementScreenshot', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -172,12 +160,12 @@ public function makeElementScreenshot($selector, $name = NULL) { * // saved to: tests/_output/debug/2017-05-26_14-24-11_4b3403665fea6.png * ``` * - * @param $name + * @param WebDriverBy|array $selector * @see \Codeception\Module\WebDriver::makeElementScreenshot() */ - public function tryToMakeElementScreenshot($selector, $name = NULL) { + public function tryToMakeElementScreenshot($selector, ?string $name = NULL): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('makeElementScreenshot', func_get_args())); - } + } /** * [!] Method is generated. * @@ -187,7 +175,7 @@ public function tryToMakeElementScreenshot($selector, $name = NULL) { * * @see \Codeception\Module\WebDriver::makeElementScreenshot() */ - public function retryMakeElementScreenshot($selector, $name = NULL) { + public function retryMakeElementScreenshot($selector, ?string $name = NULL) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('makeElementScreenshot', func_get_args(), $retryNum, $retryInterval)); @@ -206,12 +194,10 @@ public function retryMakeElementScreenshot($selector, $name = NULL) { * $I->makeHtmlSnapshot(); * // saved to: tests/_output/debug/2017-05-26_14-24-11_4b3403665fea6.html * ``` - * - * @param null $name * @see \Codeception\Module\WebDriver::makeHtmlSnapshot() */ - public function makeHtmlSnapshot($name = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('makeHtmlSnapshot', func_get_args())); + public function makeHtmlSnapshot(?string $name = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('makeHtmlSnapshot', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -226,13 +212,11 @@ public function makeHtmlSnapshot($name = NULL) { * $I->makeHtmlSnapshot(); * // saved to: tests/_output/debug/2017-05-26_14-24-11_4b3403665fea6.html * ``` - * - * @param null $name * @see \Codeception\Module\WebDriver::makeHtmlSnapshot() */ - public function tryToMakeHtmlSnapshot($name = NULL) { + public function tryToMakeHtmlSnapshot(?string $name = NULL): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('makeHtmlSnapshot', func_get_args())); - } + } /** * [!] Method is generated. * @@ -242,7 +226,7 @@ public function tryToMakeHtmlSnapshot($name = NULL) { * * @see \Codeception\Module\WebDriver::makeHtmlSnapshot() */ - public function retryMakeHtmlSnapshot($name = NULL) { + public function retryMakeHtmlSnapshot(?string $name = NULL) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('makeHtmlSnapshot', func_get_args(), $retryNum, $retryInterval)); @@ -259,13 +243,10 @@ public function retryMakeHtmlSnapshot($name = NULL) { * $I->resizeWindow(800, 600); * * ``` - * - * @param int $width - * @param int $height * @see \Codeception\Module\WebDriver::resizeWindow() */ - public function resizeWindow($width, $height) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('resizeWindow', func_get_args())); + public function resizeWindow(int $width, int $height): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('resizeWindow', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -278,14 +259,11 @@ public function resizeWindow($width, $height) { * $I->resizeWindow(800, 600); * * ``` - * - * @param int $width - * @param int $height * @see \Codeception\Module\WebDriver::resizeWindow() */ - public function tryToResizeWindow($width, $height) { + public function tryToResizeWindow(int $width, int $height): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('resizeWindow', func_get_args())); - } + } /** * [!] Method is generated. * @@ -295,7 +273,7 @@ public function tryToResizeWindow($width, $height) { * * @see \Codeception\Module\WebDriver::resizeWindow() */ - public function retryResizeWindow($width, $height) { + public function retryResizeWindow(int $width, int $height) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('resizeWindow', func_get_args(), $retryNum, $retryInterval)); @@ -308,19 +286,16 @@ public function retryResizeWindow($width, $height) { * 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 + * ```php * seeCookie('PHPSESSID'); - * ?> * ``` * - * @param $cookie - * @param array $params - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::seeCookie() */ - public function seeCookie($cookie, array $params = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); + public function seeCookie($cookie, array $params = [], bool $showDebug = true): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -329,19 +304,16 @@ public function seeCookie($cookie, array $params = []) { * 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 + * ```php * seeCookie('PHPSESSID'); - * ?> * ``` * - * @param $cookie - * @param array $params - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::seeCookie() */ - public function canSeeCookie($cookie, array $params = []) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); + public function canSeeCookie($cookie, array $params = [], bool $showDebug = true): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -350,20 +322,17 @@ public function canSeeCookie($cookie, array $params = []) { * 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 + * ```php * seeCookie('PHPSESSID'); - * ?> * ``` * - * @param $cookie - * @param array $params - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::seeCookie() */ - public function tryToSeeCookie($cookie, array $params = []) { + public function tryToSeeCookie($cookie, array $params = [], bool $showDebug = true): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeCookie', func_get_args())); - } + } /** * [!] Method is generated. * @@ -373,7 +342,7 @@ public function tryToSeeCookie($cookie, array $params = []) { * * @see \Codeception\Module\WebDriver::seeCookie() */ - public function retrySeeCookie($cookie, array $params = []) { + public function retrySeeCookie($cookie, array $params = [], bool $showDebug = true) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('seeCookie', func_get_args(), $retryNum, $retryInterval)); @@ -386,14 +355,11 @@ public function retrySeeCookie($cookie, array $params = []) { * 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 + * @return mixed|void * @see \Codeception\Module\WebDriver::dontSeeCookie() */ - public function dontSeeCookie($cookie, array $params = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCookie', func_get_args())); + public function dontSeeCookie($cookie, array $params = [], bool $showDebug = true): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCookie', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -402,14 +368,11 @@ public function dontSeeCookie($cookie, array $params = []) { * 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 + * @return mixed|void * @see \Codeception\Module\WebDriver::dontSeeCookie() */ - public function cantSeeCookie($cookie, array $params = []) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); + public function cantSeeCookie($cookie, array $params = [], bool $showDebug = true): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -418,15 +381,12 @@ public function cantSeeCookie($cookie, array $params = []) { * 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 + * @return mixed|void * @see \Codeception\Module\WebDriver::dontSeeCookie() */ - public function tryToDontSeeCookie($cookie, array $params = []) { + public function tryToDontSeeCookie($cookie, array $params = [], bool $showDebug = true): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeCookie', func_get_args())); - } + } /** * [!] Method is generated. * @@ -436,7 +396,7 @@ public function tryToDontSeeCookie($cookie, array $params = []) { * * @see \Codeception\Module\WebDriver::dontSeeCookie() */ - public function retryDontSeeCookie($cookie, array $params = []) { + public function retryDontSeeCookie($cookie, array $params = [], bool $showDebug = true) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('dontSeeCookie', func_get_args(), $retryNum, $retryInterval)); @@ -449,21 +409,16 @@ public function retryDontSeeCookie($cookie, array $params = []) { * 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 + * ```php * setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); - * ?> * ``` * - * @param $name - * @param $val - * @param array $params - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::setCookie() */ - public function setCookie($cookie, $value, array $params = [], $showDebug = true) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); + public function setCookie($name, $value, array $params = [], $showDebug = true): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -472,22 +427,17 @@ public function setCookie($cookie, $value, array $params = [], $showDebug = true * 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 + * ```php * setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); - * ?> * ``` * - * @param $name - * @param $val - * @param array $params - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::setCookie() */ - public function tryToSetCookie($cookie, $value, array $params = [], $showDebug = true) { + public function tryToSetCookie($name, $value, array $params = [], $showDebug = true): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('setCookie', func_get_args())); - } + } /** * [!] Method is generated. * @@ -497,7 +447,7 @@ public function tryToSetCookie($cookie, $value, array $params = [], $showDebug = * * @see \Codeception\Module\WebDriver::setCookie() */ - public function retrySetCookie($cookie, $value, array $params = [], $showDebug = true) { + public function retrySetCookie($name, $value, array $params = [], $showDebug = true) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('setCookie', func_get_args(), $retryNum, $retryInterval)); @@ -510,14 +460,11 @@ public function retrySetCookie($cookie, $value, array $params = [], $showDebug = * 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 + * @return mixed|void * @see \Codeception\Module\WebDriver::resetCookie() */ - public function resetCookie($cookie, array $params = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args())); + public function resetCookie($cookie, array $params = [], bool $showDebug = true): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -526,15 +473,12 @@ public function resetCookie($cookie, array $params = []) { * 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 + * @return mixed|void * @see \Codeception\Module\WebDriver::resetCookie() */ - public function tryToResetCookie($cookie, array $params = []) { + public function tryToResetCookie($cookie, array $params = [], bool $showDebug = true): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('resetCookie', func_get_args())); - } + } /** * [!] Method is generated. * @@ -544,7 +488,7 @@ public function tryToResetCookie($cookie, array $params = []) { * * @see \Codeception\Module\WebDriver::resetCookie() */ - public function retryResetCookie($cookie, array $params = []) { + public function retryResetCookie($cookie, array $params = [], bool $showDebug = true) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('resetCookie', func_get_args(), $retryNum, $retryInterval)); @@ -557,16 +501,11 @@ public function retryResetCookie($cookie, array $params = []) { * Grabs a cookie value. * You can set additional cookie params like `domain`, `path` in array passed as last argument. * If the cookie is set by an ajax request (XMLHttpRequest), there might be some delay caused by the browser, so try `$I->wait(0.1)`. - * - * @param $cookie - * - * @param array $params - * @return mixed * @see \Codeception\Module\WebDriver::grabCookie() */ - public function grabCookie($cookie, array $params = []) { + public function grabCookie($cookie, array $params = []): mixed { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args())); - } + } /** * [!] Method is generated. * @@ -589,13 +528,12 @@ public function retryGrabCookie($cookie, array $params = []) { * Grabs current page source code. * * @throws ModuleException if no page was opened. - * * @return string Current page source code. * @see \Codeception\Module\WebDriver::grabPageSource() */ - public function grabPageSource() { + public function grabPageSource(): string { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabPageSource', func_get_args())); - } + } /** * [!] Method is generated. * @@ -621,12 +559,11 @@ public function retryGrabPageSource() { * amOnUrl('https://codeception.com'); * $I->amOnPage('/quickstart'); // moves to https://codeception.com/quickstart - * ?> * ``` * @see \Codeception\Module\WebDriver::amOnUrl() */ - public function amOnUrl($url) { - return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnUrl', func_get_args())); + public function amOnUrl($url): void { + $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnUrl', func_get_args())); } @@ -635,19 +572,17 @@ public function amOnUrl($url) { * * Opens the page for the given relative URI. * - * ``` php + * ```php * amOnPage('/'); * // opens /register page * $I->amOnPage('/register'); * ``` - * - * @param string $page * @see \Codeception\Module\WebDriver::amOnPage() */ - public function amOnPage($page) { - return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); + public function amOnPage($page): void { + $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); } @@ -659,7 +594,7 @@ public function amOnPage($page) { * You can specify a specific HTML element (via CSS or XPath) as the second * parameter to only search within that element. * - * ``` php + * ```php * see('Logout'); // I can suppose user is logged in * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page @@ -681,12 +616,11 @@ public function amOnPage($page) { * * For checking the raw source code, use `seeInSource()`. * - * @param string $text * @param array|string $selector optional * @see \Codeception\Module\WebDriver::see() */ - public function see($text, $selector = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args())); + public function see($text, $selector = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -697,7 +631,7 @@ public function see($text, $selector = NULL) { * You can specify a specific HTML element (via CSS or XPath) as the second * parameter to only search within that element. * - * ``` php + * ```php * see('Logout'); // I can suppose user is logged in * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page @@ -719,12 +653,11 @@ public function see($text, $selector = NULL) { * * For checking the raw source code, use `seeInSource()`. * - * @param string $text * @param array|string $selector optional * @see \Codeception\Module\WebDriver::see() */ - public function canSee($text, $selector = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args())); + public function canSee($text, $selector = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -735,7 +668,7 @@ public function canSee($text, $selector = NULL) { * You can specify a specific HTML element (via CSS or XPath) as the second * parameter to only search within that element. * - * ``` php + * ```php * see('Logout'); // I can suppose user is logged in * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page @@ -757,13 +690,12 @@ public function canSee($text, $selector = NULL) { * * For checking the raw source code, use `seeInSource()`. * - * @param string $text * @param array|string $selector optional * @see \Codeception\Module\WebDriver::see() */ - public function tryToSee($text, $selector = NULL) { + public function tryToSee($text, $selector = NULL): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('see', func_get_args())); - } + } /** * [!] Method is generated. * @@ -808,12 +740,11 @@ public function retrySee($text, $selector = NULL) { * * For checking the raw source code, use `seeInSource()`. * - * @param string $text * @param array|string $selector optional * @see \Codeception\Module\WebDriver::dontSee() */ - public function dontSee($text, $selector = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSee', func_get_args())); + public function dontSee($text, $selector = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSee', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -844,12 +775,11 @@ public function dontSee($text, $selector = NULL) { * * For checking the raw source code, use `seeInSource()`. * - * @param string $text * @param array|string $selector optional * @see \Codeception\Module\WebDriver::dontSee() */ - public function cantSee($text, $selector = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args())); + public function cantSee($text, $selector = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -880,13 +810,12 @@ public function cantSee($text, $selector = NULL) { * * For checking the raw source code, use `seeInSource()`. * - * @param string $text * @param array|string $selector optional * @see \Codeception\Module\WebDriver::dontSee() */ - public function tryToDontSee($text, $selector = NULL) { + public function tryToDontSee($text, $selector = NULL): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSee', func_get_args())); - } + } /** * [!] Method is generated. * @@ -909,16 +838,14 @@ public function retryDontSee($text, $selector = NULL) { * Checks that the current page contains the given string in its * raw source code. * - * ``` php + * ```php * seeInSource('

Green eggs & ham

'); * ``` - * - * @param $raw * @see \Codeception\Module\WebDriver::seeInSource() */ - public function seeInSource($raw) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args())); + public function seeInSource($raw): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -927,16 +854,14 @@ public function seeInSource($raw) { * Checks that the current page contains the given string in its * raw source code. * - * ``` php + * ```php * seeInSource('

Green eggs & ham

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

Green eggs & ham

'); * ``` - * - * @param $raw * @see \Codeception\Module\WebDriver::seeInSource() */ - public function tryToSeeInSource($raw) { + public function tryToSeeInSource($raw): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeInSource', func_get_args())); - } + } /** * [!] Method is generated. * @@ -982,12 +905,10 @@ public function retrySeeInSource($raw) { * dontSeeInSource('

Green eggs & ham

'); * ``` - * - * @param $raw * @see \Codeception\Module\WebDriver::dontSeeInSource() */ - public function dontSeeInSource($raw) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInSource', func_get_args())); + public function dontSeeInSource($raw): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInSource', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1000,12 +921,10 @@ public function dontSeeInSource($raw) { * dontSeeInSource('

Green eggs & ham

'); * ``` - * - * @param $raw * @see \Codeception\Module\WebDriver::dontSeeInSource() */ - public function cantSeeInSource($raw) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args())); + public function cantSeeInSource($raw): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1018,13 +937,11 @@ public function cantSeeInSource($raw) { * dontSeeInSource('

Green eggs & ham

'); * ``` - * - * @param $raw * @see \Codeception\Module\WebDriver::dontSeeInSource() */ - public function tryToDontSeeInSource($raw) { + public function tryToDontSeeInSource($raw): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeInSource', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1050,12 +967,10 @@ public function retryDontSeeInSource($raw) { * seeInPageSource('getScenario()->runStep(new \Codeception\Step\Assertion('seeInPageSource', func_get_args())); + public function seeInPageSource(string $text): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInPageSource', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1067,12 +982,10 @@ public function seeInPageSource($text) { * seeInPageSource('getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPageSource', func_get_args())); + public function canSeeInPageSource(string $text): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPageSource', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1084,13 +997,11 @@ public function canSeeInPageSource($text) { * seeInPageSource('getScenario()->runStep(new \Codeception\Step\TryTo('seeInPageSource', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1100,7 +1011,7 @@ public function tryToSeeInPageSource($text) { * * @see \Codeception\Module\WebDriver::seeInPageSource() */ - public function retrySeeInPageSource($text) { + public function retrySeeInPageSource(string $text) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('seeInPageSource', func_get_args(), $retryNum, $retryInterval)); @@ -1111,37 +1022,31 @@ public function retrySeeInPageSource($text) { * [!] Method is generated. Documentation taken from corresponding module. * * Checks that the page source doesn't contain the given string. - * - * @param $text * @see \Codeception\Module\WebDriver::dontSeeInPageSource() */ - public function dontSeeInPageSource($text) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInPageSource', func_get_args())); + public function dontSeeInPageSource(string $text): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInPageSource', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the page source doesn't contain the given string. - * - * @param $text * @see \Codeception\Module\WebDriver::dontSeeInPageSource() */ - public function cantSeeInPageSource($text) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPageSource', func_get_args())); + public function cantSeeInPageSource(string $text): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPageSource', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Test won't be stopped on fail. Error won't be logged * Checks that the page source doesn't contain the given string. - * - * @param $text * @see \Codeception\Module\WebDriver::dontSeeInPageSource() */ - public function tryToDontSeeInPageSource($text) { + public function tryToDontSeeInPageSource(string $text): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeInPageSource', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1151,7 +1056,7 @@ public function tryToDontSeeInPageSource($text) { * * @see \Codeception\Module\WebDriver::dontSeeInPageSource() */ - public function retryDontSeeInPageSource($text) { + public function retryDontSeeInPageSource(string $text) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('dontSeeInPageSource', func_get_args(), $retryNum, $retryInterval)); @@ -1171,7 +1076,7 @@ public function retryDontSeeInPageSource($text) { * * Note that if the locator matches a button of type `submit`, the form will be submitted. * - * ``` php + * ```php * click('Logout'); @@ -1185,15 +1090,12 @@ public function retryDontSeeInPageSource($text) { * $I->click('Logout', '#nav'); * // using strict locator * $I->click(['link' => 'Login']); - * ?> * ``` - * - * @param $link - * @param $context + * @param string|array $link * @see \Codeception\Module\WebDriver::click() */ - public function click($link, $context = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args())); + public function click($link, $context = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1209,7 +1111,7 @@ public function click($link, $context = NULL) { * * Note that if the locator matches a button of type `submit`, the form will be submitted. * - * ``` php + * ```php * click('Logout'); @@ -1223,16 +1125,13 @@ public function click($link, $context = NULL) { * $I->click('Logout', '#nav'); * // using strict locator * $I->click(['link' => 'Login']); - * ?> * ``` - * - * @param $link - * @param $context + * @param string|array $link * @see \Codeception\Module\WebDriver::click() */ - public function tryToClick($link, $context = NULL) { + public function tryToClick($link, $context = NULL): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('click', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1255,19 +1154,15 @@ public function retryClick($link, $context = NULL) { * 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 + * ```php * seeLink('Logout'); // matches Logout * $I->seeLink('Logout','/logout'); // matches Logout - * ?> * ``` - * - * @param string $text - * @param string $url optional * @see \Codeception\Module\WebDriver::seeLink() */ - public function seeLink($text, $url = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args())); + public function seeLink(string $text, ?string $url = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1276,19 +1171,15 @@ public function seeLink($text, $url = NULL) { * 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 + * ```php * seeLink('Logout'); // matches Logout * $I->seeLink('Logout','/logout'); // matches Logout - * ?> * ``` - * - * @param string $text - * @param string $url optional * @see \Codeception\Module\WebDriver::seeLink() */ - public function canSeeLink($text, $url = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args())); + public function canSeeLink(string $text, ?string $url = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1297,20 +1188,16 @@ public function canSeeLink($text, $url = NULL) { * 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 + * ```php * seeLink('Logout'); // matches Logout * $I->seeLink('Logout','/logout'); // matches Logout - * ?> * ``` - * - * @param string $text - * @param string $url optional * @see \Codeception\Module\WebDriver::seeLink() */ - public function tryToSeeLink($text, $url = NULL) { + public function tryToSeeLink(string $text, ?string $url = NULL): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeLink', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1320,7 +1207,7 @@ public function tryToSeeLink($text, $url = NULL) { * * @see \Codeception\Module\WebDriver::seeLink() */ - public function retrySeeLink($text, $url = NULL) { + public function retrySeeLink(string $text, ?string $url = NULL) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('seeLink', func_get_args(), $retryNum, $retryInterval)); @@ -1333,19 +1220,15 @@ public function retrySeeLink($text, $url = NULL) { * 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 + * ```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\Module\WebDriver::dontSeeLink() */ - public function dontSeeLink($text, $url = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeLink', func_get_args())); + public function dontSeeLink(string $text, string $url = ""): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeLink', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1354,19 +1237,15 @@ public function dontSeeLink($text, $url = NULL) { * 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 + * ```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\Module\WebDriver::dontSeeLink() */ - public function cantSeeLink($text, $url = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args())); + public function cantSeeLink(string $text, string $url = ""): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1375,20 +1254,16 @@ public function cantSeeLink($text, $url = NULL) { * 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 + * ```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\Module\WebDriver::dontSeeLink() */ - public function tryToDontSeeLink($text, $url = NULL) { + public function tryToDontSeeLink(string $text, string $url = ""): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeLink', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1398,7 +1273,7 @@ public function tryToDontSeeLink($text, $url = NULL) { * * @see \Codeception\Module\WebDriver::dontSeeLink() */ - public function retryDontSeeLink($text, $url = NULL) { + public function retryDontSeeLink(string $text, string $url = "") { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('dontSeeLink', func_get_args(), $retryNum, $retryInterval)); @@ -1410,20 +1285,17 @@ public function retryDontSeeLink($text, $url = NULL) { * * Checks that current URI contains the given string. * - * ``` php + * ```php * seeInCurrentUrl('home'); * // to match: /users/1 * $I->seeInCurrentUrl('/users/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::seeInCurrentUrl() */ - public function seeInCurrentUrl($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args())); + public function seeInCurrentUrl(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1431,20 +1303,17 @@ public function seeInCurrentUrl($uri) { * [!] Conditional Assertion: Test won't be stopped on fail * Checks that current URI contains the given string. * - * ``` php + * ```php * seeInCurrentUrl('home'); * // to match: /users/1 * $I->seeInCurrentUrl('/users/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::seeInCurrentUrl() */ - public function canSeeInCurrentUrl($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); + public function canSeeInCurrentUrl(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1452,21 +1321,18 @@ public function canSeeInCurrentUrl($uri) { * [!] Test won't be stopped on fail. Error won't be logged * Checks that current URI contains the given string. * - * ``` php + * ```php * seeInCurrentUrl('home'); * // to match: /users/1 * $I->seeInCurrentUrl('/users/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::seeInCurrentUrl() */ - public function tryToSeeInCurrentUrl($uri) { + public function tryToSeeInCurrentUrl(string $uri): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeInCurrentUrl', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1476,7 +1342,7 @@ public function tryToSeeInCurrentUrl($uri) { * * @see \Codeception\Module\WebDriver::seeInCurrentUrl() */ - public function retrySeeInCurrentUrl($uri) { + public function retrySeeInCurrentUrl(string $uri) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('seeInCurrentUrl', func_get_args(), $retryNum, $retryInterval)); @@ -1489,18 +1355,15 @@ public function retrySeeInCurrentUrl($uri) { * Checks that the current URL is equal to the given string. * Unlike `seeInCurrentUrl`, this only matches the full URL. * - * ``` php + * ```php * seeCurrentUrlEquals('/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::seeCurrentUrlEquals() */ - public function seeCurrentUrlEquals($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args())); + public function seeCurrentUrlEquals(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1509,18 +1372,15 @@ public function seeCurrentUrlEquals($uri) { * Checks that the current URL is equal to the given string. * Unlike `seeInCurrentUrl`, this only matches the full URL. * - * ``` php + * ```php * seeCurrentUrlEquals('/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::seeCurrentUrlEquals() */ - public function canSeeCurrentUrlEquals($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); + public function canSeeCurrentUrlEquals(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1529,19 +1389,16 @@ public function canSeeCurrentUrlEquals($uri) { * Checks that the current URL is equal to the given string. * Unlike `seeInCurrentUrl`, this only matches the full URL. * - * ``` php + * ```php * seeCurrentUrlEquals('/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::seeCurrentUrlEquals() */ - public function tryToSeeCurrentUrlEquals($uri) { + public function tryToSeeCurrentUrlEquals(string $uri): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeCurrentUrlEquals', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1551,7 +1408,7 @@ public function tryToSeeCurrentUrlEquals($uri) { * * @see \Codeception\Module\WebDriver::seeCurrentUrlEquals() */ - public function retrySeeCurrentUrlEquals($uri) { + public function retrySeeCurrentUrlEquals(string $uri) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('seeCurrentUrlEquals', func_get_args(), $retryNum, $retryInterval)); @@ -1563,18 +1420,15 @@ public function retrySeeCurrentUrlEquals($uri) { * * Checks that the current URL matches the given regular expression. * - * ``` php + * ```php * seeCurrentUrlMatches('~^/users/(\d+)~'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::seeCurrentUrlMatches() */ - public function seeCurrentUrlMatches($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args())); + public function seeCurrentUrlMatches(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1582,18 +1436,15 @@ public function seeCurrentUrlMatches($uri) { * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the current URL matches the given regular expression. * - * ``` php + * ```php * seeCurrentUrlMatches('~^/users/(\d+)~'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::seeCurrentUrlMatches() */ - public function canSeeCurrentUrlMatches($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); + public function canSeeCurrentUrlMatches(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1601,19 +1452,16 @@ public function canSeeCurrentUrlMatches($uri) { * [!] Test won't be stopped on fail. Error won't be logged * Checks that the current URL matches the given regular expression. * - * ``` php + * ```php * seeCurrentUrlMatches('~^/users/(\d+)~'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::seeCurrentUrlMatches() */ - public function tryToSeeCurrentUrlMatches($uri) { + public function tryToSeeCurrentUrlMatches(string $uri): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeCurrentUrlMatches', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1623,7 +1471,7 @@ public function tryToSeeCurrentUrlMatches($uri) { * * @see \Codeception\Module\WebDriver::seeCurrentUrlMatches() */ - public function retrySeeCurrentUrlMatches($uri) { + public function retrySeeCurrentUrlMatches(string $uri) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('seeCurrentUrlMatches', func_get_args(), $retryNum, $retryInterval)); @@ -1635,17 +1483,14 @@ public function retrySeeCurrentUrlMatches($uri) { * * Checks that the current URI doesn't contain the given string. * - * ``` php + * ```php * dontSeeInCurrentUrl('/users/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl() */ - public function dontSeeInCurrentUrl($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInCurrentUrl', func_get_args())); + public function dontSeeInCurrentUrl(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInCurrentUrl', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1653,17 +1498,14 @@ public function dontSeeInCurrentUrl($uri) { * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the current URI doesn't contain the given string. * - * ``` php + * ```php * dontSeeInCurrentUrl('/users/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl() */ - public function cantSeeInCurrentUrl($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); + public function cantSeeInCurrentUrl(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1671,18 +1513,15 @@ public function cantSeeInCurrentUrl($uri) { * [!] Test won't be stopped on fail. Error won't be logged * Checks that the current URI doesn't contain the given string. * - * ``` php + * ```php * dontSeeInCurrentUrl('/users/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl() */ - public function tryToDontSeeInCurrentUrl($uri) { + public function tryToDontSeeInCurrentUrl(string $uri): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeInCurrentUrl', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1692,7 +1531,7 @@ public function tryToDontSeeInCurrentUrl($uri) { * * @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl() */ - public function retryDontSeeInCurrentUrl($uri) { + public function retryDontSeeInCurrentUrl(string $uri) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('dontSeeInCurrentUrl', func_get_args(), $retryNum, $retryInterval)); @@ -1705,18 +1544,15 @@ public function retryDontSeeInCurrentUrl($uri) { * Checks that the current URL doesn't equal the given string. * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. * - * ``` php + * ```php * dontSeeCurrentUrlEquals('/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals() */ - public function dontSeeCurrentUrlEquals($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCurrentUrlEquals', func_get_args())); + public function dontSeeCurrentUrlEquals(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCurrentUrlEquals', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1725,18 +1561,15 @@ public function dontSeeCurrentUrlEquals($uri) { * Checks that the current URL doesn't equal the given string. * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. * - * ``` php + * ```php * dontSeeCurrentUrlEquals('/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals() */ - public function cantSeeCurrentUrlEquals($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); + public function cantSeeCurrentUrlEquals(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1745,19 +1578,16 @@ public function cantSeeCurrentUrlEquals($uri) { * Checks that the current URL doesn't equal the given string. * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. * - * ``` php + * ```php * dontSeeCurrentUrlEquals('/'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals() */ - public function tryToDontSeeCurrentUrlEquals($uri) { + public function tryToDontSeeCurrentUrlEquals(string $uri): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeCurrentUrlEquals', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1767,7 +1597,7 @@ public function tryToDontSeeCurrentUrlEquals($uri) { * * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals() */ - public function retryDontSeeCurrentUrlEquals($uri) { + public function retryDontSeeCurrentUrlEquals(string $uri) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('dontSeeCurrentUrlEquals', func_get_args(), $retryNum, $retryInterval)); @@ -1779,18 +1609,15 @@ public function retryDontSeeCurrentUrlEquals($uri) { * * Checks that current url doesn't match the given regular expression. * - * ``` php + * ```php * dontSeeCurrentUrlMatches('~^/users/(\d+)~'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches() */ - public function dontSeeCurrentUrlMatches($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCurrentUrlMatches', func_get_args())); + public function dontSeeCurrentUrlMatches(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCurrentUrlMatches', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1798,18 +1625,15 @@ public function dontSeeCurrentUrlMatches($uri) { * [!] Conditional Assertion: Test won't be stopped on fail * Checks that current url doesn't match the given regular expression. * - * ``` php + * ```php * dontSeeCurrentUrlMatches('~^/users/(\d+)~'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches() */ - public function cantSeeCurrentUrlMatches($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); + public function cantSeeCurrentUrlMatches(string $uri): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1817,19 +1641,16 @@ public function cantSeeCurrentUrlMatches($uri) { * [!] Test won't be stopped on fail. Error won't be logged * Checks that current url doesn't match the given regular expression. * - * ``` php + * ```php * dontSeeCurrentUrlMatches('~^/users/(\d+)~'); - * ?> * ``` - * - * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches() */ - public function tryToDontSeeCurrentUrlMatches($uri) { + public function tryToDontSeeCurrentUrlMatches(string $uri): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeCurrentUrlMatches', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1839,7 +1660,7 @@ public function tryToDontSeeCurrentUrlMatches($uri) { * * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches() */ - public function retryDontSeeCurrentUrlMatches($uri) { + public function retryDontSeeCurrentUrlMatches(string $uri) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('dontSeeCurrentUrlMatches', func_get_args(), $retryNum, $retryInterval)); @@ -1852,21 +1673,16 @@ public function retryDontSeeCurrentUrlMatches($uri) { * 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 + * ```php * grabFromCurrentUrl('~^/user/(\d+)/~'); * $uri = $I->grabFromCurrentUrl(); - * ?> * ``` - * - * @param string $uri optional - * - * @return mixed * @see \Codeception\Module\WebDriver::grabFromCurrentUrl() */ - public function grabFromCurrentUrl($uri = NULL) { + public function grabFromCurrentUrl($uri = NULL): mixed { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1888,19 +1704,16 @@ public function retryGrabFromCurrentUrl($uri = NULL) { * * Checks that the specified checkbox is checked. * - * ``` php + * ```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\Module\WebDriver::seeCheckboxIsChecked() */ - public function seeCheckboxIsChecked($checkbox) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args())); + public function seeCheckboxIsChecked($checkbox): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1908,19 +1721,16 @@ public function seeCheckboxIsChecked($checkbox) { * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the specified checkbox is checked. * - * ``` php + * ```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\Module\WebDriver::seeCheckboxIsChecked() */ - public function canSeeCheckboxIsChecked($checkbox) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); + public function canSeeCheckboxIsChecked($checkbox): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1928,20 +1738,17 @@ public function canSeeCheckboxIsChecked($checkbox) { * [!] Test won't be stopped on fail. Error won't be logged * Checks that the specified checkbox is checked. * - * ``` php + * ```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\Module\WebDriver::seeCheckboxIsChecked() */ - public function tryToSeeCheckboxIsChecked($checkbox) { + public function tryToSeeCheckboxIsChecked($checkbox): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeCheckboxIsChecked', func_get_args())); - } + } /** * [!] Method is generated. * @@ -1963,18 +1770,15 @@ public function retrySeeCheckboxIsChecked($checkbox) { * * Check that the specified checkbox is unchecked. * - * ``` php + * ```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\Module\WebDriver::dontSeeCheckboxIsChecked() */ - public function dontSeeCheckboxIsChecked($checkbox) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCheckboxIsChecked', func_get_args())); + public function dontSeeCheckboxIsChecked($checkbox): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCheckboxIsChecked', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -1982,18 +1786,15 @@ public function dontSeeCheckboxIsChecked($checkbox) { * [!] Conditional Assertion: Test won't be stopped on fail * Check that the specified checkbox is unchecked. * - * ``` php + * ```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\Module\WebDriver::dontSeeCheckboxIsChecked() */ - public function cantSeeCheckboxIsChecked($checkbox) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); + public function cantSeeCheckboxIsChecked($checkbox): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2001,19 +1802,16 @@ public function cantSeeCheckboxIsChecked($checkbox) { * [!] Test won't be stopped on fail. Error won't be logged * Check that the specified checkbox is unchecked. * - * ``` php + * ```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\Module\WebDriver::dontSeeCheckboxIsChecked() */ - public function tryToDontSeeCheckboxIsChecked($checkbox) { + public function tryToDontSeeCheckboxIsChecked($checkbox): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeCheckboxIsChecked', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2036,7 +1834,7 @@ public function retryDontSeeCheckboxIsChecked($checkbox) { * 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 + * ```php * seeInField('Body','Type your comment here'); * $I->seeInField('form textarea[name=body]','Type your comment here'); @@ -2044,15 +1842,13 @@ public function retryDontSeeCheckboxIsChecked($checkbox) { * $I->seeInField('#searchform input','Search'); * $I->seeInField('//form/*[@name=search]','Search'); * $I->seeInField(['name' => 'search'], 'Search'); - * ?> * ``` * - * @param $field - * @param $value + * @param string|array $field * @see \Codeception\Module\WebDriver::seeInField() */ - public function seeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); + public function seeInField($field, $value): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2061,7 +1857,7 @@ public function seeInField($field, $value) { * 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 + * ```php * seeInField('Body','Type your comment here'); * $I->seeInField('form textarea[name=body]','Type your comment here'); @@ -2069,15 +1865,13 @@ public function seeInField($field, $value) { * $I->seeInField('#searchform input','Search'); * $I->seeInField('//form/*[@name=search]','Search'); * $I->seeInField(['name' => 'search'], 'Search'); - * ?> * ``` * - * @param $field - * @param $value + * @param string|array $field * @see \Codeception\Module\WebDriver::seeInField() */ - public function canSeeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); + public function canSeeInField($field, $value): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2086,7 +1880,7 @@ public function canSeeInField($field, $value) { * 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 + * ```php * seeInField('Body','Type your comment here'); * $I->seeInField('form textarea[name=body]','Type your comment here'); @@ -2094,16 +1888,14 @@ public function canSeeInField($field, $value) { * $I->seeInField('#searchform input','Search'); * $I->seeInField('//form/*[@name=search]','Search'); * $I->seeInField(['name' => 'search'], 'Search'); - * ?> * ``` * - * @param $field - * @param $value + * @param string|array $field * @see \Codeception\Module\WebDriver::seeInField() */ - public function tryToSeeInField($field, $value) { + public function tryToSeeInField($field, $value): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeInField', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2126,7 +1918,7 @@ public function retrySeeInField($field, $value) { * 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 + * ```php * dontSeeInField('Body','Type your comment here'); * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); @@ -2134,15 +1926,12 @@ public function retrySeeInField($field, $value) { * $I->dontSeeInField('#searchform input','Search'); * $I->dontSeeInField('//form/*[@name=search]','Search'); * $I->dontSeeInField(['name' => 'search'], 'Search'); - * ?> * ``` - * - * @param $field - * @param $value + * @param string|array $field * @see \Codeception\Module\WebDriver::dontSeeInField() */ - public function dontSeeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInField', func_get_args())); + public function dontSeeInField($field, $value): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2151,7 +1940,7 @@ public function dontSeeInField($field, $value) { * 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 + * ```php * dontSeeInField('Body','Type your comment here'); * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); @@ -2159,15 +1948,12 @@ public function dontSeeInField($field, $value) { * $I->dontSeeInField('#searchform input','Search'); * $I->dontSeeInField('//form/*[@name=search]','Search'); * $I->dontSeeInField(['name' => 'search'], 'Search'); - * ?> * ``` - * - * @param $field - * @param $value + * @param string|array $field * @see \Codeception\Module\WebDriver::dontSeeInField() */ - public function cantSeeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); + public function cantSeeInField($field, $value): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2176,7 +1962,7 @@ public function cantSeeInField($field, $value) { * 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 + * ```php * dontSeeInField('Body','Type your comment here'); * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); @@ -2184,16 +1970,13 @@ public function cantSeeInField($field, $value) { * $I->dontSeeInField('#searchform input','Search'); * $I->dontSeeInField('//form/*[@name=search]','Search'); * $I->dontSeeInField(['name' => 'search'], 'Search'); - * ?> * ``` - * - * @param $field - * @param $value + * @param string|array $field * @see \Codeception\Module\WebDriver::dontSeeInField() */ - public function tryToDontSeeInField($field, $value) { + public function tryToDontSeeInField($field, $value): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeInField', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2216,19 +1999,18 @@ public function retryDontSeeInField($field, $value) { * Checks if the array of form parameters (name => value) are set on the form matched with the * passed selector. * - * ``` php + * ```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 + * ```php * seeInFormFields('.form-class', [ * 'multiselect' => [ @@ -2240,23 +2022,21 @@ public function retryDontSeeInField($field, $value) { * 'another checked value', * ], * ]); - * ?> * ``` * * Additionally, checkbox values can be checked with a boolean. * - * ``` php + * ```php * seeInFormFields('#form-id', [ * 'checkbox1' => true, // passes if checked * 'checkbox2' => false, // passes if unchecked * ]); - * ?> * ``` * * Pair this with submitForm for quick testing magic. * - * ``` php + * ```php * 'value', @@ -2264,18 +2044,14 @@ public function retryDontSeeInField($field, $value) { * 'checkbox1' => true, * // ... * ]; - * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); + * $I->submitForm('//form[@id=my-form]', string $form, 'submitButton'); * // $I->amOnPage('/path/to/form-page') may be needed - * $I->seeInFormFields('//form[@id=my-form]', $form); - * ?> + * $I->seeInFormFields('//form[@id=my-form]', string $form); * ``` - * - * @param $formSelector - * @param $params * @see \Codeception\Module\WebDriver::seeInFormFields() */ - public function seeInFormFields($formSelector, array $params) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args())); + public function seeInFormFields($formSelector, array $params): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2284,19 +2060,18 @@ public function seeInFormFields($formSelector, array $params) { * Checks if the array of form parameters (name => value) are set on the form matched with the * passed selector. * - * ``` php + * ```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 + * ```php * seeInFormFields('.form-class', [ * 'multiselect' => [ @@ -2308,23 +2083,21 @@ public function seeInFormFields($formSelector, array $params) { * 'another checked value', * ], * ]); - * ?> * ``` * * Additionally, checkbox values can be checked with a boolean. * - * ``` php + * ```php * seeInFormFields('#form-id', [ * 'checkbox1' => true, // passes if checked * 'checkbox2' => false, // passes if unchecked * ]); - * ?> * ``` * * Pair this with submitForm for quick testing magic. * - * ``` php + * ```php * 'value', @@ -2332,18 +2105,14 @@ public function seeInFormFields($formSelector, array $params) { * 'checkbox1' => true, * // ... * ]; - * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); + * $I->submitForm('//form[@id=my-form]', string $form, 'submitButton'); * // $I->amOnPage('/path/to/form-page') may be needed - * $I->seeInFormFields('//form[@id=my-form]', $form); - * ?> + * $I->seeInFormFields('//form[@id=my-form]', string $form); * ``` - * - * @param $formSelector - * @param $params * @see \Codeception\Module\WebDriver::seeInFormFields() */ - public function canSeeInFormFields($formSelector, array $params) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args())); + public function canSeeInFormFields($formSelector, array $params): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2352,19 +2121,18 @@ public function canSeeInFormFields($formSelector, array $params) { * Checks if the array of form parameters (name => value) are set on the form matched with the * passed selector. * - * ``` php + * ```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 + * ```php * seeInFormFields('.form-class', [ * 'multiselect' => [ @@ -2376,23 +2144,21 @@ public function canSeeInFormFields($formSelector, array $params) { * 'another checked value', * ], * ]); - * ?> * ``` * * Additionally, checkbox values can be checked with a boolean. * - * ``` php + * ```php * seeInFormFields('#form-id', [ * 'checkbox1' => true, // passes if checked * 'checkbox2' => false, // passes if unchecked * ]); - * ?> * ``` * * Pair this with submitForm for quick testing magic. * - * ``` php + * ```php * 'value', @@ -2400,19 +2166,15 @@ public function canSeeInFormFields($formSelector, array $params) { * 'checkbox1' => true, * // ... * ]; - * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); + * $I->submitForm('//form[@id=my-form]', string $form, 'submitButton'); * // $I->amOnPage('/path/to/form-page') may be needed - * $I->seeInFormFields('//form[@id=my-form]', $form); - * ?> + * $I->seeInFormFields('//form[@id=my-form]', string $form); * ``` - * - * @param $formSelector - * @param $params * @see \Codeception\Module\WebDriver::seeInFormFields() */ - public function tryToSeeInFormFields($formSelector, array $params) { + public function tryToSeeInFormFields($formSelector, array $params): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeInFormFields', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2435,19 +2197,18 @@ public function retrySeeInFormFields($formSelector, array $params) { * Checks if the array of form parameters (name => value) are not set on the form matched with * the passed selector. * - * ``` php + * ```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 + * ```php * dontSeeInFormFields('.form-class', [ * 'fieldName' => [ @@ -2455,26 +2216,21 @@ public function retrySeeInFormFields($formSelector, array $params) { * 'And this value shouldn\'t be set', * ], * ]); - * ?> * ``` * * Additionally, checkbox values can be checked with a boolean. * - * ``` php + * ```php * dontSeeInFormFields('#form-id', [ * 'checkbox1' => true, // fails if checked * 'checkbox2' => false, // fails if unchecked * ]); - * ?> * ``` - * - * @param $formSelector - * @param $params * @see \Codeception\Module\WebDriver::dontSeeInFormFields() */ - public function dontSeeInFormFields($formSelector, array $params) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInFormFields', func_get_args())); + public function dontSeeInFormFields($formSelector, array $params): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInFormFields', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2483,19 +2239,18 @@ public function dontSeeInFormFields($formSelector, array $params) { * Checks if the array of form parameters (name => value) are not set on the form matched with * the passed selector. * - * ``` php + * ```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 + * ```php * dontSeeInFormFields('.form-class', [ * 'fieldName' => [ @@ -2503,26 +2258,21 @@ public function dontSeeInFormFields($formSelector, array $params) { * 'And this value shouldn\'t be set', * ], * ]); - * ?> * ``` * * Additionally, checkbox values can be checked with a boolean. * - * ``` php + * ```php * dontSeeInFormFields('#form-id', [ * 'checkbox1' => true, // fails if checked * 'checkbox2' => false, // fails if unchecked * ]); - * ?> * ``` - * - * @param $formSelector - * @param $params * @see \Codeception\Module\WebDriver::dontSeeInFormFields() */ - public function cantSeeInFormFields($formSelector, array $params) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args())); + public function cantSeeInFormFields($formSelector, array $params): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2531,19 +2281,18 @@ public function cantSeeInFormFields($formSelector, array $params) { * Checks if the array of form parameters (name => value) are not set on the form matched with * the passed selector. * - * ``` php + * ```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 + * ```php * dontSeeInFormFields('.form-class', [ * 'fieldName' => [ @@ -2551,27 +2300,22 @@ public function cantSeeInFormFields($formSelector, array $params) { * 'And this value shouldn\'t be set', * ], * ]); - * ?> * ``` * * Additionally, checkbox values can be checked with a boolean. * - * ``` php + * ```php * dontSeeInFormFields('#form-id', [ * 'checkbox1' => true, // fails if checked * 'checkbox2' => false, // fails if unchecked * ]); - * ?> * ``` - * - * @param $formSelector - * @param $params * @see \Codeception\Module\WebDriver::dontSeeInFormFields() */ - public function tryToDontSeeInFormFields($formSelector, array $params) { + public function tryToDontSeeInFormFields($formSelector, array $params): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeInFormFields', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2593,37 +2337,31 @@ public function retryDontSeeInFormFields($formSelector, array $params) { * * Selects an option in a select tag or in radio button group. * - * ``` php + * ```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 + * ```php * selectOption('Which OS do you use?', array('Windows','Linux')); - * ?> + * $I->selectOption('Which OS do you use?', ['Windows', 'Linux']); * ``` * * Or provide an associative array for the second argument to specifically define which selection method should be used: * - * ``` php + * ```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' - * ?> + * $I->selectOption('Which OS do you use?', ['text' => 'Windows']); // Only search by text 'Windows' + * $I->selectOption('Which OS do you use?', ['value' => 'windows']); // Only search by value 'windows' * ``` - * - * @param $select - * @param $option * @see \Codeception\Module\WebDriver::selectOption() */ - public function selectOption($select, $option) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('selectOption', func_get_args())); + public function selectOption($select, $option): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('selectOption', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2631,38 +2369,32 @@ public function selectOption($select, $option) { * [!] Test won't be stopped on fail. Error won't be logged * Selects an option in a select tag or in radio button group. * - * ``` php + * ```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 + * ```php * selectOption('Which OS do you use?', array('Windows','Linux')); - * ?> + * $I->selectOption('Which OS do you use?', ['Windows', 'Linux']); * ``` * * Or provide an associative array for the second argument to specifically define which selection method should be used: * - * ``` php + * ```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' - * ?> + * $I->selectOption('Which OS do you use?', ['text' => 'Windows']); // Only search by text 'Windows' + * $I->selectOption('Which OS do you use?', ['value' => 'windows']); // Only search by value 'windows' * ``` - * - * @param $select - * @param $option * @see \Codeception\Module\WebDriver::selectOption() */ - public function tryToSelectOption($select, $option) { + public function tryToSelectOption($select, $option): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('selectOption', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2684,12 +2416,12 @@ public function retrySelectOption($select, $option) { * * Unselect an option in the given select box. * - * @param $select - * @param $option + * @param string|array|WebDriverBy $select + * @param string|array|WebDriverBy $option * @see \Codeception\Module\WebDriver::unselectOption() */ - public function unselectOption($select, $option) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('unselectOption', func_get_args())); + public function unselectOption($select, $option): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('unselectOption', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2697,13 +2429,13 @@ public function unselectOption($select, $option) { * [!] Test won't be stopped on fail. Error won't be logged * Unselect an option in the given select box. * - * @param $select - * @param $option + * @param string|array|WebDriverBy $select + * @param string|array|WebDriverBy $option * @see \Codeception\Module\WebDriver::unselectOption() */ - public function tryToUnselectOption($select, $option) { + public function tryToUnselectOption($select, $option): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('unselectOption', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2725,17 +2457,14 @@ public function retryUnselectOption($select, $option) { * * Ticks a checkbox. For radio buttons, use the `selectOption` method instead. * - * ``` php + * ```php * checkOption('#agree'); - * ?> * ``` - * - * @param $option * @see \Codeception\Module\WebDriver::checkOption() */ - public function checkOption($option) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('checkOption', func_get_args())); + public function checkOption($option): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('checkOption', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2743,18 +2472,15 @@ public function checkOption($option) { * [!] Test won't be stopped on fail. Error won't be logged * Ticks a checkbox. For radio buttons, use the `selectOption` method instead. * - * ``` php + * ```php * checkOption('#agree'); - * ?> * ``` - * - * @param $option * @see \Codeception\Module\WebDriver::checkOption() */ - public function tryToCheckOption($option) { + public function tryToCheckOption($option): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('checkOption', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2776,17 +2502,14 @@ public function retryCheckOption($option) { * * Unticks a checkbox. * - * ``` php + * ```php * uncheckOption('#notify'); - * ?> * ``` - * - * @param $option * @see \Codeception\Module\WebDriver::uncheckOption() */ - public function uncheckOption($option) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args())); + public function uncheckOption($option): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2794,18 +2517,15 @@ public function uncheckOption($option) { * [!] Test won't be stopped on fail. Error won't be logged * Unticks a checkbox. * - * ``` php + * ```php * uncheckOption('#notify'); - * ?> * ``` - * - * @param $option * @see \Codeception\Module\WebDriver::uncheckOption() */ - public function tryToUncheckOption($option) { + public function tryToUncheckOption($option): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('uncheckOption', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2827,19 +2547,15 @@ public function retryUncheckOption($option) { * * Fills a text field or textarea with the given string. * - * ``` php + * ```php * fillField("//input[@type='text']", "Hello World!"); * $I->fillField(['name' => 'email'], 'jon@example.com'); - * ?> * ``` - * - * @param $field - * @param $value * @see \Codeception\Module\WebDriver::fillField() */ - public function fillField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('fillField', func_get_args())); + public function fillField($field, $value): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('fillField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2847,20 +2563,16 @@ public function fillField($field, $value) { * [!] Test won't be stopped on fail. Error won't be logged * Fills a text field or textarea with the given string. * - * ``` php + * ```php * fillField("//input[@type='text']", "Hello World!"); * $I->fillField(['name' => 'email'], 'jon@example.com'); - * ?> * ``` - * - * @param $field - * @param $value * @see \Codeception\Module\WebDriver::fillField() */ - public function tryToFillField($field, $value) { + public function tryToFillField($field, $value): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('fillField', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2887,11 +2599,11 @@ public function retryFillField($field, $value) { * $I->clearField('#username'); * ``` * - * @param $field + * @param string|array|WebDriverBy $field * @see \Codeception\Module\WebDriver::clearField() */ - public function clearField($field) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('clearField', func_get_args())); + public function clearField($field): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('clearField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -2904,12 +2616,12 @@ public function clearField($field) { * $I->clearField('#username'); * ``` * - * @param $field + * @param string|array|WebDriverBy $field * @see \Codeception\Module\WebDriver::clearField() */ - public function tryToClearField($field) { + public function tryToClearField($field): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('clearField', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2930,59 +2642,57 @@ public function retryClearField($field) { * [!] Method is generated. Documentation taken from corresponding module. * * Type in characters on active element. - * With a second parameter you can specify delay between key presses. - * + * With a second parameter you can specify delay between key presses. + * * ```php * click('#input'); - * + * * // type text in active element * $I->type('Hello world'); - * + * * // type text with a 1sec delay between chars * $I->type('Hello World', 1); * ``` - * + * * This might be useful when you an input reacts to typing and you need to slow it down to emulate human behavior. * For instance, this is how Credit Card fields can be filled in. - * - * @param $text - * @param $delay [sec] + * + * @param int $delay [sec] * @see \Codeception\Module\WebDriver::type() */ - public function type($text, $delay = 0) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('type', func_get_args())); + public function type(string $text, int $delay = 0): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('type', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * * [!] Test won't be stopped on fail. Error won't be logged * Type in characters on active element. - * With a second parameter you can specify delay between key presses. - * + * With a second parameter you can specify delay between key presses. + * * ```php * click('#input'); - * + * * // type text in active element * $I->type('Hello world'); - * + * * // type text with a 1sec delay between chars * $I->type('Hello World', 1); * ``` - * + * * This might be useful when you an input reacts to typing and you need to slow it down to emulate human behavior. * For instance, this is how Credit Card fields can be filled in. - * - * @param $text - * @param $delay [sec] + * + * @param int $delay [sec] * @see \Codeception\Module\WebDriver::type() */ - public function tryToType($text, $delay = 0) { + public function tryToType(string $text, int $delay = 0): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('type', func_get_args())); - } + } /** * [!] Method is generated. * @@ -2992,7 +2702,7 @@ public function tryToType($text, $delay = 0) { * * @see \Codeception\Module\WebDriver::type() */ - public function retryType($text, $delay = 0) { + public function retryType(string $text, int $delay = 0) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('type', func_get_args(), $retryNum, $retryInterval)); @@ -3004,19 +2714,15 @@ public function retryType($text, $delay = 0) { * * Attaches a file relative to the Codeception `_data` directory to the given file upload field. * - * ``` php + * ```php * attachFile('input[@type="file"]', 'prices.xls'); - * ?> * ``` - * - * @param $field - * @param $filename * @see \Codeception\Module\WebDriver::attachFile() */ - public function attachFile($field, $filename) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('attachFile', func_get_args())); + public function attachFile($field, string $filename): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('attachFile', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3024,20 +2730,16 @@ public function attachFile($field, $filename) { * [!] Test won't be stopped on fail. Error won't be logged * Attaches a file relative to the Codeception `_data` directory to the given file upload field. * - * ``` php + * ```php * attachFile('input[@type="file"]', 'prices.xls'); - * ?> * ``` - * - * @param $field - * @param $filename * @see \Codeception\Module\WebDriver::attachFile() */ - public function tryToAttachFile($field, $filename) { + public function tryToAttachFile($field, string $filename): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('attachFile', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3047,7 +2749,7 @@ public function tryToAttachFile($field, $filename) { * * @see \Codeception\Module\WebDriver::attachFile() */ - public function retryAttachFile($field, $filename) { + public function retryAttachFile($field, string $filename) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('attachFile', func_get_args(), $retryNum, $retryInterval)); @@ -3061,22 +2763,17 @@ public function retryAttachFile($field, $filename) { * If a fuzzy locator is used, the element is found using CSS, XPath, * and by matching the full page source by regular expression. * - * ``` php + * ```php * grabTextFrom('h1'); * $heading = $I->grabTextFrom('descendant-or-self::h1'); * $value = $I->grabTextFrom('~ * ``` - * - * @param $cssOrXPathOrRegex - * - * @return mixed * @see \Codeception\Module\WebDriver::grabTextFrom() */ - public function grabTextFrom($cssOrXPathOrRegex) { + public function grabTextFrom($cssOrXPathOrRegex): mixed { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3096,25 +2793,18 @@ public function retryGrabTextFrom($cssOrXPathOrRegex) { /** * [!] 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. + * Returns the value of the given attribute value from the given HTML element. For some attributes, the string `true` is returned instead of their literal value (e.g. `disabled="disabled"` or `required="required"`). + * Fails if the element is not found. Returns `null` if the attribute is not present on the element. * - * ``` php + * ```php * grabAttributeFrom('#tooltip', 'title'); - * ?> * ``` - * - * - * @param $cssOrXpath - * @param $attribute - * - * @return mixed * @see \Codeception\Module\WebDriver::grabAttributeFrom() */ - public function grabAttributeFrom($cssOrXpath, $attribute) { + public function grabAttributeFrom($cssOrXpath, $attribute): ?string { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3137,23 +2827,18 @@ public function retryGrabAttributeFrom($cssOrXpath, $attribute) { * Finds the value for the given form field. * If a fuzzy locator is used, the field is found by field name, CSS, and XPath. * - * ``` php + * ```php * grabValueFrom('Name'); * $name = $I->grabValueFrom('input[name=username]'); * $name = $I->grabValueFrom('descendant-or-self::form/descendant::input[@name = 'username']'); * $name = $I->grabValueFrom(['name' => 'username']); - * ?> * ``` - * - * @param $field - * - * @return mixed * @see \Codeception\Module\WebDriver::grabValueFrom() */ - public function grabValueFrom($field) { + public function grabValueFrom($field): ?string { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3189,17 +2874,14 @@ public function retryGrabValueFrom($field) { * * // would return ['#first', '#second', '#third'] * $aLinks = $I->grabMultiple('a', 'href'); - * ?> * ``` * - * @param $cssOrXpath - * @param $attribute * @return string[] * @see \Codeception\Module\WebDriver::grabMultiple() */ - public function grabMultiple($cssOrXpath, $attribute = NULL) { + public function grabMultiple($cssOrXpath, $attribute = NULL): array { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3221,8 +2903,9 @@ public function retryGrabMultiple($cssOrXpath, $attribute = NULL) { * * Checks that the given element exists on the page and is visible. * You can also specify expected attributes of this element. + * Only works if `` tag is present. * - * ``` php + * ```php * seeElement('.error'); * $I->seeElement('//form/input[1]'); @@ -3231,16 +2914,11 @@ public function retryGrabMultiple($cssOrXpath, $attribute = NULL) { * * // strict locator in first arg, attributes in second * $I->seeElement(['css' => 'form input'], ['name' => 'login']); - * ?> * ``` - * - * @param $selector - * @param array $attributes - * @return * @see \Codeception\Module\WebDriver::seeElement() */ - public function seeElement($selector, $attributes = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); + public function seeElement($selector, array $attributes = []): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3248,8 +2926,9 @@ public function seeElement($selector, $attributes = []) { * [!] 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. + * Only works if `` tag is present. * - * ``` php + * ```php * seeElement('.error'); * $I->seeElement('//form/input[1]'); @@ -3258,16 +2937,11 @@ public function seeElement($selector, $attributes = []) { * * // strict locator in first arg, attributes in second * $I->seeElement(['css' => 'form input'], ['name' => 'login']); - * ?> * ``` - * - * @param $selector - * @param array $attributes - * @return * @see \Codeception\Module\WebDriver::seeElement() */ - public function canSeeElement($selector, $attributes = []) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); + public function canSeeElement($selector, array $attributes = []): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3275,8 +2949,9 @@ public function canSeeElement($selector, $attributes = []) { * [!] Test won't be stopped on fail. Error won't be logged * Checks that the given element exists on the page and is visible. * You can also specify expected attributes of this element. + * Only works if `` tag is present. * - * ``` php + * ```php * seeElement('.error'); * $I->seeElement('//form/input[1]'); @@ -3285,17 +2960,12 @@ public function canSeeElement($selector, $attributes = []) { * * // strict locator in first arg, attributes in second * $I->seeElement(['css' => 'form input'], ['name' => 'login']); - * ?> * ``` - * - * @param $selector - * @param array $attributes - * @return * @see \Codeception\Module\WebDriver::seeElement() */ - public function tryToSeeElement($selector, $attributes = []) { + public function tryToSeeElement($selector, array $attributes = []): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeElement', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3305,7 +2975,7 @@ public function tryToSeeElement($selector, $attributes = []) { * * @see \Codeception\Module\WebDriver::seeElement() */ - public function retrySeeElement($selector, $attributes = []) { + public function retrySeeElement($selector, array $attributes = []) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('seeElement', func_get_args(), $retryNum, $retryInterval)); @@ -3318,21 +2988,17 @@ public function retrySeeElement($selector, $attributes = []) { * Checks that the given element is invisible or not present on the page. * You can also specify expected attributes of this element. * - * ``` php + * ```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\Module\WebDriver::dontSeeElement() */ - public function dontSeeElement($selector, $attributes = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeElement', func_get_args())); + public function dontSeeElement($selector, array $attributes = []): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeElement', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3341,21 +3007,17 @@ public function dontSeeElement($selector, $attributes = []) { * Checks that the given element is invisible or not present on the page. * You can also specify expected attributes of this element. * - * ``` php + * ```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\Module\WebDriver::dontSeeElement() */ - public function cantSeeElement($selector, $attributes = []) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); + public function cantSeeElement($selector, array $attributes = []): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3364,22 +3026,18 @@ public function cantSeeElement($selector, $attributes = []) { * Checks that the given element is invisible or not present on the page. * You can also specify expected attributes of this element. * - * ``` php + * ```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\Module\WebDriver::dontSeeElement() */ - public function tryToDontSeeElement($selector, $attributes = []) { + public function tryToDontSeeElement($selector, array $attributes = []): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeElement', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3389,7 +3047,7 @@ public function tryToDontSeeElement($selector, $attributes = []) { * * @see \Codeception\Module\WebDriver::dontSeeElement() */ - public function retryDontSeeElement($selector, $attributes = []) { + public function retryDontSeeElement($selector, array $attributes = []) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('dontSeeElement', func_get_args(), $retryNum, $retryInterval)); @@ -3404,15 +3062,13 @@ public function retryDontSeeElement($selector, $attributes = []) { * ``` php * seeElementInDOM('//form/input[type=hidden]'); - * ?> * ``` * - * @param $selector - * @param array $attributes + * @param string|array|WebDriverBy $selector * @see \Codeception\Module\WebDriver::seeElementInDOM() */ - public function seeElementInDOM($selector, $attributes = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElementInDOM', func_get_args())); + public function seeElementInDOM($selector, array $attributes = []): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElementInDOM', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3423,15 +3079,13 @@ public function seeElementInDOM($selector, $attributes = []) { * ``` php * seeElementInDOM('//form/input[type=hidden]'); - * ?> * ``` * - * @param $selector - * @param array $attributes + * @param string|array|WebDriverBy $selector * @see \Codeception\Module\WebDriver::seeElementInDOM() */ - public function canSeeElementInDOM($selector, $attributes = []) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElementInDOM', func_get_args())); + public function canSeeElementInDOM($selector, array $attributes = []): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElementInDOM', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3442,16 +3096,14 @@ public function canSeeElementInDOM($selector, $attributes = []) { * ``` php * seeElementInDOM('//form/input[type=hidden]'); - * ?> * ``` * - * @param $selector - * @param array $attributes + * @param string|array|WebDriverBy $selector * @see \Codeception\Module\WebDriver::seeElementInDOM() */ - public function tryToSeeElementInDOM($selector, $attributes = []) { + public function tryToSeeElementInDOM($selector, array $attributes = []): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeElementInDOM', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3461,7 +3113,7 @@ public function tryToSeeElementInDOM($selector, $attributes = []) { * * @see \Codeception\Module\WebDriver::seeElementInDOM() */ - public function retrySeeElementInDOM($selector, $attributes = []) { + public function retrySeeElementInDOM($selector, array $attributes = []) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('seeElementInDOM', func_get_args(), $retryNum, $retryInterval)); @@ -3473,12 +3125,11 @@ public function retrySeeElementInDOM($selector, $attributes = []) { * * Opposite of `seeElementInDOM`. * - * @param $selector - * @param array $attributes + * @param string|array|WebDriverBy $selector * @see \Codeception\Module\WebDriver::dontSeeElementInDOM() */ - public function dontSeeElementInDOM($selector, $attributes = []) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeElementInDOM', func_get_args())); + public function dontSeeElementInDOM($selector, array $attributes = []): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeElementInDOM', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3486,12 +3137,11 @@ public function dontSeeElementInDOM($selector, $attributes = []) { * [!] Conditional Assertion: Test won't be stopped on fail * Opposite of `seeElementInDOM`. * - * @param $selector - * @param array $attributes + * @param string|array|WebDriverBy $selector * @see \Codeception\Module\WebDriver::dontSeeElementInDOM() */ - public function cantSeeElementInDOM($selector, $attributes = []) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElementInDOM', func_get_args())); + public function cantSeeElementInDOM($selector, array $attributes = []): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElementInDOM', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3499,13 +3149,12 @@ public function cantSeeElementInDOM($selector, $attributes = []) { * [!] Test won't be stopped on fail. Error won't be logged * Opposite of `seeElementInDOM`. * - * @param $selector - * @param array $attributes + * @param string|array|WebDriverBy $selector * @see \Codeception\Module\WebDriver::dontSeeElementInDOM() */ - public function tryToDontSeeElementInDOM($selector, $attributes = []) { + public function tryToDontSeeElementInDOM($selector, array $attributes = []): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeElementInDOM', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3515,7 +3164,7 @@ public function tryToDontSeeElementInDOM($selector, $attributes = []) { * * @see \Codeception\Module\WebDriver::dontSeeElementInDOM() */ - public function retryDontSeeElementInDOM($selector, $attributes = []) { + public function retryDontSeeElementInDOM($selector, array $attributes = []) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('dontSeeElementInDOM', func_get_args(), $retryNum, $retryInterval)); @@ -3527,18 +3176,17 @@ public function retryDontSeeElementInDOM($selector, $attributes = []) { * * Checks that there are a certain number of elements matched by the given locator on the page. * - * ``` php + * ```php * seeNumberOfElements('tr', 10); * $I->seeNumberOfElements('tr', [0,10]); // between 0 and 10 elements - * ?> * ``` - * @param $selector - * @param mixed $expected int or int[] + * + * @param int|int[] $expected * @see \Codeception\Module\WebDriver::seeNumberOfElements() */ - public function seeNumberOfElements($selector, $expected) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args())); + public function seeNumberOfElements($selector, $expected): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3546,18 +3194,17 @@ public function seeNumberOfElements($selector, $expected) { * [!] 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 + * ```php * seeNumberOfElements('tr', 10); * $I->seeNumberOfElements('tr', [0,10]); // between 0 and 10 elements - * ?> * ``` - * @param $selector - * @param mixed $expected int or int[] + * + * @param int|int[] $expected * @see \Codeception\Module\WebDriver::seeNumberOfElements() */ - public function canSeeNumberOfElements($selector, $expected) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args())); + public function canSeeNumberOfElements($selector, $expected): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3565,19 +3212,18 @@ public function canSeeNumberOfElements($selector, $expected) { * [!] Test won't be stopped on fail. Error won't be logged * Checks that there are a certain number of elements matched by the given locator on the page. * - * ``` php + * ```php * seeNumberOfElements('tr', 10); * $I->seeNumberOfElements('tr', [0,10]); // between 0 and 10 elements - * ?> * ``` - * @param $selector - * @param mixed $expected int or int[] + * + * @param int|int[] $expected * @see \Codeception\Module\WebDriver::seeNumberOfElements() */ - public function tryToSeeNumberOfElements($selector, $expected) { + public function tryToSeeNumberOfElements($selector, $expected): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeNumberOfElements', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3597,7 +3243,9 @@ public function retrySeeNumberOfElements($selector, $expected) { /** * [!] Method is generated. Documentation taken from corresponding module. * - * + * @param string|array|WebDriverBy $selector + * @param int|array $expected + * @throws ModuleException * @see \Codeception\Module\WebDriver::seeNumberOfElementsInDOM() */ public function seeNumberOfElementsInDOM($selector, $expected) { @@ -3607,7 +3255,9 @@ public function seeNumberOfElementsInDOM($selector, $expected) { * [!] Method is generated. Documentation taken from corresponding module. * * [!] Conditional Assertion: Test won't be stopped on fail - * + * @param string|array|WebDriverBy $selector + * @param int|array $expected + * @throws ModuleException * @see \Codeception\Module\WebDriver::seeNumberOfElementsInDOM() */ public function canSeeNumberOfElementsInDOM($selector, $expected) { @@ -3617,12 +3267,14 @@ public function canSeeNumberOfElementsInDOM($selector, $expected) { * [!] Method is generated. Documentation taken from corresponding module. * * [!] Test won't be stopped on fail. Error won't be logged - * + * @param string|array|WebDriverBy $selector + * @param int|array $expected + * @throws ModuleException * @see \Codeception\Module\WebDriver::seeNumberOfElementsInDOM() */ - public function tryToSeeNumberOfElementsInDOM($selector, $expected) { + public function tryToSeeNumberOfElementsInDOM($selector, $expected): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeNumberOfElementsInDOM', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3644,20 +3296,16 @@ public function retrySeeNumberOfElementsInDOM($selector, $expected) { * * Checks that the given option is selected. * - * ``` php + * ```php * seeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> * ``` * - * @param $selector - * @param $optionText - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::seeOptionIsSelected() */ - public function seeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); + public function seeOptionIsSelected($selector, $optionText): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3665,20 +3313,16 @@ public function seeOptionIsSelected($selector, $optionText) { * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the given option is selected. * - * ``` php + * ```php * seeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> * ``` * - * @param $selector - * @param $optionText - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::seeOptionIsSelected() */ - public function canSeeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); + public function canSeeOptionIsSelected($selector, $optionText): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3686,21 +3330,17 @@ public function canSeeOptionIsSelected($selector, $optionText) { * [!] Test won't be stopped on fail. Error won't be logged * Checks that the given option is selected. * - * ``` php + * ```php * seeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> * ``` * - * @param $selector - * @param $optionText - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::seeOptionIsSelected() */ - public function tryToSeeOptionIsSelected($selector, $optionText) { + public function tryToSeeOptionIsSelected($selector, $optionText): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeOptionIsSelected', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3722,20 +3362,16 @@ public function retrySeeOptionIsSelected($selector, $optionText) { * * Checks that the given option is not selected. * - * ``` php + * ```php * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> * ``` * - * @param $selector - * @param $optionText - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::dontSeeOptionIsSelected() */ - public function dontSeeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeOptionIsSelected', func_get_args())); + public function dontSeeOptionIsSelected($selector, $optionText): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeOptionIsSelected', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3743,20 +3379,16 @@ public function dontSeeOptionIsSelected($selector, $optionText) { * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the given option is not selected. * - * ``` php + * ```php * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> * ``` * - * @param $selector - * @param $optionText - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::dontSeeOptionIsSelected() */ - public function cantSeeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); + public function cantSeeOptionIsSelected($selector, $optionText): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3764,21 +3396,17 @@ public function cantSeeOptionIsSelected($selector, $optionText) { * [!] Test won't be stopped on fail. Error won't be logged * Checks that the given option is not selected. * - * ``` php + * ```php * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> * ``` * - * @param $selector - * @param $optionText - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::dontSeeOptionIsSelected() */ - public function tryToDontSeeOptionIsSelected($selector, $optionText) { + public function tryToDontSeeOptionIsSelected($selector, $optionText): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeOptionIsSelected', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3800,15 +3428,12 @@ public function retryDontSeeOptionIsSelected($selector, $optionText) { * * Checks that the page title contains the given string. * - * ``` php + * ```php * seeInTitle('Blog - Post #1'); - * ?> * ``` * - * @param $title - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::seeInTitle() */ public function seeInTitle($title) { @@ -3820,15 +3445,12 @@ public function seeInTitle($title) { * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the page title contains the given string. * - * ``` php + * ```php * seeInTitle('Blog - Post #1'); - * ?> * ``` * - * @param $title - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::seeInTitle() */ public function canSeeInTitle($title) { @@ -3840,20 +3462,17 @@ public function canSeeInTitle($title) { * [!] Test won't be stopped on fail. Error won't be logged * Checks that the page title contains the given string. * - * ``` php + * ```php * seeInTitle('Blog - Post #1'); - * ?> * ``` * - * @param $title - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::seeInTitle() */ - public function tryToSeeInTitle($title) { + public function tryToSeeInTitle($title): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeInTitle', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3875,9 +3494,7 @@ public function retrySeeInTitle($title) { * * Checks that the page title does not contain the given string. * - * @param $title - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::dontSeeInTitle() */ public function dontSeeInTitle($title) { @@ -3889,9 +3506,7 @@ public function dontSeeInTitle($title) { * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the page title does not contain the given string. * - * @param $title - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::dontSeeInTitle() */ public function cantSeeInTitle($title) { @@ -3903,14 +3518,12 @@ public function cantSeeInTitle($title) { * [!] Test won't be stopped on fail. Error won't be logged * Checks that the page title does not contain the given string. * - * @param $title - * - * @return mixed + * @return mixed|void * @see \Codeception\Module\WebDriver::dontSeeInTitle() */ - public function tryToDontSeeInTitle($title) { + public function tryToDontSeeInTitle($title): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeInTitle', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3932,11 +3545,11 @@ public function retryDontSeeInTitle($title) { * * Accepts the active JavaScript native popup window, as created by `window.alert`|`window.confirm`|`window.prompt`. * Don't confuse popups with modal windows, - * as created by [various libraries](http://jster.net/category/windows-modals-popups). + * as created by [various libraries](https://jster.net/category/windows-modals-popups). * @see \Codeception\Module\WebDriver::acceptPopup() */ - public function acceptPopup() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('acceptPopup', func_get_args())); + public function acceptPopup(): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('acceptPopup', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3944,12 +3557,12 @@ public function acceptPopup() { * [!] Test won't be stopped on fail. Error won't be logged * Accepts the active JavaScript native popup window, as created by `window.alert`|`window.confirm`|`window.prompt`. * Don't confuse popups with modal windows, - * as created by [various libraries](http://jster.net/category/windows-modals-popups). + * as created by [various libraries](https://jster.net/category/windows-modals-popups). * @see \Codeception\Module\WebDriver::acceptPopup() */ - public function tryToAcceptPopup() { + public function tryToAcceptPopup(): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('acceptPopup', func_get_args())); - } + } /** * [!] Method is generated. * @@ -3972,8 +3585,8 @@ public function retryAcceptPopup() { * Dismisses the active JavaScript popup, as created by `window.alert`, `window.confirm`, or `window.prompt`. * @see \Codeception\Module\WebDriver::cancelPopup() */ - public function cancelPopup() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('cancelPopup', func_get_args())); + public function cancelPopup(): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('cancelPopup', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -3982,9 +3595,9 @@ public function cancelPopup() { * Dismisses the active JavaScript popup, as created by `window.alert`, `window.confirm`, or `window.prompt`. * @see \Codeception\Module\WebDriver::cancelPopup() */ - public function tryToCancelPopup() { + public function tryToCancelPopup(): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('cancelPopup', func_get_args())); - } + } /** * [!] Method is generated. * @@ -4007,13 +3620,11 @@ public function retryCancelPopup() { * Checks that the active JavaScript popup, * as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string. * - * @param $text - * - * @throws \Codeception\Exception\ModuleException + * @throws ModuleException * @see \Codeception\Module\WebDriver::seeInPopup() */ - public function seeInPopup($text) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInPopup', func_get_args())); + public function seeInPopup(string $text): void { + $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInPopup', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -4022,13 +3633,11 @@ public function seeInPopup($text) { * Checks that the active JavaScript popup, * as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string. * - * @param $text - * - * @throws \Codeception\Exception\ModuleException + * @throws ModuleException * @see \Codeception\Module\WebDriver::seeInPopup() */ - public function canSeeInPopup($text) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPopup', func_get_args())); + public function canSeeInPopup(string $text): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPopup', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -4037,14 +3646,12 @@ public function canSeeInPopup($text) { * Checks that the active JavaScript popup, * as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string. * - * @param $text - * - * @throws \Codeception\Exception\ModuleException + * @throws ModuleException * @see \Codeception\Module\WebDriver::seeInPopup() */ - public function tryToSeeInPopup($text) { + public function tryToSeeInPopup(string $text): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('seeInPopup', func_get_args())); - } + } /** * [!] Method is generated. * @@ -4054,7 +3661,7 @@ public function tryToSeeInPopup($text) { * * @see \Codeception\Module\WebDriver::seeInPopup() */ - public function retrySeeInPopup($text) { + public function retrySeeInPopup(string $text) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('seeInPopup', func_get_args(), $retryNum, $retryInterval)); @@ -4067,13 +3674,11 @@ public function retrySeeInPopup($text) { * Checks that the active JavaScript popup, * as created by `window.alert`|`window.confirm`|`window.prompt`, does NOT contain the given string. * - * @param $text - * - * @throws \Codeception\Exception\ModuleException + * @throws ModuleException * @see \Codeception\Module\WebDriver::dontSeeInPopup() */ - public function dontSeeInPopup($text) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInPopup', func_get_args())); + public function dontSeeInPopup(string $text): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInPopup', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -4082,13 +3687,11 @@ public function dontSeeInPopup($text) { * Checks that the active JavaScript popup, * as created by `window.alert`|`window.confirm`|`window.prompt`, does NOT contain the given string. * - * @param $text - * - * @throws \Codeception\Exception\ModuleException + * @throws ModuleException * @see \Codeception\Module\WebDriver::dontSeeInPopup() */ - public function cantSeeInPopup($text) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPopup', func_get_args())); + public function cantSeeInPopup(string $text): void { + $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPopup', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -4097,14 +3700,12 @@ public function cantSeeInPopup($text) { * Checks that the active JavaScript popup, * as created by `window.alert`|`window.confirm`|`window.prompt`, does NOT contain the given string. * - * @param $text - * - * @throws \Codeception\Exception\ModuleException + * @throws ModuleException * @see \Codeception\Module\WebDriver::dontSeeInPopup() */ - public function tryToDontSeeInPopup($text) { + public function tryToDontSeeInPopup(string $text): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('dontSeeInPopup', func_get_args())); - } + } /** * [!] Method is generated. * @@ -4114,7 +3715,7 @@ public function tryToDontSeeInPopup($text) { * * @see \Codeception\Module\WebDriver::dontSeeInPopup() */ - public function retryDontSeeInPopup($text) { + public function retryDontSeeInPopup(string $text) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('dontSeeInPopup', func_get_args(), $retryNum, $retryInterval)); @@ -4126,13 +3727,11 @@ public function retryDontSeeInPopup($text) { * * Enters text into a native JavaScript prompt popup, as created by `window.prompt`. * - * @param $keys - * - * @throws \Codeception\Exception\ModuleException + * @throws ModuleException * @see \Codeception\Module\WebDriver::typeInPopup() */ - public function typeInPopup($keys) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('typeInPopup', func_get_args())); + public function typeInPopup(string $keys): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('typeInPopup', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -4140,14 +3739,12 @@ public function typeInPopup($keys) { * [!] Test won't be stopped on fail. Error won't be logged * Enters text into a native JavaScript prompt popup, as created by `window.prompt`. * - * @param $keys - * - * @throws \Codeception\Exception\ModuleException + * @throws ModuleException * @see \Codeception\Module\WebDriver::typeInPopup() */ - public function tryToTypeInPopup($keys) { + public function tryToTypeInPopup(string $keys): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('typeInPopup', func_get_args())); - } + } /** * [!] Method is generated. * @@ -4157,7 +3754,7 @@ public function tryToTypeInPopup($keys) { * * @see \Codeception\Module\WebDriver::typeInPopup() */ - public function retryTypeInPopup($keys) { + public function retryTypeInPopup(string $keys) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('typeInPopup', func_get_args(), $retryNum, $retryInterval)); @@ -4170,8 +3767,8 @@ public function retryTypeInPopup($keys) { * Reloads the current page. * @see \Codeception\Module\WebDriver::reloadPage() */ - public function reloadPage() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('reloadPage', func_get_args())); + public function reloadPage(): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('reloadPage', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -4180,9 +3777,9 @@ public function reloadPage() { * Reloads the current page. * @see \Codeception\Module\WebDriver::reloadPage() */ - public function tryToReloadPage() { + public function tryToReloadPage(): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('reloadPage', func_get_args())); - } + } /** * [!] Method is generated. * @@ -4205,8 +3802,8 @@ public function retryReloadPage() { * Moves back in history. * @see \Codeception\Module\WebDriver::moveBack() */ - public function moveBack() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('moveBack', func_get_args())); + public function moveBack(): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('moveBack', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -4215,9 +3812,9 @@ public function moveBack() { * Moves back in history. * @see \Codeception\Module\WebDriver::moveBack() */ - public function tryToMoveBack() { + public function tryToMoveBack(): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('moveBack', func_get_args())); - } + } /** * [!] Method is generated. * @@ -4240,8 +3837,8 @@ public function retryMoveBack() { * Moves forward in history. * @see \Codeception\Module\WebDriver::moveForward() */ - public function moveForward() { - return $this->getScenario()->runStep(new \Codeception\Step\Action('moveForward', func_get_args())); + public function moveForward(): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('moveForward', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -4250,9 +3847,9 @@ public function moveForward() { * Moves forward in history. * @see \Codeception\Module\WebDriver::moveForward() */ - public function tryToMoveForward() { + public function tryToMoveForward(): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('moveForward', func_get_args())); - } + } /** * [!] Method is generated. * @@ -4306,17 +3903,17 @@ public function retryMoveForward() { * ``` html *
* Login: - *
+ *
* Password: - *
+ *
* Do you agree to our terms? - *
+ *
* Select pricing plan: * - * + * *
* ``` * @@ -4354,7 +3951,6 @@ public function retryMoveForward() { * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); * // $I->amOnPage('/path/to/form-page') may be needed * $I->seeInFormFields('//form[@id=my-form]', $form); - * ?> * ``` * * Parameter values must be set to arrays for multiple input fields @@ -4380,7 +3976,6 @@ public function retryMoveForward() { * 'second option value', * ] * ]); - * ?> * ``` * * Mixing string and boolean values for a checkbox's value is not supported @@ -4418,7 +4013,7 @@ public function retryMoveForward() { * For example, given the following HTML: * * ``` html - * + * * ``` * * `$button` could be any one of the following: @@ -4426,13 +4021,12 @@ public function retryMoveForward() { * - ['name' => 'submitButton'] * - WebDriverBy::name('submitButton') * - * @param $selector - * @param $params - * @param $button + * @param string|array|WebDriverBy $selector + * @param string|array|WebDriverBy|null $button * @see \Codeception\Module\WebDriver::submitForm() */ - public function submitForm($selector, array $params, $button = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args())); + public function submitForm($selector, array $params, $button = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -4472,17 +4066,17 @@ public function submitForm($selector, array $params, $button = NULL) { * ``` html *
* Login: - *
+ *
* Password: - *
+ *
* Do you agree to our terms? - *
+ *
* Select pricing plan: * - * + * *
* ``` * @@ -4520,7 +4114,6 @@ public function submitForm($selector, array $params, $button = NULL) { * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); * // $I->amOnPage('/path/to/form-page') may be needed * $I->seeInFormFields('//form[@id=my-form]', $form); - * ?> * ``` * * Parameter values must be set to arrays for multiple input fields @@ -4546,7 +4139,6 @@ public function submitForm($selector, array $params, $button = NULL) { * 'second option value', * ] * ]); - * ?> * ``` * * Mixing string and boolean values for a checkbox's value is not supported @@ -4584,7 +4176,7 @@ public function submitForm($selector, array $params, $button = NULL) { * For example, given the following HTML: * * ``` html - * + * * ``` * * `$button` could be any one of the following: @@ -4592,14 +4184,13 @@ public function submitForm($selector, array $params, $button = NULL) { * - ['name' => 'submitButton'] * - WebDriverBy::name('submitButton') * - * @param $selector - * @param $params - * @param $button + * @param string|array|WebDriverBy $selector + * @param string|array|WebDriverBy|null $button * @see \Codeception\Module\WebDriver::submitForm() */ - public function tryToSubmitForm($selector, array $params, $button = NULL) { + public function tryToSubmitForm($selector, array $params, $button = NULL): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('submitForm', func_get_args())); - } + } /** * [!] Method is generated. * @@ -4629,17 +4220,14 @@ public function retrySubmitForm($selector, array $params, $button = NULL) { * $I->waitForElementChange('#menu', function(WebDriverElement $el) { * return $el->isDisplayed(); * }, 100); - * ?> * ``` * - * @param $element - * @param \Closure $callback - * @param int $timeout seconds - * @throws \Codeception\Exception\ElementNotFound + * @param string|array|WebDriverBy $element + * @throws ElementNotFound * @see \Codeception\Module\WebDriver::waitForElementChange() */ - public function waitForElementChange($element, \Closure $callback, $timeout = 30) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementChange', func_get_args())); + public function waitForElementChange($element, \Closure $callback, int $timeout = 30): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementChange', func_get_args())); } @@ -4653,16 +4241,15 @@ public function waitForElementChange($element, \Closure $callback, $timeout = 30 * waitForElement('#agree_button', 30); // secs * $I->click('#agree_button'); - * ?> * ``` * - * @param $element + * @param string|array|WebDriverBy $element * @param int $timeout seconds - * @throws \Exception + * @throws Exception * @see \Codeception\Module\WebDriver::waitForElement() */ - public function waitForElement($element, $timeout = 10) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElement', func_get_args())); + public function waitForElement($element, int $timeout = 10): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElement', func_get_args())); } @@ -4676,16 +4263,15 @@ public function waitForElement($element, $timeout = 10) { * waitForElementVisible('#agree_button', 30); // secs * $I->click('#agree_button'); - * ?> * ``` * - * @param $element + * @param string|array|WebDriverBy $element * @param int $timeout seconds - * @throws \Exception + * @throws Exception * @see \Codeception\Module\WebDriver::waitForElementVisible() */ - public function waitForElementVisible($element, $timeout = 10) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementVisible', func_get_args())); + public function waitForElementVisible($element, int $timeout = 10): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementVisible', func_get_args())); } @@ -4698,16 +4284,15 @@ public function waitForElementVisible($element, $timeout = 10) { * ``` php * waitForElementNotVisible('#agree_button', 30); // secs - * ?> * ``` * - * @param $element + * @param string|array|WebDriverBy $element * @param int $timeout seconds - * @throws \Exception + * @throws Exception * @see \Codeception\Module\WebDriver::waitForElementNotVisible() */ - public function waitForElementNotVisible($element, $timeout = 10) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementNotVisible', func_get_args())); + public function waitForElementNotVisible($element, int $timeout = 10): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementNotVisible', func_get_args())); } @@ -4721,16 +4306,15 @@ public function waitForElementNotVisible($element, $timeout = 10) { * waitForElementClickable('#agree_button', 30); // secs * $I->click('#agree_button'); - * ?> * ``` * - * @param $element + * @param string|array|WebDriverBy $element * @param int $timeout seconds - * @throws \Exception + * @throws Exception * @see \Codeception\Module\WebDriver::waitForElementClickable() */ - public function waitForElementClickable($element, $timeout = 10) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementClickable', func_get_args())); + public function waitForElementClickable($element, int $timeout = 10): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementClickable', func_get_args())); } @@ -4747,17 +4331,15 @@ public function waitForElementClickable($element, $timeout = 10) { * waitForText('foo', 30); // secs * $I->waitForText('foo', 30, '.title'); // secs - * ?> * ``` * - * @param string $text * @param int $timeout seconds - * @param string $selector optional - * @throws \Exception + * @param null|string|array|WebDriverBy $selector + * @throws Exception * @see \Codeception\Module\WebDriver::waitForText() */ - public function waitForText($text, $timeout = 10, $selector = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForText', func_get_args())); + public function waitForText(string $text, int $timeout = 10, $selector = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('waitForText', func_get_args())); } @@ -4767,11 +4349,11 @@ public function waitForText($text, $timeout = 10, $selector = NULL) { * Wait for $timeout seconds. * * @param int|float $timeout secs - * @throws \Codeception\Exception\TestRuntimeException + * @throws TestRuntimeException * @see \Codeception\Module\WebDriver::wait() */ - public function wait($timeout) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('wait', func_get_args())); + public function wait($timeout): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('wait', func_get_args())); } @@ -4783,7 +4365,7 @@ public function wait($timeout) { * * ``` php * $I->executeInSelenium(function(\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) { - * $webdriver->get('http://google.com'); + * $webdriver->get('https://google.com'); * }); * ``` * @@ -4792,7 +4374,8 @@ public function wait($timeout) { * Try not to use this command on a regular basis. * If Codeception lacks a feature you need, please implement it and submit a patch. * - * @param callable $function + * @param Closure $function + * @return mixed * @see \Codeception\Module\WebDriver::executeInSelenium() */ public function executeInSelenium(\Closure $function) { @@ -4807,7 +4390,7 @@ public function executeInSelenium(\Closure $function) { * * ``` php * $I->executeInSelenium(function(\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) { - * $webdriver->get('http://google.com'); + * $webdriver->get('https://google.com'); * }); * ``` * @@ -4816,12 +4399,13 @@ public function executeInSelenium(\Closure $function) { * Try not to use this command on a regular basis. * If Codeception lacks a feature you need, please implement it and submit a patch. * - * @param callable $function + * @param Closure $function + * @return mixed * @see \Codeception\Module\WebDriver::executeInSelenium() */ - public function tryToExecuteInSelenium(\Closure $function) { + public function tryToExecuteInSelenium(\Closure $function): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('executeInSelenium', func_get_args())); - } + } /** * [!] Method is generated. * @@ -4847,7 +4431,7 @@ public function retryExecuteInSelenium(\Closure $function) { * * Example: * ``` html - * + * * ``` * * ``` php @@ -4857,7 +4441,6 @@ public function retryExecuteInSelenium(\Closure $function) { * $I->switchToWindow("another_window"); * # switch to parent window * $I->switchToWindow(); - * ?> * ``` * * If the window has no name, match it by switching to next active tab using `switchToNextTab` method. @@ -4871,14 +4454,11 @@ public function retryExecuteInSelenium(\Closure $function) { * $last_window = end($handles); * $webdriver->switchTo()->window($last_window); * }); - * ?> * ``` - * - * @param string|null $name * @see \Codeception\Module\WebDriver::switchToWindow() */ - public function switchToWindow($name = NULL) { - return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToWindow', func_get_args())); + public function switchToWindow(?string $name = NULL): void { + $this->getScenario()->runStep(new \Codeception\Step\Action('switchToWindow', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. @@ -4890,7 +4470,7 @@ public function switchToWindow($name = NULL) { * * Example: * ``` html - * + * * ``` * * ``` php @@ -4900,7 +4480,6 @@ public function switchToWindow($name = NULL) { * $I->switchToWindow("another_window"); * # switch to parent window * $I->switchToWindow(); - * ?> * ``` * * If the window has no name, match it by switching to next active tab using `switchToNextTab` method. @@ -4914,15 +4493,12 @@ public function switchToWindow($name = NULL) { * $last_window = end($handles); * $webdriver->switchTo()->window($last_window); * }); - * ?> * ``` - * - * @param string|null $name * @see \Codeception\Module\WebDriver::switchToWindow() */ - public function tryToSwitchToWindow($name = NULL) { + public function tryToSwitchToWindow(?string $name = NULL): bool { return $this->getScenario()->runStep(new \Codeception\Step\TryTo('switchToWindow', func_get_args())); - } + } /** * [!] Method is generated. * @@ -4932,7 +4508,7 @@ public function tryToSwitchToWindow($name = NULL) { * * @see \Codeception\Module\WebDriver::switchToWindow() */ - public function retrySwitchToWindow($name = NULL) { + public function retrySwitchToWindow(?string $name = NULL) { $retryNum = isset($this->retryNum) ? $this->retryNum : 1; $retryInterval = isset($this->retryInterval) ? $this->retryInterval : 200; return $this->getScenario()->runStep(new \Codeception\Step\Retry('switchToWindow', func_get_args(), $retryNum, $retryInterval)); @@ -4946,7 +4522,7 @@ public function retrySwitchToWindow($name = NULL) { * * Example: * ``` html - *