PHP Class WebGuy

Inheritance: extends Codeception\Actor
Exibir arquivo Open project: jayhealey/webception Class Usage Examples

Public Methods

Method Description
amBearerAuthenticated ( $accessToken ) [!] Method is generated. Documentation taken from corresponding module.
amDigestAuthenticated ( $username, $password ) [!] Method is generated. Documentation taken from corresponding module.
amHttpAuthenticated ( $username, $password ) [!] Method is generated. Documentation taken from corresponding module.
amOnPage ( $page ) [!] Method is generated. Documentation taken from corresponding module.
amOnSubdomain ( $subdomain ) : mixed [!] Method is generated. Documentation taken from corresponding module.
amOnUrl ( $url ) [!] Method is generated. Documentation taken from corresponding module.
attachFile ( $field, $filename ) [!] Method is generated. Documentation taken from corresponding module.
canSee ( $text, null $selector = null ) [!] Method is generated. Documentation taken from corresponding module.
canSeeCheckboxIsChecked ( $checkbox ) [!] Method is generated. Documentation taken from corresponding module.
canSeeCookie ( $name ) : mixed [!] Method is generated. Documentation taken from corresponding module.
canSeeCurrentUrlEquals ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
canSeeCurrentUrlMatches ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
canSeeElement ( $selector, array $attributes = null ) [!] Method is generated. Documentation taken from corresponding module.
canSeeHttpHeader ( $name, $value = null ) [!] Method is generated. Documentation taken from corresponding module.
canSeeHttpHeaderOnce ( $name ) [!] Method is generated. Documentation taken from corresponding module.
canSeeInCurrentUrl ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
canSeeInField ( $field, $value ) [!] Method is generated. Documentation taken from corresponding module.
canSeeInTitle ( $title ) : mixed [!] Method is generated. Documentation taken from corresponding module.
canSeeLink ( $text, null $url = null ) [!] Method is generated. Documentation taken from corresponding module.
canSeeNumberOfElements ( $selector, $expected ) [!] Method is generated. Documentation taken from corresponding module.
canSeeOptionIsSelected ( $select, $optionText ) : mixed [!] Method is generated. Documentation taken from corresponding module.
canSeePageNotFound ( ) [!] Method is generated. Documentation taken from corresponding module.
canSeeResponseCodeIs ( $code ) [!] Method is generated. Documentation taken from corresponding module.
canSeeResponseContains ( $text ) [!] Method is generated. Documentation taken from corresponding module.
canSeeResponseContainsJson ( array $json = null ) [!] Method is generated. Documentation taken from corresponding module.
canSeeResponseEquals ( $response ) [!] Method is generated. Documentation taken from corresponding module.
canSeeResponseIsJson ( ) [!] Method is generated. Documentation taken from corresponding module.
canSeeResponseIsXml ( ) [!] Method is generated. Documentation taken from corresponding module.
canSeeResponseJsonMatchesJsonPath ( $jsonPath ) [!] Method is generated. Documentation taken from corresponding module.
canSeeResponseJsonMatchesXpath ( $xpath ) [!] Method is generated. Documentation taken from corresponding module.
cantSee ( $text, null $selector = null ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeCheckboxIsChecked ( $checkbox ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeCookie ( $name ) : mixed [!] Method is generated. Documentation taken from corresponding module.
cantSeeCurrentUrlEquals ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeCurrentUrlMatches ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeElement ( $selector, array $attributes = null ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeHttpHeader ( $name, $value = null ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeInCurrentUrl ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeInField ( $field, $value ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeInTitle ( $title ) : mixed [!] Method is generated. Documentation taken from corresponding module.
cantSeeLink ( $text, null $url = null ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeOptionIsSelected ( $select, $optionText ) : mixed [!] Method is generated. Documentation taken from corresponding module.
cantSeeResponseCodeIs ( $code ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeResponseContains ( $text ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeResponseContainsJson ( array $json = null ) [!] Method is generated. Documentation taken from corresponding module.
checkOption ( $option ) [!] Method is generated. Documentation taken from corresponding module.
click ( $link, $context = null ) [!] Method is generated. Documentation taken from corresponding module.
dontSee ( $text, null $selector = null ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeCheckboxIsChecked ( $checkbox ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeCookie ( $name ) : mixed [!] Method is generated. Documentation taken from corresponding module.
dontSeeCurrentUrlEquals ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeCurrentUrlMatches ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeElement ( $selector, array $attributes = null ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeHttpHeader ( $name, $value = null ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeInCurrentUrl ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeInField ( $field, $value ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeInTitle ( $title ) : mixed [!] Method is generated. Documentation taken from corresponding module.
dontSeeLink ( $text, null $url = null ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeOptionIsSelected ( $select, $optionText ) : mixed [!] Method is generated. Documentation taken from corresponding module.
dontSeeResponseCodeIs ( $code ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeResponseContains ( $text ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeResponseContainsJson ( array $json = null ) [!] Method is generated. Documentation taken from corresponding module.
executeInGuzzle ( callable $function ) [!] Method is generated. Documentation taken from corresponding module.
fillField ( $field, $value ) [!] Method is generated. Documentation taken from corresponding module.
grabAttributeFrom ( $cssOrXpath, $attribute ) : mixed [!] Method is generated. Documentation taken from corresponding module.
grabCookie ( $name ) : mixed [!] Method is generated. Documentation taken from corresponding module.
grabDataFromJsonResponse ( string $path = null ) : string [!] Method is generated. Documentation taken from corresponding module.
grabDataFromResponseByJsonPath ( $jsonPath ) : array [!] Method is generated. Documentation taken from corresponding module.
grabFromCurrentUrl ( null $uri = null ) : mixed [!] Method is generated. Documentation taken from corresponding module.
grabHttpHeader ( $name, boolean $first = null ) : string | array [!] Method is generated. Documentation taken from corresponding module.
grabResponse ( ) : string [!] Method is generated. Documentation taken from corresponding module.
grabTextFrom ( $cssOrXPathOrRegex ) : mixed [!] Method is generated. Documentation taken from corresponding module.
grabValueFrom ( $field ) : array | mixed | null | string [!] Method is generated. Documentation taken from corresponding module.
haveHttpHeader ( $name, $value ) [!] Method is generated. Documentation taken from corresponding module.
resetCookie ( $name ) : mixed [!] Method is generated. Documentation taken from corresponding module.
see ( $text, null $selector = null ) [!] Method is generated. Documentation taken from corresponding module.
seeCheckboxIsChecked ( $checkbox ) [!] Method is generated. Documentation taken from corresponding module.
seeCookie ( $name ) : mixed [!] Method is generated. Documentation taken from corresponding module.
seeCurrentUrlEquals ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
seeCurrentUrlMatches ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
seeElement ( $selector, array $attributes = null ) [!] Method is generated. Documentation taken from corresponding module.
seeHttpHeader ( $name, $value = null ) [!] Method is generated. Documentation taken from corresponding module.
seeHttpHeaderOnce ( $name ) [!] Method is generated. Documentation taken from corresponding module.
seeInCurrentUrl ( $uri ) [!] Method is generated. Documentation taken from corresponding module.
seeInField ( $field, $value ) [!] Method is generated. Documentation taken from corresponding module.
seeInTitle ( $title ) : mixed [!] Method is generated. Documentation taken from corresponding module.
seeLink ( $text, null $url = null ) [!] Method is generated. Documentation taken from corresponding module.
seeNumberOfElements ( $selector, $expected ) [!] Method is generated. Documentation taken from corresponding module.
seeOptionIsSelected ( $select, $optionText ) : mixed [!] Method is generated. Documentation taken from corresponding module.
seePageNotFound ( ) [!] Method is generated. Documentation taken from corresponding module.
seeResponseCodeIs ( $code ) [!] Method is generated. Documentation taken from corresponding module.
seeResponseContains ( $text ) [!] Method is generated. Documentation taken from corresponding module.
seeResponseContainsJson ( array $json = null ) [!] Method is generated. Documentation taken from corresponding module.
seeResponseEquals ( $response ) [!] Method is generated. Documentation taken from corresponding module.
seeResponseIsJson ( ) [!] Method is generated. Documentation taken from corresponding module.
seeResponseIsXml ( ) [!] Method is generated. Documentation taken from corresponding module.
seeResponseJsonMatchesJsonPath ( $jsonPath ) [!] Method is generated. Documentation taken from corresponding module.
seeResponseJsonMatchesXpath ( $xpath ) [!] Method is generated. Documentation taken from corresponding module.
selectOption ( $select, $option ) [!] Method is generated. Documentation taken from corresponding module.
sendAjaxGetRequest ( $uri, $params = null ) [!] Method is generated. Documentation taken from corresponding module.
sendAjaxPostRequest ( $uri, $params = null ) [!] Method is generated. Documentation taken from corresponding module.
sendAjaxRequest ( $method, $uri, $params = null ) [!] Method is generated. Documentation taken from corresponding module.
sendDELETE ( $url, array $params = null, array $files = null ) [!] Method is generated. Documentation taken from corresponding module.
sendGET ( $url, array $params = null ) [!] Method is generated. Documentation taken from corresponding module.
sendHEAD ( $url, array $params = null ) [!] Method is generated. Documentation taken from corresponding module.
sendLINK ( $url, array $linkEntries ) [!] Method is generated. Documentation taken from corresponding module.
sendOPTIONS ( $url, array $params = null ) [!] Method is generated. Documentation taken from corresponding module.
sendPATCH ( $url, array $params = null, array $files = null ) [!] Method is generated. Documentation taken from corresponding module.
sendPOST ( $url, array | JsonSerializable $params = null, array $files = null ) [!] Method is generated. Documentation taken from corresponding module.
sendPUT ( $url, array $params = null, array $files = null ) [!] Method is generated. Documentation taken from corresponding module.
sendUNLINK ( $url, array $linkEntries ) [!] Method is generated. Documentation taken from corresponding module.
setCookie ( $name, $val ) : mixed [!] Method is generated. Documentation taken from corresponding module.
setHeader ( $header, $value ) [!] Method is generated. Documentation taken from corresponding module.
submitForm ( $selector, $params, $button = null ) [!] Method is generated. Documentation taken from corresponding module.
uncheckOption ( $option ) [!] Method is generated. Documentation taken from corresponding module.

Method Details

amBearerAuthenticated() public method

Adds Bearer authentication via access token.
See also: Codeception\Module\REST::amBearerAuthenticated()
public amBearerAuthenticated ( $accessToken )
$accessToken

amDigestAuthenticated() public method

Adds Digest authentication via username/password.
See also: Codeception\Module\REST::amDigestAuthenticated()
public amDigestAuthenticated ( $username, $password )
$username
$password

amHttpAuthenticated() public method

Adds HTTP authentication via username/password.
See also: Codeception\Module\REST::amHttpAuthenticated()
public amHttpAuthenticated ( $username, $password )
$username
$password

amOnPage() public method

Opens the page for the given relative URI. php amOnPage('/'); opens /register page $I->amOnPage('/register'); ?>
See also: Codeception\Module\PhpBrowser::amOnPage()
public amOnPage ( $page )
$page

amOnSubdomain() public method

Changes the subdomain for the 'url' configuration parameter. Does not open a page; use amOnPage for that. php amOnSubdomain('user'); $I->amOnPage('/'); moves to http://user.mysite.com/ ?>
See also: Codeception\Module\PhpBrowser::amOnSubdomain()
public amOnSubdomain ( $subdomain ) : mixed
$subdomain
return mixed

amOnUrl() public method

Open web page at the given absolute URL and sets its hostname as the base host. php amOnUrl('http://codeception.com'); $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart ?>
See also: Codeception\Module\PhpBrowser::amOnUrl()
public amOnUrl ( $url )

attachFile() public method

Attaches a file relative to the Codeception data directory to the given file upload field. php attachFile('input[@type="file"]', 'prices.xls'); ?>
See also: Codeception\Lib\InnerBrowser::attachFile()
public attachFile ( $field, $filename )
$field
$filename

canSee() public method

Checks that the current page contains the given string. Specify a locator as the second parameter to match a specific region. php see('Logout'); // I can suppose user is logged in $I->see('Sign Up','h1'); // I can suppose it's a signup page $I->see('Sign Up','//body/h1'); // with XPath ?>
See also: Codeception\Lib\InnerBrowser::see()
public canSee ( $text, null $selector = null )
$text
$selector null Conditional Assertion: Test won't be stopped on fail

canSeeCheckboxIsChecked() public method

Checks that the specified checkbox is checked. php seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); ?>
See also: Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
public canSeeCheckboxIsChecked ( $checkbox )
$checkbox Conditional Assertion: Test won't be stopped on fail

canSeeCookie() public method

Checks that a cookie with the given name is set. php seeCookie('PHPSESSID'); ?>
See also: Codeception\Lib\InnerBrowser::seeCookie()
public canSeeCookie ( $name ) : mixed
return mixed Conditional Assertion: Test won't be stopped on fail

canSeeCurrentUrlEquals() public method

Checks that the current URL is equal to the given string. Unlike seeInCurrentUrl, this only matches the full URL. php seeCurrentUrlEquals('/'); ?>
See also: Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
public canSeeCurrentUrlEquals ( $uri )
$uri Conditional Assertion: Test won't be stopped on fail

canSeeCurrentUrlMatches() public method

Checks that the current URL matches the given regular expression. php seeCurrentUrlMatches('~$/users/(\d+)~'); ?>
See also: Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
public canSeeCurrentUrlMatches ( $uri )
$uri Conditional Assertion: Test won't be stopped on fail

canSeeElement() public method

Checks that the given element exists on the page and is visible. You can also specify expected attributes of this element. php seeElement('.error'); $I->seeElement('//form/input[1]'); $I->seeElement('input', ['name' => 'login']); $I->seeElement('input', ['value' => '123456']); strict locator in first arg, attributes in second $I->seeElement(['css' => 'form input'], ['name' => 'login']); ?>
See also: Codeception\Lib\InnerBrowser::seeElement()
public canSeeElement ( $selector, array $attributes = null )
$selector
$attributes array

canSeeHttpHeader() public method

Checks over the given HTTP header and (optionally) its value, asserting that are there
See also: Codeception\Module\REST::seeHttpHeader()
public canSeeHttpHeader ( $name, $value = null )
$name
$value Conditional Assertion: Test won't be stopped on fail

canSeeHttpHeaderOnce() public method

Checks that http response header is received only once. HTTP RFC2616 allows multiple response headers with the same name. You can check that you didn't accidentally sent the same header twice. php seeHttpHeaderOnce('Cache-Control'); ?>>
See also: Codeception\Module\REST::seeHttpHeaderOnce()
public canSeeHttpHeaderOnce ( $name )
$name Conditional Assertion: Test won't be stopped on fail

canSeeInCurrentUrl() public method

Checks that current URI contains the given string. php seeInCurrentUrl('home'); to match: /users/1 $I->seeInCurrentUrl('/users/'); ?>
See also: Codeception\Lib\InnerBrowser::seeInCurrentUrl()
public canSeeInCurrentUrl ( $uri )
$uri Conditional Assertion: Test won't be stopped on fail

canSeeInField() public method

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. php seeInField('Body','Type your comment here'); $I->seeInField('form textarea[name=body]','Type your comment here'); $I->seeInField('form input[type=hidden]','hidden_value'); $I->seeInField('#searchform input','Search'); $I->seeInField('//form/*[@name=search]','Search'); $I->seeInField(['name' => 'search'], 'Search'); ?>
See also: Codeception\Lib\InnerBrowser::seeInField()
public canSeeInField ( $field, $value )
$field
$value Conditional Assertion: Test won't be stopped on fail

canSeeInTitle() public method

Checks that the page title contains the given string. php seeInTitle('Blog - Post #1'); ?>
See also: Codeception\Lib\InnerBrowser::seeInTitle()
public canSeeInTitle ( $title ) : mixed
$title
return mixed Conditional Assertion: Test won't be stopped on fail

canSeeNumberOfElements() public method

Checks that there are a certain number of elements matched by the given locator on the page. php seeNumberOfElements('tr', 10); $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements ?>
See also: Codeception\Lib\InnerBrowser::seeNumberOfElements()
public canSeeNumberOfElements ( $selector, $expected )
$selector

canSeeOptionIsSelected() public method

Checks that the given option is selected. php seeOptionIsSelected('#form input[name=payment]', 'Visa'); ?>
See also: Codeception\Lib\InnerBrowser::seeOptionIsSelected()
public canSeeOptionIsSelected ( $select, $optionText ) : mixed
$optionText
return mixed Conditional Assertion: Test won't be stopped on fail

canSeePageNotFound() public method

Asserts that current page has 404 response status code. Conditional Assertion: Test won't be stopped on fail
See also: Codeception\Lib\InnerBrowser::seePageNotFound()
public canSeePageNotFound ( )

canSeeResponseCodeIs() public method

Checks response code equals to provided value.
See also: Codeception\Module\REST::seeResponseCodeIs()
public canSeeResponseCodeIs ( $code )
$code Conditional Assertion: Test won't be stopped on fail

canSeeResponseContains() public method

Checks whether the last response contains text.
See also: Codeception\Module\REST::seeResponseContains()
public canSeeResponseContains ( $text )
$text Conditional Assertion: Test won't be stopped on fail

canSeeResponseContainsJson() public method

Checks whether the last JSON response contains provided array. The response is converted to array with json_decode($response, true) Thus, JSON is represented by associative array. This method matches that response array contains provided array. Examples: php seeResponseContainsJson(array('name' => 'john')); response {user: john, profile: { email: [email protected] }} $I->seeResponseContainsJson(array('email' => '[email protected]')); ?> This method recursively checks if one array can be found inside of another.
See also: Codeception\Module\REST::seeResponseContainsJson()
public canSeeResponseContainsJson ( array $json = null )
$json array Conditional Assertion: Test won't be stopped on fail

canSeeResponseEquals() public method

Checks if response is exactly the same as provided.
See also: Codeception\Module\REST::seeResponseEquals()
public canSeeResponseEquals ( $response )
$response Conditional Assertion: Test won't be stopped on fail

canSeeResponseIsJson() public method

Checks whether last response was valid JSON. This is done with json_last_error function. Conditional Assertion: Test won't be stopped on fail
See also: Codeception\Module\REST::seeResponseIsJson()

canSeeResponseIsXml() public method

Checks whether last response was valid XML. This is done with libxml_get_last_error function. Conditional Assertion: Test won't be stopped on fail
See also: Codeception\Module\REST::seeResponseIsXml()
public canSeeResponseIsXml ( )

canSeeResponseJsonMatchesJsonPath() public method

Checks if json structure in response matches JsonPath. JsonPath is XPath equivalent for querying Json structures. Try your JsonPath expressions online. This assertion allows you to check the structure of response json. This method **require flow/jsonpath library to be installed**. json { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 } ], "bicycle": { "color": "red", "price": 19.95 } } } php seeResponseJsonMatchesJsonPath('$.store.book[*].author'); first book in store has author $I->seeResponseJsonMatchesJsonPath('$.store.book[0].author'); at least one item in store has price $I->seeResponseJsonMatchesJsonPath('$.store..price'); ?>
See also: Codeception\Module\REST::seeResponseJsonMatchesJsonPath()
public canSeeResponseJsonMatchesJsonPath ( $jsonPath )

canSeeResponseJsonMatchesXpath() public method

Checks if json structure in response matches the xpath provided. JSON is not supposed to be checked against XPath, yet it can be converted to xml and used with XPath. This assertion allows you to check the structure of response json. * json json { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 } ], "bicycle": { "color": "red", "price": 19.95 } } } php seeResponseJsonMatchesXpath('//store/book/author'); first book in store has author $I->seeResponseJsonMatchesXpath('//store/book[1]/author'); at least one item in store has price $I->seeResponseJsonMatchesXpath('/store//price'); ?> ```
See also: Codeception\Module\REST::seeResponseJsonMatchesXpath()
public canSeeResponseJsonMatchesXpath ( $xpath )

cantSee() public method

Checks that the current page doesn't contain the text specified. Give a locator as the second parameter to match a specific region. php dontSee('Login'); // I can suppose user is already logged in $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page $I->dontSee('Sign Up','//body/h1'); // with XPath ?>
See also: Codeception\Lib\InnerBrowser::dontSee()
public cantSee ( $text, null $selector = null )
$text
$selector null Conditional Assertion: Test won't be stopped on fail

cantSeeCheckboxIsChecked() public method

Check that the specified checkbox is unchecked. php dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. ?>
See also: Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
public cantSeeCheckboxIsChecked ( $checkbox )
$checkbox Conditional Assertion: Test won't be stopped on fail

cantSeeCookie() public method

Checks that there isn't a cookie with the given name.
See also: Codeception\Lib\InnerBrowser::dontSeeCookie()
public cantSeeCookie ( $name ) : mixed
return mixed Conditional Assertion: Test won't be stopped on fail

cantSeeCurrentUrlEquals() public method

Checks that the current URL doesn't equal the given string. Unlike dontSeeInCurrentUrl, this only matches the full URL. php dontSeeCurrentUrlEquals('/'); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
public cantSeeCurrentUrlEquals ( $uri )
$uri Conditional Assertion: Test won't be stopped on fail

cantSeeCurrentUrlMatches() public method

Checks that current url doesn't match the given regular expression. php dontSeeCurrentUrlMatches('~$/users/(\d+)~'); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
public cantSeeCurrentUrlMatches ( $uri )
$uri Conditional Assertion: Test won't be stopped on fail

cantSeeElement() public method

Checks that the given element is invisible or not present on the page. You can also specify expected attributes of this element. php dontSeeElement('.error'); $I->dontSeeElement('//form/input[1]'); $I->dontSeeElement('input', ['name' => 'login']); $I->dontSeeElement('input', ['value' => '123456']); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeElement()
public cantSeeElement ( $selector, array $attributes = null )
$selector
$attributes array Conditional Assertion: Test won't be stopped on fail

cantSeeHttpHeader() public method

Checks over the given HTTP header and (optionally) its value, asserting that are not there
See also: Codeception\Module\REST::dontSeeHttpHeader()
public cantSeeHttpHeader ( $name, $value = null )
$name
$value Conditional Assertion: Test won't be stopped on fail

cantSeeInCurrentUrl() public method

Checks that the current URI doesn't contain the given string. php dontSeeInCurrentUrl('/users/'); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
public cantSeeInCurrentUrl ( $uri )
$uri Conditional Assertion: Test won't be stopped on fail

cantSeeInField() public method

Checks that an input field or textarea doesn't contain the given value. For fuzzy locators, the field is matched by label text, CSS and XPath. php dontSeeInField('Body','Type your comment here'); $I->dontSeeInField('form textarea[name=body]','Type your comment here'); $I->dontSeeInField('form input[type=hidden]','hidden_value'); $I->dontSeeInField('#searchform input','Search'); $I->dontSeeInField('//form/*[@name=search]','Search'); $I->dontSeeInField(['name' => 'search'], 'Search'); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeInField()
public cantSeeInField ( $field, $value )
$field
$value Conditional Assertion: Test won't be stopped on fail

cantSeeInTitle() public method

Checks that the page title does not contain the given string.
See also: Codeception\Lib\InnerBrowser::dontSeeInTitle()
public cantSeeInTitle ( $title ) : mixed
$title
return mixed Conditional Assertion: Test won't be stopped on fail

cantSeeOptionIsSelected() public method

Checks that the given option is not selected. php dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
public cantSeeOptionIsSelected ( $select, $optionText ) : mixed
$optionText
return mixed Conditional Assertion: Test won't be stopped on fail

cantSeeResponseCodeIs() public method

Checks that response code is not equal to provided value.
See also: Codeception\Module\REST::dontSeeResponseCodeIs()
public cantSeeResponseCodeIs ( $code )
$code Conditional Assertion: Test won't be stopped on fail

cantSeeResponseContains() public method

Checks whether last response do not contain text.
See also: Codeception\Module\REST::dontSeeResponseContains()
public cantSeeResponseContains ( $text )
$text Conditional Assertion: Test won't be stopped on fail

cantSeeResponseContainsJson() public method

Opposite to seeResponseContainsJson
See also: Codeception\Module\REST::dontSeeResponseContainsJson()
public cantSeeResponseContainsJson ( array $json = null )
$json array Conditional Assertion: Test won't be stopped on fail

checkOption() public method

Ticks a checkbox. For radio buttons, use the selectOption method instead. php checkOption('#agree'); ?>
See also: Codeception\Lib\InnerBrowser::checkOption()
public checkOption ( $option )
$option

click() public method

Perform a click on a link or a button, given by a locator. If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched. For images, the "alt" attribute and inner text of any parent links are searched. The second parameter is a context (CSS or XPath locator) to narrow the search. Note that if the locator matches a button of type submit, the form will be submitted. php click('Logout'); button of form $I->click('Submit'); CSS button $I->click('#form input[type=submit]'); XPath $I->click('//form/*[@type=submit]'); link in context $I->click('Logout', '#nav'); using strict locator $I->click(['link' => 'Login']); ?>
See also: Codeception\Lib\InnerBrowser::click()
public click ( $link, $context = null )
$link
$context

dontSee() public method

Checks that the current page doesn't contain the text specified. Give a locator as the second parameter to match a specific region. php dontSee('Login'); // I can suppose user is already logged in $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page $I->dontSee('Sign Up','//body/h1'); // with XPath ?>
See also: Codeception\Lib\InnerBrowser::dontSee()
public dontSee ( $text, null $selector = null )
$text
$selector null

dontSeeCheckboxIsChecked() public method

Check that the specified checkbox is unchecked. php dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. ?>
See also: Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
public dontSeeCheckboxIsChecked ( $checkbox )
$checkbox

dontSeeCookie() public method

Checks that there isn't a cookie with the given name.
See also: Codeception\Lib\InnerBrowser::dontSeeCookie()
public dontSeeCookie ( $name ) : mixed
return mixed

dontSeeCurrentUrlEquals() public method

Checks that the current URL doesn't equal the given string. Unlike dontSeeInCurrentUrl, this only matches the full URL. php dontSeeCurrentUrlEquals('/'); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
public dontSeeCurrentUrlEquals ( $uri )
$uri

dontSeeCurrentUrlMatches() public method

Checks that current url doesn't match the given regular expression. php dontSeeCurrentUrlMatches('~$/users/(\d+)~'); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
public dontSeeCurrentUrlMatches ( $uri )
$uri

dontSeeElement() public method

Checks that the given element is invisible or not present on the page. You can also specify expected attributes of this element. php dontSeeElement('.error'); $I->dontSeeElement('//form/input[1]'); $I->dontSeeElement('input', ['name' => 'login']); $I->dontSeeElement('input', ['value' => '123456']); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeElement()
public dontSeeElement ( $selector, array $attributes = null )
$selector
$attributes array

dontSeeHttpHeader() public method

Checks over the given HTTP header and (optionally) its value, asserting that are not there
See also: Codeception\Module\REST::dontSeeHttpHeader()
public dontSeeHttpHeader ( $name, $value = null )
$name
$value

dontSeeInCurrentUrl() public method

Checks that the current URI doesn't contain the given string. php dontSeeInCurrentUrl('/users/'); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
public dontSeeInCurrentUrl ( $uri )
$uri

dontSeeInField() public method

Checks that an input field or textarea doesn't contain the given value. For fuzzy locators, the field is matched by label text, CSS and XPath. php dontSeeInField('Body','Type your comment here'); $I->dontSeeInField('form textarea[name=body]','Type your comment here'); $I->dontSeeInField('form input[type=hidden]','hidden_value'); $I->dontSeeInField('#searchform input','Search'); $I->dontSeeInField('//form/*[@name=search]','Search'); $I->dontSeeInField(['name' => 'search'], 'Search'); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeInField()
public dontSeeInField ( $field, $value )
$field
$value

dontSeeInTitle() public method

Checks that the page title does not contain the given string.
See also: Codeception\Lib\InnerBrowser::dontSeeInTitle()
public dontSeeInTitle ( $title ) : mixed
$title
return mixed

dontSeeOptionIsSelected() public method

Checks that the given option is not selected. php dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); ?>
See also: Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
public dontSeeOptionIsSelected ( $select, $optionText ) : mixed
$optionText
return mixed

dontSeeResponseCodeIs() public method

Checks that response code is not equal to provided value.
See also: Codeception\Module\REST::dontSeeResponseCodeIs()
public dontSeeResponseCodeIs ( $code )
$code

dontSeeResponseContains() public method

Checks whether last response do not contain text.
See also: Codeception\Module\REST::dontSeeResponseContains()
public dontSeeResponseContains ( $text )
$text

dontSeeResponseContainsJson() public method

Opposite to seeResponseContainsJson
See also: Codeception\Module\REST::dontSeeResponseContainsJson()
public dontSeeResponseContainsJson ( array $json = null )
$json array

executeInGuzzle() public method

Low-level API method. If Codeception commands are not enough, use Guzzle HTTP Client methods directly Example: php executeInGuzzle(function (\GuzzleHttp\Client $client) { $client->get('/get', ['query' => ['foo' => 'bar']]); }); ?> It is not recommended to use this command on a regular basis. If Codeception lacks important Guzzle Client methods, implement them and submit patches.
See also: Codeception\Module\PhpBrowser::executeInGuzzle()
public executeInGuzzle ( callable $function )
$function callable

fillField() public method

Fills a text field or textarea with the given string. php fillField("//input[@type='text']", "Hello World!"); $I->fillField(['name' => 'email'], '[email protected]'); ?>
See also: Codeception\Lib\InnerBrowser::fillField()
public fillField ( $field, $value )
$field
$value

grabAttributeFrom() public method

Grabs the value of the given attribute value from the given element. Fails if element is not found. php grabAttributeFrom('#tooltip', 'title'); ?>
See also: Codeception\Lib\InnerBrowser::grabAttributeFrom()
public grabAttributeFrom ( $cssOrXpath, $attribute ) : mixed
$cssOrXpath
$attribute
return mixed

grabCookie() public method

Grabs a cookie value.
See also: Codeception\Lib\InnerBrowser::grabCookie()
public grabCookie ( $name ) : mixed
return mixed

grabDataFromJsonResponse() public method

Returns data from the current JSON response using specified path so that it can be used in next scenario steps. **this method is deprecated in favor of grabDataFromResponseByJsonPath** Example: php grabDataFromJsonResponse('user.user_id'); $I->sendPUT('/user', array('id' => $user_id, 'name' => 'davert')); ?>
See also: Codeception\Module\REST::grabDataFromJsonResponse()
Deprecation: please use `grabDataFromResponseByJsonPath`
public grabDataFromJsonResponse ( string $path = null ) : string
$path string
return string

grabDataFromResponseByJsonPath() public method

Returns data from the current JSON response using JSONPath as selector. JsonPath is XPath equivalent for querying Json structures. Try your JsonPath expressions online. Even for a single value an array is returned. This method **require flow/jsonpath library to be installed**. Example: php user.id in json $firstUser = $I->grabDataFromJsonResponse('$..users[0].id'); $I->sendPUT('/user', array('id' => $firstUser[0], 'name' => 'davert')); ?>
See also: Codeception\Module\REST::grabDataFromResponseByJsonPath()
public grabDataFromResponseByJsonPath ( $jsonPath ) : array
$jsonPath
return array

grabFromCurrentUrl() public method

Executes the given regular expression against the current URI and returns the first match. If no parameters are provided, the full URI is returned. php grabFromCurrentUrl('~$/user/(\d+)/~'); $uri = $I->grabFromCurrentUrl(); ?>
See also: Codeception\Lib\InnerBrowser::grabFromCurrentUrl()
public grabFromCurrentUrl ( null $uri = null ) : mixed
$uri null
return mixed

grabHttpHeader() public method

Returns the value of the specified header name
See also: Codeception\Module\REST::grabHttpHeader()
public grabHttpHeader ( $name, boolean $first = null ) : string | array
$name
$first boolean Whether to return the first value or all header values
return string | array The first header value if $first is true, an array of values otherwise

grabResponse() public method

Returns current response so that it can be used in next scenario steps. Example: php grabResponse(); $I->sendPUT('/user', array('id' => $user_id, 'name' => 'davert')); ?>
See also: Codeception\Module\REST::grabResponse()
public grabResponse ( ) : string
return string

grabTextFrom() public method

Finds and returns the text contents of the given element. If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression. php grabTextFrom('h1'); $heading = $I->grabTextFrom('descendant-or-self::h1'); $value = $I->grabTextFrom('~
See also: Codeception\Lib\InnerBrowser::grabTextFrom()
public grabTextFrom ( $cssOrXPathOrRegex ) : mixed
$cssOrXPathOrRegex
return mixed

grabValueFrom() public method

[!] Method is generated. Documentation taken from corresponding module.
See also: Codeception\Lib\InnerBrowser::grabValueFrom()
public grabValueFrom ( $field ) : array | mixed | null | string
$field
return array | mixed | null | string

haveHttpHeader() public method

Sets HTTP header
See also: Codeception\Module\REST::haveHttpHeader()
public haveHttpHeader ( $name, $value )
$name
$value

resetCookie() public method

Unsets cookie with the given name.
See also: Codeception\Lib\InnerBrowser::resetCookie()
public resetCookie ( $name ) : mixed
return mixed

see() public method

Checks that the current page contains the given string. Specify a locator as the second parameter to match a specific region. php see('Logout'); // I can suppose user is logged in $I->see('Sign Up','h1'); // I can suppose it's a signup page $I->see('Sign Up','//body/h1'); // with XPath ?>
See also: Codeception\Lib\InnerBrowser::see()
public see ( $text, null $selector = null )
$text
$selector null

seeCheckboxIsChecked() public method

Checks that the specified checkbox is checked. php seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); ?>
See also: Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
public seeCheckboxIsChecked ( $checkbox )
$checkbox

seeCookie() public method

Checks that a cookie with the given name is set. php seeCookie('PHPSESSID'); ?>
See also: Codeception\Lib\InnerBrowser::seeCookie()
public seeCookie ( $name ) : mixed
return mixed

seeCurrentUrlEquals() public method

Checks that the current URL is equal to the given string. Unlike seeInCurrentUrl, this only matches the full URL. php seeCurrentUrlEquals('/'); ?>
See also: Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
public seeCurrentUrlEquals ( $uri )
$uri

seeCurrentUrlMatches() public method

Checks that the current URL matches the given regular expression. php seeCurrentUrlMatches('~$/users/(\d+)~'); ?>
See also: Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
public seeCurrentUrlMatches ( $uri )
$uri

seeElement() public method

Checks that the given element exists on the page and is visible. You can also specify expected attributes of this element. php seeElement('.error'); $I->seeElement('//form/input[1]'); $I->seeElement('input', ['name' => 'login']); $I->seeElement('input', ['value' => '123456']); strict locator in first arg, attributes in second $I->seeElement(['css' => 'form input'], ['name' => 'login']); ?>
See also: Codeception\Lib\InnerBrowser::seeElement()
public seeElement ( $selector, array $attributes = null )
$selector
$attributes array

seeHttpHeader() public method

Checks over the given HTTP header and (optionally) its value, asserting that are there
See also: Codeception\Module\REST::seeHttpHeader()
public seeHttpHeader ( $name, $value = null )
$name
$value

seeHttpHeaderOnce() public method

Checks that http response header is received only once. HTTP RFC2616 allows multiple response headers with the same name. You can check that you didn't accidentally sent the same header twice. php seeHttpHeaderOnce('Cache-Control'); ?>>
See also: Codeception\Module\REST::seeHttpHeaderOnce()
public seeHttpHeaderOnce ( $name )
$name

seeInCurrentUrl() public method

Checks that current URI contains the given string. php seeInCurrentUrl('home'); to match: /users/1 $I->seeInCurrentUrl('/users/'); ?>
See also: Codeception\Lib\InnerBrowser::seeInCurrentUrl()
public seeInCurrentUrl ( $uri )
$uri

seeInField() public method

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. php seeInField('Body','Type your comment here'); $I->seeInField('form textarea[name=body]','Type your comment here'); $I->seeInField('form input[type=hidden]','hidden_value'); $I->seeInField('#searchform input','Search'); $I->seeInField('//form/*[@name=search]','Search'); $I->seeInField(['name' => 'search'], 'Search'); ?>
See also: Codeception\Lib\InnerBrowser::seeInField()
public seeInField ( $field, $value )
$field
$value

seeInTitle() public method

Checks that the page title contains the given string. php seeInTitle('Blog - Post #1'); ?>
See also: Codeception\Lib\InnerBrowser::seeInTitle()
public seeInTitle ( $title ) : mixed
$title
return mixed

seeNumberOfElements() public method

Checks that there are a certain number of elements matched by the given locator on the page. php seeNumberOfElements('tr', 10); $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements ?>
See also: Codeception\Lib\InnerBrowser::seeNumberOfElements()
public seeNumberOfElements ( $selector, $expected )
$selector

seeOptionIsSelected() public method

Checks that the given option is selected. php seeOptionIsSelected('#form input[name=payment]', 'Visa'); ?>
See also: Codeception\Lib\InnerBrowser::seeOptionIsSelected()
public seeOptionIsSelected ( $select, $optionText ) : mixed
$optionText
return mixed

seePageNotFound() public method

Asserts that current page has 404 response status code.
See also: Codeception\Lib\InnerBrowser::seePageNotFound()
public seePageNotFound ( )

seeResponseCodeIs() public method

Checks response code equals to provided value.
See also: Codeception\Module\REST::seeResponseCodeIs()
public seeResponseCodeIs ( $code )
$code

seeResponseContains() public method

Checks whether the last response contains text.
See also: Codeception\Module\REST::seeResponseContains()
public seeResponseContains ( $text )
$text

seeResponseContainsJson() public method

Checks whether the last JSON response contains provided array. The response is converted to array with json_decode($response, true) Thus, JSON is represented by associative array. This method matches that response array contains provided array. Examples: php seeResponseContainsJson(array('name' => 'john')); response {user: john, profile: { email: [email protected] }} $I->seeResponseContainsJson(array('email' => '[email protected]')); ?> This method recursively checks if one array can be found inside of another.
See also: Codeception\Module\REST::seeResponseContainsJson()
public seeResponseContainsJson ( array $json = null )
$json array

seeResponseEquals() public method

Checks if response is exactly the same as provided.
See also: Codeception\Module\REST::seeResponseEquals()
public seeResponseEquals ( $response )
$response

seeResponseIsJson() public method

Checks whether last response was valid JSON. This is done with json_last_error function.
See also: Codeception\Module\REST::seeResponseIsJson()
public seeResponseIsJson ( )

seeResponseIsXml() public method

Checks whether last response was valid XML. This is done with libxml_get_last_error function.
See also: Codeception\Module\REST::seeResponseIsXml()
public seeResponseIsXml ( )

seeResponseJsonMatchesJsonPath() public method

Checks if json structure in response matches JsonPath. JsonPath is XPath equivalent for querying Json structures. Try your JsonPath expressions online. This assertion allows you to check the structure of response json. This method **require flow/jsonpath library to be installed**. json { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 } ], "bicycle": { "color": "red", "price": 19.95 } } } php seeResponseJsonMatchesJsonPath('$.store.book[*].author'); first book in store has author $I->seeResponseJsonMatchesJsonPath('$.store.book[0].author'); at least one item in store has price $I->seeResponseJsonMatchesJsonPath('$.store..price'); ?>
See also: Codeception\Module\REST::seeResponseJsonMatchesJsonPath()
public seeResponseJsonMatchesJsonPath ( $jsonPath )

seeResponseJsonMatchesXpath() public method

Checks if json structure in response matches the xpath provided. JSON is not supposed to be checked against XPath, yet it can be converted to xml and used with XPath. This assertion allows you to check the structure of response json. * json json { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 } ], "bicycle": { "color": "red", "price": 19.95 } } } php seeResponseJsonMatchesXpath('//store/book/author'); first book in store has author $I->seeResponseJsonMatchesXpath('//store/book[1]/author'); at least one item in store has price $I->seeResponseJsonMatchesXpath('/store//price'); ?> ```
See also: Codeception\Module\REST::seeResponseJsonMatchesXpath()
public seeResponseJsonMatchesXpath ( $xpath )

selectOption() public method

Selects an option in a select tag or in radio button group. php selectOption('form select[name=account]', 'Premium'); $I->selectOption('form input[name=payment]', 'Monthly'); $I->selectOption('//form/select[@name=account]', 'Monthly'); ?> Provide an array for the second argument to select multiple options: php selectOption('Which OS do you use?', array('Windows','Linux')); ?>
See also: Codeception\Lib\InnerBrowser::selectOption()
public selectOption ( $select, $option )
$select
$option

sendAjaxGetRequest() public method

If your page triggers an ajax request, you can perform it manually. This action sends a GET ajax request with specified params. See ->sendAjaxPostRequest for examples.
See also: Codeception\Lib\InnerBrowser::sendAjaxGetRequest()
public sendAjaxGetRequest ( $uri, $params = null )
$uri
$params

sendAjaxPostRequest() public method

If your page triggers an ajax request, you can perform it manually. This action sends a POST ajax request with specified params. Additional params can be passed as array. Example: Imagine that by clicking checkbox you trigger ajax request which updates user settings. We emulate that click by running this ajax request manually. php sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET
See also: Codeception\Lib\InnerBrowser::sendAjaxPostRequest()
public sendAjaxPostRequest ( $uri, $params = null )
$uri
$params

sendAjaxRequest() public method

If your page triggers an ajax request, you can perform it manually. This action sends an ajax request with specified method and params. Example: You need to perform an ajax request specifying the HTTP method. php sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title'));
See also: Codeception\Lib\InnerBrowser::sendAjaxRequest()
public sendAjaxRequest ( $method, $uri, $params = null )
$method
$uri
$params

sendDELETE() public method

Sends DELETE request to given uri.
See also: Codeception\Module\REST::sendDELETE()
public sendDELETE ( $url, array $params = null, array $files = null )
$url
$params array
$files array

sendGET() public method

Sends a GET request to given uri.
See also: Codeception\Module\REST::sendGET()
public sendGET ( $url, array $params = null )
$url
$params array

sendHEAD() public method

Sends a HEAD request to given uri.
See also: Codeception\Module\REST::sendHEAD()
public sendHEAD ( $url, array $params = null )
$url
$params array

sendOPTIONS() public method

Sends an OPTIONS request to given uri.
See also: Codeception\Module\REST::sendOPTIONS()
public sendOPTIONS ( $url, array $params = null )
$url
$params array

sendPATCH() public method

Sends PATCH request to given uri.
See also: Codeception\Module\REST::sendPATCH()
public sendPATCH ( $url, array $params = null, array $files = null )
$url
$params array
$files array

sendPOST() public method

Sends a POST request to given uri. Parameters and files (as array of filenames) can be provided.
See also: Codeception\Module\REST::sendPOST()
public sendPOST ( $url, array | JsonSerializable $params = null, array $files = null )
$url
$params array | JsonSerializable
$files array

sendPUT() public method

Sends PUT request to given uri.
See also: Codeception\Module\REST::sendPUT()
public sendPUT ( $url, array $params = null, array $files = null )
$url
$params array
$files array

setCookie() public method

Sets a cookie with the given name and value. php setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); ?>
See also: Codeception\Lib\InnerBrowser::setCookie()
public setCookie ( $name, $val ) : mixed
return mixed

setHeader() public method

[!] Method is generated. Documentation taken from corresponding module.
See also: Codeception\Module\PhpBrowser::setHeader()
public setHeader ( $header, $value )

submitForm() public method

Submits the given form on the page, optionally with the given form values. Give the form fields values as an array. Skipped fields will be filled by their values from the page. You don't need to click the 'Submit' button afterwards. This command itself triggers the request to form's action. You can optionally specify what button's value to include in the request with the last parameter as an alternative to explicitly setting its value in the second parameter, as button values are not otherwise included in the request. Examples: php submitForm('#login', array('login' => 'davert', 'password' => '123456')); or $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'), 'submitButtonName'); For example, given this sample "Sign Up" form: html
Login:
Password:
Do you agree to out terms?
Select pricing plan
You could write the following to submit it: php submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)), 'submitButton'); Note that "2" will be the submitted value for the "plan" field, as it is the selected option. You can also emulate a JavaScript submission by not specifying any buttons in the third parameter to submitForm. php submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)));
See also: Codeception\Lib\InnerBrowser::submitForm()
public submitForm ( $selector, $params, $button = null )
$selector
$params
$button

uncheckOption() public method

Unticks a checkbox. php uncheckOption('#notify'); ?>
See also: Codeception\Lib\InnerBrowser::uncheckOption()
public uncheckOption ( $option )
$option