diff --git a/tests/_support/AcceptanceHelper.php b/tests/_support/AcceptanceHelper.php index 668da09b2..26ef21f63 100644 --- a/tests/_support/AcceptanceHelper.php +++ b/tests/_support/AcceptanceHelper.php @@ -4,6 +4,8 @@ // here you can define custom actions // all public methods declared in helper class will be available in $I +use PHPUnit\Framework\Assert; + class AcceptanceHelper extends \Codeception\Module { diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index 566a1d93f..8c45540a3 100644 --- a/tests/_support/AcceptanceTester.php +++ b/tests/_support/AcceptanceTester.php @@ -1,26 +1,27 @@ getScenario()->runStep(new \Codeception\Step\Action('loginAsAdmin', func_get_args())); } @@ -67,7 +67,7 @@ public function loginAsAdmin($timeout = null, $maxAttempts = null) { * @return void * @see \Codeception\Module\WPWebDriver::loginAs() */ - public function loginAs($username, $password, $timeout = null, $maxAttempts = null) { + public function loginAs($username, $password, $timeout = 10, $maxAttempts = 5) { return $this->getScenario()->runStep(new \Codeception\Step\Action('loginAs', func_get_args())); } @@ -111,7 +111,7 @@ public function grabCookiesWithPattern($cookiePattern) { * @return void * @see \Codeception\Module\WPWebDriver::waitForJqueryAjax() */ - public function waitForJqueryAjax($time = null) { + public function waitForJqueryAjax($time = 10) { return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForJqueryAjax', func_get_args())); } @@ -202,7 +202,7 @@ public function activatePlugin($pluginSlug) { * @param \Codeception\TestInterface $test * @see \Codeception\Module\WebDriver::debugWebDriverLogs() */ - public function debugWebDriverLogs($test = null) { + public function debugWebDriverLogs($test = NULL) { return $this->getScenario()->runStep(new \Codeception\Step\Action('debugWebDriverLogs', func_get_args())); } @@ -252,11 +252,54 @@ public function amOnSubdomain($subdomain) { * @param $name * @see \Codeception\Module\WebDriver::makeScreenshot() */ - public function makeScreenshot($name = null) { + public function makeScreenshot($name = NULL) { return $this->getScenario()->runStep(new \Codeception\Step\Action('makeScreenshot', func_get_args())); } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Takes a screenshot of an element of the current window and saves it to `tests/_output/debug`. + * + * ``` php + * amOnPage('/user/edit'); + * $I->makeElementScreenshot('#dialog', 'edit_page'); + * // saved to: tests/_output/debug/edit_page.png + * $I->makeElementScreenshot('#dialog'); + * // saved to: tests/_output/debug/2017-05-26_14-24-11_4b3403665fea6.png + * ``` + * + * @param $name + * @see \Codeception\Module\WebDriver::makeElementScreenshot() + */ + public function makeElementScreenshot($selector, $name = NULL) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('makeElementScreenshot', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Use this method within an [interactive pause](https://codeception.com/docs/02-GettingStarted#Interactive-Pause) to save the HTML source code of the current page. + * + * ```php + * makeHtmlSnapshot('edit_page'); + * // saved to: tests/_output/debug/edit_page.html + * $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())); + } + + /** * [!] Method is generated. Documentation taken from corresponding module. * @@ -292,15 +335,15 @@ public function resizeWindow($width, $height) { * @param $cookie * @param array $params * @return mixed - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeCookie() */ - public function canSeeCookie($cookie, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); + public function seeCookie($cookie, $params = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that a cookie with the given name is set. * You can set additional cookie params like `domain`, `path` as array passed in last argument. * @@ -315,8 +358,8 @@ public function canSeeCookie($cookie, $params = null) { * @return mixed * @see \Codeception\Module\WebDriver::seeCookie() */ - public function seeCookie($cookie, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); + public function canSeeCookie($cookie, $params = []) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); } @@ -330,15 +373,15 @@ public function seeCookie($cookie, $params = null) { * * @param array $params * @return mixed - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeCookie() */ - public function cantSeeCookie($cookie, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); + public function dontSeeCookie($cookie, $params = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCookie', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that there isn't a cookie with the given name. * You can set additional cookie params like `domain`, `path` as array passed in last argument. * @@ -348,8 +391,8 @@ public function cantSeeCookie($cookie, $params = null) { * @return mixed * @see \Codeception\Module\WebDriver::dontSeeCookie() */ - public function dontSeeCookie($cookie, $params = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args())); + public function cantSeeCookie($cookie, $params = []) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); } @@ -372,7 +415,7 @@ public function dontSeeCookie($cookie, $params = null) { * @return mixed * @see \Codeception\Module\WebDriver::setCookie() */ - public function setCookie($cookie, $value, $params = null) { + public function setCookie($cookie, $value, $params = [], $showDebug = true) { return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); } @@ -389,7 +432,7 @@ public function setCookie($cookie, $value, $params = null) { * @return mixed * @see \Codeception\Module\WebDriver::resetCookie() */ - public function resetCookie($cookie, $params = null) { + public function resetCookie($cookie, $params = []) { return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args())); } @@ -399,6 +442,7 @@ public function resetCookie($cookie, $params = null) { * * 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 * @@ -406,7 +450,7 @@ public function resetCookie($cookie, $params = null) { * @return mixed * @see \Codeception\Module\WebDriver::grabCookie() */ - public function grabCookie($cookie, $params = null) { + public function grabCookie($cookie, $params = []) { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args())); } @@ -433,8 +477,8 @@ public function grabPageSource() { * * ``` php * amOnUrl('http://codeception.com'); - * $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart + * $I->amOnUrl('https://codeception.com'); + * $I->amOnPage('/quickstart'); // moves to https://codeception.com/quickstart * ?> * ``` * @see \Codeception\Module\WebDriver::amOnUrl() @@ -497,15 +541,15 @@ public function amOnPage($page) { * * @param string $text * @param array|string $selector optional - * Conditional Assertion: Test won't be stopped on fail * @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 see($text, $selector = NULL) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the current page contains the given string (case insensitive). * * You can specify a specific HTML element (via CSS or XPath) as the second @@ -537,8 +581,8 @@ public function canSee($text, $selector = null) { * @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 canSee($text, $selector = NULL) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args())); } @@ -572,15 +616,15 @@ public function see($text, $selector = null) { * * @param string $text * @param array|string $selector optional - * Conditional Assertion: Test won't be stopped on fail * @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 dontSee($text, $selector = NULL) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSee', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the current page doesn't contain the text specified (case insensitive). * Give a locator as the second parameter to match a specific region. * @@ -610,8 +654,8 @@ public function cantSee($text, $selector = null) { * @param array|string $selector optional * @see \Codeception\Module\WebDriver::dontSee() */ - public function dontSee($text, $selector = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args())); + public function cantSee($text, $selector = NULL) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args())); } @@ -627,15 +671,15 @@ public function dontSee($text, $selector = null) { * ``` * * @param $raw - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeInSource() */ - public function canSeeInSource($raw) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInSource', func_get_args())); + public function seeInSource($raw) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the current page contains the given string in its * raw source code. * @@ -647,8 +691,8 @@ public function canSeeInSource($raw) { * @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 canSeeInSource($raw) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInSource', func_get_args())); } @@ -664,15 +708,15 @@ public function seeInSource($raw) { * ``` * * @param $raw - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeInSource() */ - public function cantSeeInSource($raw) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args())); + public function dontSeeInSource($raw) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInSource', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the current page contains the given string in its * raw source code. * @@ -684,8 +728,8 @@ public function cantSeeInSource($raw) { * @param $raw * @see \Codeception\Module\WebDriver::dontSeeInSource() */ - public function dontSeeInSource($raw) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInSource', func_get_args())); + public function cantSeeInSource($raw) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args())); } @@ -700,15 +744,15 @@ public function dontSeeInSource($raw) { * ``` * * @param $text - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeInPageSource() */ - public function canSeeInPageSource($text) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPageSource', func_get_args())); + public function seeInPageSource($text) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInPageSource', 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 contains the given string. * * ```php @@ -719,8 +763,8 @@ public function canSeeInPageSource($text) { * @param $text * @see \Codeception\Module\WebDriver::seeInPageSource() */ - public function seeInPageSource($text) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInPageSource', func_get_args())); + public function canSeeInPageSource($text) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPageSource', func_get_args())); } @@ -730,22 +774,22 @@ public function seeInPageSource($text) { * Checks that the page source doesn't contain the given string. * * @param $text - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeInPageSource() */ - public function cantSeeInPageSource($text) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPageSource', func_get_args())); + public function dontSeeInPageSource($text) { + return $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 dontSeeInPageSource($text) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInPageSource', func_get_args())); + public function cantSeeInPageSource($text) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPageSource', func_get_args())); } @@ -783,7 +827,7 @@ public function dontSeeInPageSource($text) { * @param $context * @see \Codeception\Module\WebDriver::click() */ - public function click($link, $context = null) { + public function click($link, $context = NULL) { return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args())); } @@ -803,15 +847,15 @@ public function click($link, $context = null) { * * @param string $text * @param string $url optional - * Conditional Assertion: Test won't be stopped on fail * @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 seeLink($text, $url = NULL) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that there's a link with the specified text. * Give a full URL as the second parameter to match links with that exact URL. * @@ -826,8 +870,8 @@ public function canSeeLink($text, $url = null) { * @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 canSeeLink($text, $url = NULL) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args())); } @@ -846,15 +890,15 @@ public function seeLink($text, $url = null) { * * @param string $text * @param string $url optional - * Conditional Assertion: Test won't be stopped on fail * @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 dontSeeLink($text, $url = NULL) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeLink', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the page doesn't contain a link with the given string. * If the second parameter is given, only links with a matching "href" attribute will be checked. * @@ -869,8 +913,8 @@ public function cantSeeLink($text, $url = null) { * @param string $url optional * @see \Codeception\Module\WebDriver::dontSeeLink() */ - public function dontSeeLink($text, $url = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args())); + public function cantSeeLink($text, $url = NULL) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args())); } @@ -889,15 +933,15 @@ public function dontSeeLink($text, $url = null) { * ``` * * @param string $uri - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeInCurrentUrl() */ - public function canSeeInCurrentUrl($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); + public function seeInCurrentUrl($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that current URI contains the given string. * * ``` php @@ -912,8 +956,8 @@ public function canSeeInCurrentUrl($uri) { * @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 canSeeInCurrentUrl($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); } @@ -931,15 +975,15 @@ public function seeInCurrentUrl($uri) { * ``` * * @param string $uri - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeCurrentUrlEquals() */ - public function canSeeCurrentUrlEquals($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); + public function seeCurrentUrlEquals($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the current URL is equal to the given string. * Unlike `seeInCurrentUrl`, this only matches the full URL. * @@ -953,8 +997,8 @@ public function canSeeCurrentUrlEquals($uri) { * @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 canSeeCurrentUrlEquals($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); } @@ -971,15 +1015,15 @@ public function seeCurrentUrlEquals($uri) { * ``` * * @param string $uri - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeCurrentUrlMatches() */ - public function canSeeCurrentUrlMatches($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); + public function seeCurrentUrlMatches($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the current URL matches the given regular expression. * * ``` php @@ -992,8 +1036,8 @@ public function canSeeCurrentUrlMatches($uri) { * @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 canSeeCurrentUrlMatches($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); } @@ -1009,15 +1053,15 @@ public function seeCurrentUrlMatches($uri) { * ``` * * @param string $uri - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl() */ - public function cantSeeInCurrentUrl($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); + public function dontSeeInCurrentUrl($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInCurrentUrl', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the current URI doesn't contain the given string. * * ``` php @@ -1029,8 +1073,8 @@ public function cantSeeInCurrentUrl($uri) { * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeInCurrentUrl() */ - public function dontSeeInCurrentUrl($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args())); + public function cantSeeInCurrentUrl($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); } @@ -1048,15 +1092,15 @@ public function dontSeeInCurrentUrl($uri) { * ``` * * @param string $uri - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals() */ - public function cantSeeCurrentUrlEquals($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); + public function dontSeeCurrentUrlEquals($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCurrentUrlEquals', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the current URL doesn't equal the given string. * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. * @@ -1070,8 +1114,8 @@ public function cantSeeCurrentUrlEquals($uri) { * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlEquals() */ - public function dontSeeCurrentUrlEquals($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args())); + public function cantSeeCurrentUrlEquals($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); } @@ -1088,15 +1132,15 @@ public function dontSeeCurrentUrlEquals($uri) { * ``` * * @param string $uri - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches() */ - public function cantSeeCurrentUrlMatches($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); + public function dontSeeCurrentUrlMatches($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCurrentUrlMatches', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that current url doesn't match the given regular expression. * * ``` php @@ -1109,8 +1153,8 @@ public function cantSeeCurrentUrlMatches($uri) { * @param string $uri * @see \Codeception\Module\WebDriver::dontSeeCurrentUrlMatches() */ - public function dontSeeCurrentUrlMatches($uri) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args())); + public function cantSeeCurrentUrlMatches($uri) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); } @@ -1132,7 +1176,7 @@ public function dontSeeCurrentUrlMatches($uri) { * @return mixed * @see \Codeception\Module\WebDriver::grabFromCurrentUrl() */ - public function grabFromCurrentUrl($uri = null) { + public function grabFromCurrentUrl($uri = NULL) { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args())); } @@ -1151,15 +1195,15 @@ public function grabFromCurrentUrl($uri = null) { * ``` * * @param $checkbox - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeCheckboxIsChecked() */ - public function canSeeCheckboxIsChecked($checkbox) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); + public function seeCheckboxIsChecked($checkbox) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the specified checkbox is checked. * * ``` php @@ -1173,8 +1217,8 @@ public function canSeeCheckboxIsChecked($checkbox) { * @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 canSeeCheckboxIsChecked($checkbox) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); } @@ -1191,15 +1235,15 @@ public function seeCheckboxIsChecked($checkbox) { * ``` * * @param $checkbox - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeCheckboxIsChecked() */ - public function cantSeeCheckboxIsChecked($checkbox) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); + public function dontSeeCheckboxIsChecked($checkbox) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCheckboxIsChecked', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Check that the specified checkbox is unchecked. * * ``` php @@ -1212,8 +1256,8 @@ public function cantSeeCheckboxIsChecked($checkbox) { * @param $checkbox * @see \Codeception\Module\WebDriver::dontSeeCheckboxIsChecked() */ - public function dontSeeCheckboxIsChecked($checkbox) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args())); + public function cantSeeCheckboxIsChecked($checkbox) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); } @@ -1236,15 +1280,15 @@ public function dontSeeCheckboxIsChecked($checkbox) { * * @param $field * @param $value - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeInField() */ - public function canSeeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); + public function seeInField($field, $value) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the given input field or textarea *equals* (i.e. not just contains) the given value. * Fields are matched by label text, the "name" attribute, CSS, or XPath. * @@ -1263,8 +1307,8 @@ public function canSeeInField($field, $value) { * @param $value * @see \Codeception\Module\WebDriver::seeInField() */ - public function seeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); + public function canSeeInField($field, $value) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); } @@ -1287,15 +1331,15 @@ public function seeInField($field, $value) { * * @param $field * @param $value - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeInField() */ - public function cantSeeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); + public function dontSeeInField($field, $value) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInField', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that an input field or textarea doesn't contain the given value. * For fuzzy locators, the field is matched by label text, CSS and XPath. * @@ -1314,8 +1358,8 @@ public function cantSeeInField($field, $value) { * @param $value * @see \Codeception\Module\WebDriver::dontSeeInField() */ - public function dontSeeInField($field, $value) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args())); + public function cantSeeInField($field, $value) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); } @@ -1381,15 +1425,15 @@ public function dontSeeInField($field, $value) { * * @param $formSelector * @param $params - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeInFormFields() */ - public function canSeeInFormFields($formSelector, $params) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args())); + public function seeInFormFields($formSelector, $params) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks if the array of form parameters (name => value) are set on the form matched with the * passed selector. * @@ -1451,8 +1495,8 @@ public function canSeeInFormFields($formSelector, $params) { * @param $params * @see \Codeception\Module\WebDriver::seeInFormFields() */ - public function seeInFormFields($formSelector, $params) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args())); + public function canSeeInFormFields($formSelector, $params) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args())); } @@ -1498,15 +1542,15 @@ public function seeInFormFields($formSelector, $params) { * * @param $formSelector * @param $params - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeInFormFields() */ - public function cantSeeInFormFields($formSelector, $params) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args())); + public function dontSeeInFormFields($formSelector, $params) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInFormFields', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks if the array of form parameters (name => value) are not set on the form matched with * the passed selector. * @@ -1548,8 +1592,8 @@ public function cantSeeInFormFields($formSelector, $params) { * @param $params * @see \Codeception\Module\WebDriver::dontSeeInFormFields() */ - public function dontSeeInFormFields($formSelector, $params) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInFormFields', func_get_args())); + public function cantSeeInFormFields($formSelector, $params) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args())); } @@ -1652,7 +1696,7 @@ public function uncheckOption($option) { * ``` php * fillField("//input[@type='text']", "Hello World!"); - * $I->fillField(['name' => 'email'], 'jon@mail.com'); + * $I->fillField(['name' => 'email'], 'jon@example.com'); * ?> * ``` * @@ -1683,6 +1727,36 @@ public function clearField($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. + * + * ```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] + * @see \Codeception\Module\WebDriver::type() + */ + public function type($text, $delay = 0) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('type', func_get_args())); + } + + /** * [!] Method is generated. Documentation taken from corresponding module. * @@ -1805,7 +1879,7 @@ public function grabValueFrom($field) { * @return string[] * @see \Codeception\Module\WebDriver::grabMultiple() */ - public function grabMultiple($cssOrXpath, $attribute = null) { + public function grabMultiple($cssOrXpath, $attribute = NULL) { return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args())); } @@ -1831,15 +1905,15 @@ public function grabMultiple($cssOrXpath, $attribute = null) { * @param $selector * @param array $attributes * @return - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeElement() */ - public function canSeeElement($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); + public function seeElement($selector, $attributes = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the given element exists on the page and is visible. * You can also specify expected attributes of this element. * @@ -1860,8 +1934,8 @@ public function canSeeElement($selector, $attributes = null) { * @return * @see \Codeception\Module\WebDriver::seeElement() */ - public function seeElement($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); + public function canSeeElement($selector, $attributes = []) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); } @@ -1882,15 +1956,15 @@ public function seeElement($selector, $attributes = null) { * * @param $selector * @param array $attributes - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeElement() */ - public function cantSeeElement($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); + public function dontSeeElement($selector, $attributes = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeElement', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the given element is invisible or not present on the page. * You can also specify expected attributes of this element. * @@ -1907,8 +1981,8 @@ public function cantSeeElement($selector, $attributes = null) { * @param array $attributes * @see \Codeception\Module\WebDriver::dontSeeElement() */ - public function dontSeeElement($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args())); + public function cantSeeElement($selector, $attributes = []) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); } @@ -1925,15 +1999,15 @@ public function dontSeeElement($selector, $attributes = null) { * * @param $selector * @param array $attributes - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeElementInDOM() */ - public function canSeeElementInDOM($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElementInDOM', func_get_args())); + public function seeElementInDOM($selector, $attributes = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElementInDOM', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the given element exists on the page, even it is invisible. * * ``` php @@ -1946,8 +2020,8 @@ public function canSeeElementInDOM($selector, $attributes = null) { * @param array $attributes * @see \Codeception\Module\WebDriver::seeElementInDOM() */ - public function seeElementInDOM($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElementInDOM', func_get_args())); + public function canSeeElementInDOM($selector, $attributes = []) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElementInDOM', func_get_args())); } @@ -1958,23 +2032,23 @@ public function seeElementInDOM($selector, $attributes = null) { * * @param $selector * @param array $attributes - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeElementInDOM() */ - public function cantSeeElementInDOM($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElementInDOM', func_get_args())); + public function dontSeeElementInDOM($selector, $attributes = []) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeElementInDOM', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Opposite of `seeElementInDOM`. * * @param $selector * @param array $attributes * @see \Codeception\Module\WebDriver::dontSeeElementInDOM() */ - public function dontSeeElementInDOM($selector, $attributes = null) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeElementInDOM', func_get_args())); + public function cantSeeElementInDOM($selector, $attributes = []) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElementInDOM', func_get_args())); } @@ -1991,15 +2065,15 @@ public function dontSeeElementInDOM($selector, $attributes = null) { * ``` * @param $selector * @param mixed $expected int or int[] - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeNumberOfElements() */ - public function canSeeNumberOfElements($selector, $expected) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args())); + public function seeNumberOfElements($selector, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that there are a certain number of elements matched by the given locator on the page. * * ``` php @@ -2012,8 +2086,8 @@ public function canSeeNumberOfElements($selector, $expected) { * @param mixed $expected int or int[] * @see \Codeception\Module\WebDriver::seeNumberOfElements() */ - public function seeNumberOfElements($selector, $expected) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args())); + public function canSeeNumberOfElements($selector, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args())); } @@ -2021,20 +2095,20 @@ public function seeNumberOfElements($selector, $expected) { * [!] Method is generated. Documentation taken from corresponding module. * * - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeNumberOfElementsInDOM() */ - public function canSeeNumberOfElementsInDOM($selector, $expected) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElementsInDOM', func_get_args())); + public function seeNumberOfElementsInDOM($selector, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElementsInDOM', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * * @see \Codeception\Module\WebDriver::seeNumberOfElementsInDOM() */ - public function seeNumberOfElementsInDOM($selector, $expected) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElementsInDOM', func_get_args())); + public function canSeeNumberOfElementsInDOM($selector, $expected) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElementsInDOM', func_get_args())); } @@ -2053,15 +2127,15 @@ public function seeNumberOfElementsInDOM($selector, $expected) { * @param $optionText * * @return mixed - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeOptionIsSelected() */ - public function canSeeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); + public function seeOptionIsSelected($selector, $optionText) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the given option is selected. * * ``` php @@ -2076,8 +2150,8 @@ public function canSeeOptionIsSelected($selector, $optionText) { * @return mixed * @see \Codeception\Module\WebDriver::seeOptionIsSelected() */ - public function seeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); + public function canSeeOptionIsSelected($selector, $optionText) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); } @@ -2096,15 +2170,15 @@ public function seeOptionIsSelected($selector, $optionText) { * @param $optionText * * @return mixed - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeOptionIsSelected() */ - public function cantSeeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); + public function dontSeeOptionIsSelected($selector, $optionText) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeOptionIsSelected', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the given option is not selected. * * ``` php @@ -2119,8 +2193,8 @@ public function cantSeeOptionIsSelected($selector, $optionText) { * @return mixed * @see \Codeception\Module\WebDriver::dontSeeOptionIsSelected() */ - public function dontSeeOptionIsSelected($selector, $optionText) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args())); + public function cantSeeOptionIsSelected($selector, $optionText) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); } @@ -2138,15 +2212,15 @@ public function dontSeeOptionIsSelected($selector, $optionText) { * @param $title * * @return mixed - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeInTitle() */ - public function canSeeInTitle($title) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args())); + public function seeInTitle($title) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the page title contains the given string. * * ``` php @@ -2160,8 +2234,8 @@ public function canSeeInTitle($title) { * @return mixed * @see \Codeception\Module\WebDriver::seeInTitle() */ - public function seeInTitle($title) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args())); + public function canSeeInTitle($title) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args())); } @@ -2173,15 +2247,15 @@ public function seeInTitle($title) { * @param $title * * @return mixed - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeInTitle() */ - public function cantSeeInTitle($title) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args())); + public function dontSeeInTitle($title) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInTitle', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the page title does not contain the given string. * * @param $title @@ -2189,8 +2263,8 @@ public function cantSeeInTitle($title) { * @return mixed * @see \Codeception\Module\WebDriver::dontSeeInTitle() */ - public function dontSeeInTitle($title) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args())); + public function cantSeeInTitle($title) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args())); } @@ -2227,15 +2301,15 @@ public function cancelPopup() { * @param $text * * @throws \Codeception\Exception\ModuleException - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::seeInPopup() */ - public function canSeeInPopup($text) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPopup', func_get_args())); + public function seeInPopup($text) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInPopup', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the active JavaScript popup, * as created by `window.alert`|`window.confirm`|`window.prompt`, contains the given string. * @@ -2244,8 +2318,8 @@ public function canSeeInPopup($text) { * @throws \Codeception\Exception\ModuleException * @see \Codeception\Module\WebDriver::seeInPopup() */ - public function seeInPopup($text) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInPopup', func_get_args())); + public function canSeeInPopup($text) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInPopup', func_get_args())); } @@ -2258,15 +2332,15 @@ public function seeInPopup($text) { * @param $text * * @throws \Codeception\Exception\ModuleException - * Conditional Assertion: Test won't be stopped on fail * @see \Codeception\Module\WebDriver::dontSeeInPopup() */ - public function cantSeeInPopup($text) { - return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPopup', func_get_args())); + public function dontSeeInPopup($text) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInPopup', func_get_args())); } /** * [!] Method is generated. Documentation taken from corresponding module. * + * [!] Conditional Assertion: Test won't be stopped on fail * Checks that the active JavaScript popup, * as created by `window.alert`|`window.confirm`|`window.prompt`, does NOT contain the given string. * @@ -2275,8 +2349,8 @@ public function cantSeeInPopup($text) { * @throws \Codeception\Exception\ModuleException * @see \Codeception\Module\WebDriver::dontSeeInPopup() */ - public function dontSeeInPopup($text) { - return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInPopup', func_get_args())); + public function cantSeeInPopup($text) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInPopup', func_get_args())); } @@ -2427,16 +2501,16 @@ public function moveForward() { * 'field1' => 'value', * 'checkbox' => [ * 'value of first checkbox', - * 'value of second checkbox, + * 'value of second checkbox', * ], * 'otherCheckboxes' => [ * true, * false, - * false + * false, * ], * 'multiselect' => [ * 'first option value', - * 'second option value' + * 'second option value', * ] * ]); * ?> @@ -2490,7 +2564,7 @@ public function moveForward() { * @param $button * @see \Codeception\Module\WebDriver::submitForm() */ - public function submitForm($selector, $params, $button = null) { + public function submitForm($selector, $params, $button = NULL) { return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args())); } @@ -2517,7 +2591,7 @@ public function submitForm($selector, $params, $button = null) { * @throws \Codeception\Exception\ElementNotFound * @see \Codeception\Module\WebDriver::waitForElementChange() */ - public function waitForElementChange($element, $callback, $timeout = null) { + public function waitForElementChange($element, $callback, $timeout = 30) { return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementChange', func_get_args())); } @@ -2540,7 +2614,7 @@ public function waitForElementChange($element, $callback, $timeout = null) { * @throws \Exception * @see \Codeception\Module\WebDriver::waitForElement() */ - public function waitForElement($element, $timeout = null) { + public function waitForElement($element, $timeout = 10) { return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElement', func_get_args())); } @@ -2563,7 +2637,7 @@ public function waitForElement($element, $timeout = null) { * @throws \Exception * @see \Codeception\Module\WebDriver::waitForElementVisible() */ - public function waitForElementVisible($element, $timeout = null) { + public function waitForElementVisible($element, $timeout = 10) { return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementVisible', func_get_args())); } @@ -2585,7 +2659,7 @@ public function waitForElementVisible($element, $timeout = null) { * @throws \Exception * @see \Codeception\Module\WebDriver::waitForElementNotVisible() */ - public function waitForElementNotVisible($element, $timeout = null) { + public function waitForElementNotVisible($element, $timeout = 10) { return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementNotVisible', func_get_args())); } @@ -2608,7 +2682,7 @@ public function waitForElementNotVisible($element, $timeout = null) { * @throws \Exception * @see \Codeception\Module\WebDriver::waitForElementClickable() */ - public function waitForElementClickable($element, $timeout = null) { + public function waitForElementClickable($element, $timeout = 10) { return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForElementClickable', func_get_args())); } @@ -2635,7 +2709,7 @@ public function waitForElementClickable($element, $timeout = null) { * @throws \Exception * @see \Codeception\Module\WebDriver::waitForText() */ - public function waitForText($text, $timeout = null, $selector = null) { + public function waitForText($text, $timeout = 10, $selector = NULL) { return $this->getScenario()->runStep(new \Codeception\Step\Action('waitForText', func_get_args())); } @@ -2667,7 +2741,7 @@ public function wait($timeout) { * ``` * * This runs in the context of the - * [RemoteWebDriver class](https://github.com/facebook/php-webdriver/blob/master/lib/remote/RemoteWebDriver.php). + * [RemoteWebDriver class](https://github.com/php-webdriver/php-webdriver/blob/master/lib/remote/RemoteWebDriver.php). * Try not to use this command on a regular basis. * If Codeception lacks a feature you need, please implement it and submit a patch. * @@ -2718,7 +2792,7 @@ public function executeInSelenium($function) { * @param string|null $name * @see \Codeception\Module\WebDriver::switchToWindow() */ - public function switchToWindow($name = null) { + public function switchToWindow($name = NULL) { return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToWindow', func_get_args())); } @@ -2726,31 +2800,63 @@ public function switchToWindow($name = null) { /** * [!] Method is generated. Documentation taken from corresponding module. * - * Switch to another frame on the page. + * Switch to another iframe on the page. * * Example: * ``` html - *