Fix the failing unit tests
refactor the codestyle for the tests we wanted to keep
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?php //[STAMP] 0313d1b3990d7fd01d357b6dec376b7f
|
||||
<?php //[STAMP] 1f8497625552088e64c5a9f542e900d2
|
||||
namespace _generated;
|
||||
|
||||
// This class was automatically generated by build task
|
||||
@@ -19,20 +19,10 @@ trait AcceptanceTesterActions
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Sets the HTTP header to the passed value - which is used on
|
||||
* subsequent HTTP requests through PhpBrowser.
|
||||
* Alias to `haveHttpHeader`
|
||||
*
|
||||
* Example:
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->setHeader('X-Requested-With', 'Codeception');
|
||||
* $I->amOnPage('test-headers.php');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param string $name the name of the request header
|
||||
* @param string $value the value to set it to for subsequent
|
||||
* requests
|
||||
* @param $name
|
||||
* @param $value
|
||||
* @see \Codeception\Module\PhpBrowser::setHeader()
|
||||
*/
|
||||
public function setHeader($name, $value) {
|
||||
@@ -40,31 +30,6 @@ trait AcceptanceTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Deletes the header with the passed name. Subsequent requests
|
||||
* will not have the deleted header in its request.
|
||||
*
|
||||
* Example:
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->setHeader('X-Requested-With', 'Codeception');
|
||||
* $I->amOnPage('test-headers.php');
|
||||
* // ...
|
||||
* $I->deleteHeader('X-Requested-With');
|
||||
* $I->amOnPage('some-other-page.php');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param string $name the name of the header to delete.
|
||||
* @see \Codeception\Module\PhpBrowser::deleteHeader()
|
||||
*/
|
||||
public function deleteHeader($name) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
@@ -152,6 +117,66 @@ trait AcceptanceTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Sets the HTTP header to the passed value - which is used on
|
||||
* subsequent HTTP requests through PhpBrowser.
|
||||
*
|
||||
* Example:
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->haveHttpHeader('X-Requested-With', 'Codeception');
|
||||
* $I->amOnPage('test-headers.php');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* To use special chars in Header Key use HTML Character Entities:
|
||||
* Example:
|
||||
* Header with underscore - 'Client_Id'
|
||||
* should be represented as - 'Client_Id' or 'Client_Id'
|
||||
*
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->haveHttpHeader('Client_Id', 'Codeception');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param string $name the name of the request header
|
||||
* @param string $value the value to set it to for subsequent
|
||||
* requests
|
||||
* @see \Codeception\Lib\InnerBrowser::haveHttpHeader()
|
||||
*/
|
||||
public function haveHttpHeader($name, $value) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('haveHttpHeader', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Deletes the header with the passed name. Subsequent requests
|
||||
* will not have the deleted header in its request.
|
||||
*
|
||||
* Example:
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->haveHttpHeader('X-Requested-With', 'Codeception');
|
||||
* $I->amOnPage('test-headers.php');
|
||||
* // ...
|
||||
* $I->deleteHeader('X-Requested-With');
|
||||
* $I->amOnPage('some-other-page.php');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param string $name the name of the header to delete.
|
||||
* @see \Codeception\Lib\InnerBrowser::deleteHeader()
|
||||
*/
|
||||
public function deleteHeader($name) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
@@ -165,7 +190,7 @@ trait AcceptanceTesterActions
|
||||
* $I->amOnPage('/register');
|
||||
* ```
|
||||
*
|
||||
* @param $page
|
||||
* @param string $page
|
||||
* @see \Codeception\Lib\InnerBrowser::amOnPage()
|
||||
*/
|
||||
public function amOnPage($page) {
|
||||
@@ -216,33 +241,34 @@ trait AcceptanceTesterActions
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that the current page contains the given string (case insensitive).
|
||||
*
|
||||
* You can specify a specific HTML element (via CSS or XPath) as the second
|
||||
*
|
||||
* You can specify a specific HTML element (via CSS or XPath) as the second
|
||||
* parameter to only search within that element.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->see('Logout'); // I can suppose user is logged in
|
||||
* $I->see('Sign Up', 'h1'); // I can suppose it's a signup page
|
||||
* $I->see('Sign Up', '//body/h1'); // with XPath
|
||||
* $I->see('Logout'); // I can suppose user is logged in
|
||||
* $I->see('Sign Up', 'h1'); // I can suppose it's a signup page
|
||||
* $I->see('Sign Up', '//body/h1'); // with XPath
|
||||
* $I->see('Sign Up', ['css' => 'body h1']); // with strict CSS locator
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Note that the search is done after stripping all HTML tags from the body,
|
||||
* so `$I->see('strong')` will return true for strings like:
|
||||
*
|
||||
*
|
||||
* - `<p>I am Stronger than thou</p>`
|
||||
* - `<script>document.createElement('strong');</script>`
|
||||
*
|
||||
*
|
||||
* But will *not* be true for strings like:
|
||||
*
|
||||
*
|
||||
* - `<strong>Home</strong>`
|
||||
* - `<div class="strong">Home</strong>`
|
||||
* - `<!-- strong -->`
|
||||
*
|
||||
*
|
||||
* For checking the raw source code, use `seeInSource()`.
|
||||
*
|
||||
* @param $text
|
||||
* @param null $selector
|
||||
* @param string $text
|
||||
* @param string $selector optional
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::see()
|
||||
*/
|
||||
@@ -253,33 +279,34 @@ trait AcceptanceTesterActions
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that the current page contains the given string (case insensitive).
|
||||
*
|
||||
* You can specify a specific HTML element (via CSS or XPath) as the second
|
||||
*
|
||||
* You can specify a specific HTML element (via CSS or XPath) as the second
|
||||
* parameter to only search within that element.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->see('Logout'); // I can suppose user is logged in
|
||||
* $I->see('Sign Up', 'h1'); // I can suppose it's a signup page
|
||||
* $I->see('Sign Up', '//body/h1'); // with XPath
|
||||
* $I->see('Logout'); // I can suppose user is logged in
|
||||
* $I->see('Sign Up', 'h1'); // I can suppose it's a signup page
|
||||
* $I->see('Sign Up', '//body/h1'); // with XPath
|
||||
* $I->see('Sign Up', ['css' => 'body h1']); // with strict CSS locator
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Note that the search is done after stripping all HTML tags from the body,
|
||||
* so `$I->see('strong')` will return true for strings like:
|
||||
*
|
||||
*
|
||||
* - `<p>I am Stronger than thou</p>`
|
||||
* - `<script>document.createElement('strong');</script>`
|
||||
*
|
||||
*
|
||||
* But will *not* be true for strings like:
|
||||
*
|
||||
*
|
||||
* - `<strong>Home</strong>`
|
||||
* - `<div class="strong">Home</strong>`
|
||||
* - `<!-- strong -->`
|
||||
*
|
||||
*
|
||||
* For checking the raw source code, use `seeInSource()`.
|
||||
*
|
||||
* @param $text
|
||||
* @param null $selector
|
||||
* @param string $text
|
||||
* @param string $selector optional
|
||||
* @see \Codeception\Lib\InnerBrowser::see()
|
||||
*/
|
||||
public function see($text, $selector = null) {
|
||||
@@ -295,27 +322,28 @@ trait AcceptanceTesterActions
|
||||
*
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->dontSee('Login'); // I can suppose user is already logged in
|
||||
* $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
|
||||
* $I->dontSee('Sign Up','//body/h1'); // with XPath
|
||||
* $I->dontSee('Login'); // I can suppose user is already logged in
|
||||
* $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
|
||||
* $I->dontSee('Sign Up','//body/h1'); // with XPath
|
||||
* $I->dontSee('Sign Up', ['css' => 'body h1']); // with strict CSS locator
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Note that the search is done after stripping all HTML tags from the body,
|
||||
* so `$I->dontSee('strong')` will fail on strings like:
|
||||
*
|
||||
*
|
||||
* - `<p>I am Stronger than thou</p>`
|
||||
* - `<script>document.createElement('strong');</script>`
|
||||
*
|
||||
*
|
||||
* But will ignore strings like:
|
||||
*
|
||||
*
|
||||
* - `<strong>Home</strong>`
|
||||
* - `<div class="strong">Home</strong>`
|
||||
* - `<!-- strong -->`
|
||||
*
|
||||
*
|
||||
* For checking the raw source code, use `seeInSource()`.
|
||||
*
|
||||
* @param $text
|
||||
* @param null $selector
|
||||
* @param string $text
|
||||
* @param string $selector optional
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSee()
|
||||
*/
|
||||
@@ -330,27 +358,28 @@ trait AcceptanceTesterActions
|
||||
*
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->dontSee('Login'); // I can suppose user is already logged in
|
||||
* $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
|
||||
* $I->dontSee('Sign Up','//body/h1'); // with XPath
|
||||
* $I->dontSee('Login'); // I can suppose user is already logged in
|
||||
* $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
|
||||
* $I->dontSee('Sign Up','//body/h1'); // with XPath
|
||||
* $I->dontSee('Sign Up', ['css' => 'body h1']); // with strict CSS locator
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Note that the search is done after stripping all HTML tags from the body,
|
||||
* so `$I->dontSee('strong')` will fail on strings like:
|
||||
*
|
||||
*
|
||||
* - `<p>I am Stronger than thou</p>`
|
||||
* - `<script>document.createElement('strong');</script>`
|
||||
*
|
||||
*
|
||||
* But will ignore strings like:
|
||||
*
|
||||
*
|
||||
* - `<strong>Home</strong>`
|
||||
* - `<div class="strong">Home</strong>`
|
||||
* - `<!-- strong -->`
|
||||
*
|
||||
*
|
||||
* For checking the raw source code, use `seeInSource()`.
|
||||
*
|
||||
* @param $text
|
||||
* @param null $selector
|
||||
* @param string $text
|
||||
* @param string $selector optional
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSee()
|
||||
*/
|
||||
public function dontSee($text, $selector = null) {
|
||||
@@ -445,8 +474,8 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @param null $url
|
||||
* @param string $text
|
||||
* @param string $url optional
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::seeLink()
|
||||
*/
|
||||
@@ -466,8 +495,8 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @param null $url
|
||||
* @param string $text
|
||||
* @param string $url optional
|
||||
* @see \Codeception\Lib\InnerBrowser::seeLink()
|
||||
*/
|
||||
public function seeLink($text, $url = null) {
|
||||
@@ -488,8 +517,8 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @param null $url
|
||||
* @param string $text
|
||||
* @param string $url optional
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeLink()
|
||||
*/
|
||||
@@ -509,8 +538,8 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $text
|
||||
* @param null $url
|
||||
* @param string $text
|
||||
* @param string $url optional
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeLink()
|
||||
*/
|
||||
public function dontSeeLink($text, $url = null) {
|
||||
@@ -532,7 +561,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
|
||||
*/
|
||||
@@ -553,7 +582,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
|
||||
*/
|
||||
public function seeInCurrentUrl($uri) {
|
||||
@@ -572,7 +601,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
|
||||
*/
|
||||
@@ -590,7 +619,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
|
||||
*/
|
||||
public function dontSeeInCurrentUrl($uri) {
|
||||
@@ -611,7 +640,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
|
||||
*/
|
||||
@@ -631,7 +660,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
|
||||
*/
|
||||
public function seeCurrentUrlEquals($uri) {
|
||||
@@ -652,7 +681,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
|
||||
*/
|
||||
@@ -672,7 +701,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
|
||||
*/
|
||||
public function dontSeeCurrentUrlEquals($uri) {
|
||||
@@ -692,7 +721,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
|
||||
*/
|
||||
@@ -711,7 +740,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
|
||||
*/
|
||||
public function seeCurrentUrlMatches($uri) {
|
||||
@@ -731,7 +760,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
|
||||
*/
|
||||
@@ -750,7 +779,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $uri
|
||||
* @param string $uri
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
|
||||
*/
|
||||
public function dontSeeCurrentUrlMatches($uri) {
|
||||
@@ -761,7 +790,7 @@ trait AcceptanceTesterActions
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Executes the given regular expression against the current URI and returns the first match.
|
||||
* 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
|
||||
@@ -771,7 +800,7 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param null $uri
|
||||
* @param string $uri optional
|
||||
*
|
||||
* @return mixed
|
||||
* @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl()
|
||||
@@ -864,8 +893,8 @@ trait AcceptanceTesterActions
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that the given input field or textarea contains the given value.
|
||||
* For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
|
||||
* 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
|
||||
@@ -889,8 +918,8 @@ trait AcceptanceTesterActions
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that the given input field or textarea contains the given value.
|
||||
* For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
|
||||
* 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
|
||||
@@ -968,7 +997,7 @@ trait AcceptanceTesterActions
|
||||
*
|
||||
* Checks if the array of form parameters (name => value) are set on the form matched with the
|
||||
* passed selector.
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeInFormFields('form[name=myform]', [
|
||||
@@ -977,10 +1006,10 @@ trait AcceptanceTesterActions
|
||||
* ]);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* For multi-select elements, or to check values of multiple elements with the same name, an
|
||||
* array may be passed:
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeInFormFields('.form-class', [
|
||||
@@ -997,7 +1026,7 @@ trait AcceptanceTesterActions
|
||||
* ```
|
||||
*
|
||||
* Additionally, checkbox values can be checked with a boolean.
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeInFormFields('#form-id', [
|
||||
@@ -1006,9 +1035,9 @@ trait AcceptanceTesterActions
|
||||
* ]);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Pair this with submitForm for quick testing magic.
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $form = [
|
||||
@@ -1022,7 +1051,7 @@ trait AcceptanceTesterActions
|
||||
* $I->seeInFormFields('//form[@id=my-form]', $form);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @param $formSelector
|
||||
* @param $params
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
@@ -1036,7 +1065,7 @@ trait AcceptanceTesterActions
|
||||
*
|
||||
* Checks if the array of form parameters (name => value) are set on the form matched with the
|
||||
* passed selector.
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeInFormFields('form[name=myform]', [
|
||||
@@ -1045,10 +1074,10 @@ trait AcceptanceTesterActions
|
||||
* ]);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* For multi-select elements, or to check values of multiple elements with the same name, an
|
||||
* array may be passed:
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeInFormFields('.form-class', [
|
||||
@@ -1065,7 +1094,7 @@ trait AcceptanceTesterActions
|
||||
* ```
|
||||
*
|
||||
* Additionally, checkbox values can be checked with a boolean.
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeInFormFields('#form-id', [
|
||||
@@ -1074,9 +1103,9 @@ trait AcceptanceTesterActions
|
||||
* ]);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Pair this with submitForm for quick testing magic.
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $form = [
|
||||
@@ -1090,7 +1119,7 @@ trait AcceptanceTesterActions
|
||||
* $I->seeInFormFields('//form[@id=my-form]', $form);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @param $formSelector
|
||||
* @param $params
|
||||
* @see \Codeception\Lib\InnerBrowser::seeInFormFields()
|
||||
@@ -1105,7 +1134,7 @@ trait AcceptanceTesterActions
|
||||
*
|
||||
* Checks if the array of form parameters (name => value) are not set on the form matched with
|
||||
* the passed selector.
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->dontSeeInFormFields('form[name=myform]', [
|
||||
@@ -1114,10 +1143,10 @@ trait AcceptanceTesterActions
|
||||
* ]);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* To check that an element hasn't been assigned any one of many values, an array can be passed
|
||||
* as the value:
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->dontSeeInFormFields('.form-class', [
|
||||
@@ -1130,7 +1159,7 @@ trait AcceptanceTesterActions
|
||||
* ```
|
||||
*
|
||||
* Additionally, checkbox values can be checked with a boolean.
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->dontSeeInFormFields('#form-id', [
|
||||
@@ -1139,7 +1168,7 @@ trait AcceptanceTesterActions
|
||||
* ]);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @param $formSelector
|
||||
* @param $params
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
@@ -1153,7 +1182,7 @@ trait AcceptanceTesterActions
|
||||
*
|
||||
* Checks if the array of form parameters (name => value) are not set on the form matched with
|
||||
* the passed selector.
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->dontSeeInFormFields('form[name=myform]', [
|
||||
@@ -1162,10 +1191,10 @@ trait AcceptanceTesterActions
|
||||
* ]);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* To check that an element hasn't been assigned any one of many values, an array can be passed
|
||||
* as the value:
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->dontSeeInFormFields('.form-class', [
|
||||
@@ -1178,7 +1207,7 @@ trait AcceptanceTesterActions
|
||||
* ```
|
||||
*
|
||||
* Additionally, checkbox values can be checked with a boolean.
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->dontSeeInFormFields('#form-id', [
|
||||
@@ -1187,7 +1216,7 @@ trait AcceptanceTesterActions
|
||||
* ]);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @param $formSelector
|
||||
* @param $params
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields()
|
||||
@@ -1200,22 +1229,22 @@ trait AcceptanceTesterActions
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Submits the given form on the page, optionally with the given form
|
||||
* Submits the given form on the page, with the given form
|
||||
* values. Pass the form field's values as an array in the second
|
||||
* parameter.
|
||||
*
|
||||
* Although this function can be used as a short-hand version of
|
||||
* `fillField()`, `selectOption()`, `click()` etc. it has some important
|
||||
* Although this function can be used as a short-hand version of
|
||||
* `fillField()`, `selectOption()`, `click()` etc. it has some important
|
||||
* differences:
|
||||
*
|
||||
*
|
||||
* * Only field *names* may be used, not CSS/XPath selectors nor field labels
|
||||
* * If a field is sent to this function that does *not* exist on the page,
|
||||
* it will silently be added to the HTTP request. This is helpful for testing
|
||||
* some types of forms, but be aware that you will *not* get an exception
|
||||
* like you would if you called `fillField()` or `selectOption()` with
|
||||
* a missing field.
|
||||
*
|
||||
* Fields that are not provided will be filled by their values from the page,
|
||||
*
|
||||
* Fields that are not provided will be filled by their values from the page,
|
||||
* or from any previous calls to `fillField()`, `selectOption()` etc.
|
||||
* You don't need to click the 'Submit' button afterwards.
|
||||
* This command itself triggers the request to form's action.
|
||||
@@ -1278,10 +1307,10 @@ trait AcceptanceTesterActions
|
||||
* ```
|
||||
* Note that "2" will be the submitted value for the "plan" field, as it is
|
||||
* the selected option.
|
||||
*
|
||||
*
|
||||
* You can also emulate a JavaScript submission by not specifying any
|
||||
* buttons in the third parameter to submitForm.
|
||||
*
|
||||
*
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->submitForm(
|
||||
@@ -1295,10 +1324,10 @@ trait AcceptanceTesterActions
|
||||
* ]
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* This function works well when paired with `seeInFormFields()`
|
||||
*
|
||||
* This function works well when paired with `seeInFormFields()`
|
||||
* for quickly testing CRUD interfaces and form validation logic.
|
||||
*
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $form = [
|
||||
@@ -1339,11 +1368,11 @@ trait AcceptanceTesterActions
|
||||
*
|
||||
* Mixing string and boolean values for a checkbox's value is not supported
|
||||
* and may produce unexpected results.
|
||||
*
|
||||
* Field names ending in `[]` must be passed without the trailing square
|
||||
*
|
||||
* Field names ending in `[]` must be passed without the trailing square
|
||||
* bracket characters, and must contain an array for its value. This allows
|
||||
* submitting multiple values with the same name, consider:
|
||||
*
|
||||
*
|
||||
* ```php
|
||||
* <?php
|
||||
* // This will NOT work correctly
|
||||
@@ -1352,9 +1381,9 @@ trait AcceptanceTesterActions
|
||||
* 'field[]' => 'another value', // 'field[]' is already a defined key
|
||||
* ]);
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* The solution is to pass an array value:
|
||||
*
|
||||
*
|
||||
* ```php
|
||||
* <?php
|
||||
* // This way both values are submitted
|
||||
@@ -1365,7 +1394,7 @@ trait AcceptanceTesterActions
|
||||
* ]
|
||||
* ]);
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @param $selector
|
||||
* @param $params
|
||||
* @param $button
|
||||
@@ -1418,6 +1447,15 @@ trait AcceptanceTesterActions
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* Or provide an associative array for the second argument to specifically define which selection method should be used:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->selectOption('Which OS do you use?', array('text' => 'Windows')); // Only search by text 'Windows'
|
||||
* $I->selectOption('Which OS do you use?', array('value' => 'windows')); // Only search by value 'windows'
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $select
|
||||
* @param $option
|
||||
* @see \Codeception\Lib\InnerBrowser::selectOption()
|
||||
@@ -1468,7 +1506,7 @@ trait AcceptanceTesterActions
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Attaches a file relative to the Codeception data directory to the given file upload field.
|
||||
* Attaches a file relative to the Codeception `_data` directory to the given file upload field.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
@@ -1561,7 +1599,8 @@ trait AcceptanceTesterActions
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Finds and returns the text contents of the given element.
|
||||
* If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression.
|
||||
* 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
|
||||
@@ -1610,23 +1649,23 @@ trait AcceptanceTesterActions
|
||||
*
|
||||
* Grabs either the text content, or attribute values, of nodes
|
||||
* matched by $cssOrXpath and returns them as an array.
|
||||
*
|
||||
*
|
||||
* ```html
|
||||
* <a href="#first">First</a>
|
||||
* <a href="#second">Second</a>
|
||||
* <a href="#third">Third</a>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* ```php
|
||||
* <?php
|
||||
* // would return ['First', 'Second', 'Third']
|
||||
* $aLinkText = $I->grabMultiple('a');
|
||||
*
|
||||
*
|
||||
* // would return ['#first', '#second', '#third']
|
||||
* $aLinks = $I->grabMultiple('a', 'href');
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @param $cssOrXpath
|
||||
* @param $attribute
|
||||
* @return string[]
|
||||
@@ -1691,6 +1730,21 @@ trait AcceptanceTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Grabs current page source code.
|
||||
*
|
||||
* @throws ModuleException if no page was opened.
|
||||
*
|
||||
* @return string Current page source code.
|
||||
* @see \Codeception\Lib\InnerBrowser::grabPageSource()
|
||||
*/
|
||||
public function grabPageSource() {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabPageSource', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
@@ -1894,13 +1948,11 @@ trait AcceptanceTesterActions
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeNumberOfElements('tr', 10);
|
||||
* $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
|
||||
* $I->seeNumberOfElements('tr', [0,10]); // between 0 and 10 elements
|
||||
* ?>
|
||||
* ```
|
||||
* @param $selector
|
||||
* @param mixed $expected :
|
||||
* - string: strict number
|
||||
* - array: range of numbers [0,10]
|
||||
* @param mixed $expected int or int[]
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
|
||||
*/
|
||||
@@ -1915,13 +1967,11 @@ trait AcceptanceTesterActions
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeNumberOfElements('tr', 10);
|
||||
* $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
|
||||
* $I->seeNumberOfElements('tr', [0,10]); // between 0 and 10 elements
|
||||
* ?>
|
||||
* ```
|
||||
* @param $selector
|
||||
* @param mixed $expected :
|
||||
* - string: strict number
|
||||
* - array: range of numbers [0,10]
|
||||
* @param mixed $expected int or int[]
|
||||
* @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
|
||||
*/
|
||||
public function seeNumberOfElements($selector, $expected) {
|
||||
@@ -2041,9 +2091,15 @@ trait AcceptanceTesterActions
|
||||
*
|
||||
* Checks that response code is equal to value provided.
|
||||
*
|
||||
* @param $code
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->seeResponseCodeIs(200);
|
||||
*
|
||||
* @return mixed
|
||||
* // recommended \Codeception\Util\HttpCode
|
||||
* $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK);
|
||||
* ```
|
||||
*
|
||||
* @param $code
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
|
||||
*/
|
||||
@@ -2055,9 +2111,15 @@ trait AcceptanceTesterActions
|
||||
*
|
||||
* Checks that response code is equal to value provided.
|
||||
*
|
||||
* @param $code
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->seeResponseCodeIs(200);
|
||||
*
|
||||
* @return mixed
|
||||
* // recommended \Codeception\Util\HttpCode
|
||||
* $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK);
|
||||
* ```
|
||||
*
|
||||
* @param $code
|
||||
* @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
|
||||
*/
|
||||
public function seeResponseCodeIs($code) {
|
||||
@@ -2065,6 +2127,45 @@ trait AcceptanceTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that response code is equal to value provided.
|
||||
*
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->dontSeeResponseCodeIs(200);
|
||||
*
|
||||
* // recommended \Codeception\Util\HttpCode
|
||||
* $I->dontSeeResponseCodeIs(\Codeception\Util\HttpCode::OK);
|
||||
* ```
|
||||
* @param $code
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeResponseCodeIs()
|
||||
*/
|
||||
public function cantSeeResponseCodeIs($code) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseCodeIs', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that response code is equal to value provided.
|
||||
*
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->dontSeeResponseCodeIs(200);
|
||||
*
|
||||
* // recommended \Codeception\Util\HttpCode
|
||||
* $I->dontSeeResponseCodeIs(\Codeception\Util\HttpCode::OK);
|
||||
* ```
|
||||
* @param $code
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeResponseCodeIs()
|
||||
*/
|
||||
public function dontSeeResponseCodeIs($code) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeResponseCodeIs', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
@@ -2163,7 +2264,7 @@ trait AcceptanceTesterActions
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Moves back in history.
|
||||
*
|
||||
*
|
||||
* @param int $numberOfSteps (default value 1)
|
||||
* @see \Codeception\Lib\InnerBrowser::moveBack()
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user