PHP Трейт _generated\FunctionalTesterActions

Показать файл Открыть проект

Открытые методы

Метод Описание
amHttpAuthenticated ( $username, $password ) [!] Method is generated. Documentation taken from corresponding module.
amInPath ( $path ) [!] Method is generated. Documentation taken from corresponding module.
amOnPage ( $page ) [!] 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 ( $cookie, array $params = null ) : 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.
canSeeFileContentsEqual ( $text ) [!] Method is generated. Documentation taken from corresponding module.
canSeeFileFound ( $filename, string $path = null ) [!] 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.
canSeeInFormFields ( $formSelector, $params ) [!] Method is generated. Documentation taken from corresponding module.
canSeeInSource ( $raw ) [!] Method is generated. Documentation taken from corresponding module.
canSeeInThisFile ( $text ) [!] 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.
canSeeNumberNewLines ( integer $number ) [!] Method is generated. Documentation taken from corresponding module.
canSeeNumberOfElements ( $selector, mixed $expected ) [!] Method is generated. Documentation taken from corresponding module.
canSeeOptionIsSelected ( $selector, $optionText ) : mixed [!] Method is generated. Documentation taken from corresponding module.
canSeePageNotFound ( ) [!] Method is generated. Documentation taken from corresponding module.
canSeeRecord ( $model, array $attributes = null ) [!] Method is generated. Documentation taken from corresponding module.
canSeeResponseCodeIs ( $code ) : mixed [!] Method is generated. Documentation taken from corresponding module.
canSeeThisFileMatches ( $regex ) [!] 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 ( $cookie, array $params = null ) : 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.
cantSeeFileFound ( $filename, string $path = 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.
cantSeeInFormFields ( $formSelector, $params ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeInSource ( $raw ) [!] Method is generated. Documentation taken from corresponding module.
cantSeeInThisFile ( $text ) [!] 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 ( $selector, $optionText ) : mixed [!] Method is generated. Documentation taken from corresponding module.
cantSeeRecord ( $model, array $attributes = null ) [!] Method is generated. Documentation taken from corresponding module.
checkOption ( $option ) [!] Method is generated. Documentation taken from corresponding module.
cleanDir ( $dirname ) [!] Method is generated. Documentation taken from corresponding module.
click ( $link, $context = null ) [!] Method is generated. Documentation taken from corresponding module.
copyDir ( $src, $dst ) [!] Method is generated. Documentation taken from corresponding module.
deleteDir ( $dirname ) [!] Method is generated. Documentation taken from corresponding module.
deleteFile ( $filename ) [!] Method is generated. Documentation taken from corresponding module.
deleteHeader ( string $name ) [!] Method is generated. Documentation taken from corresponding module.
deleteThisFile ( ) [!] 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 ( $cookie, array $params = null ) : 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.
dontSeeFileFound ( $filename, string $path = 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.
dontSeeInFormFields ( $formSelector, $params ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeInSource ( $raw ) [!] Method is generated. Documentation taken from corresponding module.
dontSeeInThisFile ( $text ) [!] 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 ( $selector, $optionText ) : mixed [!] Method is generated. Documentation taken from corresponding module.
dontSeeRecord ( $model, array $attributes = null ) [!] Method is generated. Documentation taken from corresponding module.
fillField ( $field, $value ) [!] Method is generated. Documentation taken from corresponding module.
getInternalDomains ( ) : array [!] Method is generated. Documentation taken from corresponding module.
grabAttributeFrom ( $cssOrXpath, $attribute ) : mixed [!] Method is generated. Documentation taken from corresponding module.
grabCookie ( $cookie, array $params = null ) : mixed [!] Method is generated. Documentation taken from corresponding module.
grabFromCurrentUrl ( null $uri = null ) : mixed [!] Method is generated. Documentation taken from corresponding module.
grabMultiple ( $cssOrXpath, $attribute = null ) : string[] [!] Method is generated. Documentation taken from corresponding module.
grabRecord ( $model, array $attributes = null ) : mixed [!] 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 ( string $name, string $value ) [!] Method is generated. Documentation taken from corresponding module.
haveRecord ( $model, array $attributes = null ) : mixed [!] Method is generated. Documentation taken from corresponding module.
moveBack ( integer $numberOfSteps = null ) [!] Method is generated. Documentation taken from corresponding module.
openFile ( $filename ) [!] Method is generated. Documentation taken from corresponding module.
resetCookie ( $name, array $params = null ) : 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 ( $cookie, array $params = null ) : 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.
seeFileContentsEqual ( $text ) [!] Method is generated. Documentation taken from corresponding module.
seeFileFound ( $filename, string $path = null ) [!] 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.
seeInFormFields ( $formSelector, $params ) [!] Method is generated. Documentation taken from corresponding module.
seeInSource ( $raw ) [!] Method is generated. Documentation taken from corresponding module.
seeInThisFile ( $text ) [!] 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.
seeNumberNewLines ( integer $number ) [!] Method is generated. Documentation taken from corresponding module.
seeNumberOfElements ( $selector, mixed $expected ) [!] Method is generated. Documentation taken from corresponding module.
seeOptionIsSelected ( $selector, $optionText ) : mixed [!] Method is generated. Documentation taken from corresponding module.
seePageNotFound ( ) [!] Method is generated. Documentation taken from corresponding module.
seeRecord ( $model, array $attributes = null ) [!] Method is generated. Documentation taken from corresponding module.
seeResponseCodeIs ( $code ) : mixed [!] Method is generated. Documentation taken from corresponding module.
seeThisFileMatches ( $regex ) [!] 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.
setCookie ( $name, $val, array $params = null ) : mixed [!] Method is generated. Documentation taken from corresponding module.
submitForm ( $selector, $params, $button = null ) [!] Method is generated. Documentation taken from corresponding module.
switchToIframe ( string $name ) [!] Method is generated. Documentation taken from corresponding module.
uncheckOption ( $option ) [!] Method is generated. Documentation taken from corresponding module.
writeToFile ( $filename, $contents ) [!] Method is generated. Documentation taken from corresponding module.

Защищенные методы

Метод Описание
getScenario ( ) : Codeception\Scenario

Описание методов

amHttpAuthenticated() публичный метод

Authenticates user for HTTP_AUTH
См. также: Codeception\Lib\InnerBrowser::amHttpAuthenticated()
public amHttpAuthenticated ( $username, $password )
$username
$password

amInPath() публичный метод

Enters a directory In local filesystem. Project root directory is used by default
См. также: Codeception\Module\Filesystem::amInPath()
public amInPath ( $path )
$path

amOnPage() публичный метод

Converting $page to valid Yii 2 URL Allows input like: php $I->amOnPage(['site/view','page'=>'about']); $I->amOnPage('index-test.php?site/index'); $I->amOnPage('http://localhost/index-test.php?site/index');
См. также: Codeception\Module\Yii2::amOnPage()
public amOnPage ( $page )
$page string|array parameter for \yii\web\UrlManager::createUrl()

attachFile() публичный метод

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

canSee() публичный метод

Checks that the current page contains the given string (case insensitive). You can specify a specific HTML element (via CSS or XPath) as the second parameter to only search within that element. php see('Logout'); // I can suppose user is logged in $I->see('Sign Up', 'h1'); // I can suppose it's a signup page $I->see('Sign Up', '//body/h1'); // with XPath Note that the search is done after stripping all HTML tags from the body, so $I->see('strong') will return true for strings like: -

I am Stronger than thou

- But will *not* be true for strings like: - Home -
Home - For checking the raw source code, use seeInSource().
См. также: Codeception\Lib\InnerBrowser::see()
public canSee ( $text, null $selector = null )
$text
$selector null Conditional Assertion: Test won't be stopped on fail

canSeeCheckboxIsChecked() публичный метод

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]'); ?>
См. также: Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
public canSeeCheckboxIsChecked ( $checkbox )
$checkbox Conditional Assertion: Test won't be stopped on fail

canSeeCookie() публичный метод

Checks that a cookie with the given name is set. You can set additional cookie params like domain, path as array passed in last argument. php seeCookie('PHPSESSID'); ?>
См. также: Codeception\Lib\InnerBrowser::seeCookie()
public canSeeCookie ( $cookie, array $params = null ) : mixed
$cookie
$params array
Результат mixed Conditional Assertion: Test won't be stopped on fail

canSeeCurrentUrlEquals() публичный метод

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

canSeeCurrentUrlMatches() публичный метод

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

canSeeElement() публичный метод

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']); ?>
См. также: Codeception\Lib\InnerBrowser::seeElement()
public canSeeElement ( $selector, array $attributes = null )
$selector
$attributes array

canSeeFileContentsEqual() публичный метод

Checks the strict matching of file contents. Unlike seeInThisFile will fail if file has something more than expected lines. Better to use with HEREDOC strings. Matching is done after removing "\r" chars from file content. php openFile('process.pid'); $I->seeFileContentsEqual('3192'); ?>
См. также: Codeception\Module\Filesystem::seeFileContentsEqual()
public canSeeFileContentsEqual ( $text )
$text Conditional Assertion: Test won't be stopped on fail

canSeeFileFound() публичный метод

Checks if file exists in path. Opens a file when it's exists php seeFileFound('UserModel.php','app/models'); ?>
См. также: Codeception\Module\Filesystem::seeFileFound()
public canSeeFileFound ( $filename, string $path = null )
$filename
$path string Conditional Assertion: Test won't be stopped on fail

canSeeInCurrentUrl() публичный метод

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

canSeeInField() публичный метод

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'); ?>
См. также: Codeception\Lib\InnerBrowser::seeInField()
public canSeeInField ( $field, $value )
$field
$value Conditional Assertion: Test won't be stopped on fail

canSeeInFormFields() публичный метод

Checks if the array of form parameters (name => value) are set on the form matched with the passed selector. php seeInFormFields('form[name=myform]', [ 'input1' => 'value', 'input2' => 'other value', ]); ?> For multi-select elements, or to check values of multiple elements with the same name, an array may be passed: php seeInFormFields('.form-class', [ 'multiselect' => [ 'value1', 'value2', ], 'checkbox[]' => [ 'a checked value', 'another checked value', ], ]); ?> Additionally, checkbox values can be checked with a boolean. php seeInFormFields('#form-id', [ 'checkbox1' => true, // passes if checked 'checkbox2' => false, // passes if unchecked ]); ?> Pair this with submitForm for quick testing magic. php 'value', 'field2' => 'another value', 'checkbox1' => true, ... ]; $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); $I->amOnPage('/path/to/form-page') may be needed $I->seeInFormFields('//form[@id=my-form]', $form); ?>
См. также: Codeception\Lib\InnerBrowser::seeInFormFields()
public canSeeInFormFields ( $formSelector, $params )
$formSelector
$params Conditional Assertion: Test won't be stopped on fail

canSeeInSource() публичный метод

Checks that the current page contains the given string in its raw source code. php seeInSource('

Green eggs & ham

');
См. также: Codeception\Lib\InnerBrowser::seeInSource()
public canSeeInSource ( $raw )
$raw Conditional Assertion: Test won't be stopped on fail

canSeeInThisFile() публичный метод

Checks If opened file has text in it. Usage: php openFile('composer.json'); $I->seeInThisFile('codeception/codeception'); ?>
См. также: Codeception\Module\Filesystem::seeInThisFile()
public canSeeInThisFile ( $text )
$text Conditional Assertion: Test won't be stopped on fail

canSeeInTitle() публичный метод

Checks that the page title contains the given string. php seeInTitle('Blog - Post #1'); ?>
См. также: Codeception\Lib\InnerBrowser::seeInTitle()
public canSeeInTitle ( $title ) : mixed
$title
Результат mixed Conditional Assertion: Test won't be stopped on fail

canSeeNumberNewLines() публичный метод

Checks If opened file has the number of new lines. Usage: php openFile('composer.json'); $I->seeNumberNewLines(5); ?>
См. также: Codeception\Module\Filesystem::seeNumberNewLines()
public canSeeNumberNewLines ( integer $number )
$number integer New lines Conditional Assertion: Test won't be stopped on fail

canSeeNumberOfElements() публичный метод

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 ?>
См. также: Codeception\Lib\InnerBrowser::seeNumberOfElements()
public canSeeNumberOfElements ( $selector, mixed $expected )
$selector
$expected mixed : - string: strict number - array: range of numbers [0,10] Conditional Assertion: Test won't be stopped on fail

canSeeOptionIsSelected() публичный метод

Checks that the given option is selected. php seeOptionIsSelected('#form input[name=payment]', 'Visa'); ?>
См. также: Codeception\Lib\InnerBrowser::seeOptionIsSelected()
public canSeeOptionIsSelected ( $selector, $optionText ) : mixed
$selector
$optionText
Результат mixed Conditional Assertion: Test won't be stopped on fail

canSeePageNotFound() публичный метод

Asserts that current page has 404 response status code. Conditional Assertion: Test won't be stopped on fail
См. также: Codeception\Lib\InnerBrowser::seePageNotFound()
public canSeePageNotFound ( )

canSeeRecord() публичный метод

Checks that record exists in database. php $I->seeRecord('app\models\User', array('name' => 'davert'));
См. также: Codeception\Module\Yii2::seeRecord()
public canSeeRecord ( $model, array $attributes = null )
$model
$attributes array

canSeeResponseCodeIs() публичный метод

Checks that response code is equal to value provided.
См. также: Codeception\Lib\InnerBrowser::seeResponseCodeIs()
public canSeeResponseCodeIs ( $code ) : mixed
$code
Результат mixed Conditional Assertion: Test won't be stopped on fail

canSeeThisFileMatches() публичный метод

Checks that contents of currently opened file matches $regex
См. также: Codeception\Module\Filesystem::seeThisFileMatches()
public canSeeThisFileMatches ( $regex )
$regex Conditional Assertion: Test won't be stopped on fail

cantSee() публичный метод

Checks that the current page doesn't contain the text specified (case insensitive). Give a locator as the second parameter to match a specific region. php dontSee('Login'); // I can suppose user is already logged in $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page $I->dontSee('Sign Up','//body/h1'); // with XPath Note that the search is done after stripping all HTML tags from the body, so $I->dontSee('strong') will fail on strings like: -

I am Stronger than thou

- But will ignore strings like: - Home -
Home - For checking the raw source code, use seeInSource().
См. также: Codeception\Lib\InnerBrowser::dontSee()
public cantSee ( $text, null $selector = null )
$text
$selector null Conditional Assertion: Test won't be stopped on fail

cantSeeCheckboxIsChecked() публичный метод

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. ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
public cantSeeCheckboxIsChecked ( $checkbox )
$checkbox Conditional Assertion: Test won't be stopped on fail

cantSeeCookie() публичный метод

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.
См. также: Codeception\Lib\InnerBrowser::dontSeeCookie()
public cantSeeCookie ( $cookie, array $params = null ) : mixed
$cookie
$params array
Результат mixed Conditional Assertion: Test won't be stopped on fail

cantSeeCurrentUrlEquals() публичный метод

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

cantSeeCurrentUrlMatches() публичный метод

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

cantSeeElement() публичный метод

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']); ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeElement()
public cantSeeElement ( $selector, array $attributes = null )
$selector
$attributes array Conditional Assertion: Test won't be stopped on fail

cantSeeFileFound() публичный метод

Checks if file does not exist in path
См. также: Codeception\Module\Filesystem::dontSeeFileFound()
public cantSeeFileFound ( $filename, string $path = null )
$filename
$path string Conditional Assertion: Test won't be stopped on fail

cantSeeInCurrentUrl() публичный метод

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

cantSeeInField() публичный метод

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'); ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeInField()
public cantSeeInField ( $field, $value )
$field
$value Conditional Assertion: Test won't be stopped on fail

cantSeeInFormFields() публичный метод

Checks if the array of form parameters (name => value) are not set on the form matched with the passed selector. php dontSeeInFormFields('form[name=myform]', [ 'input1' => 'non-existent value', 'input2' => 'other non-existent value', ]); ?> To check that an element hasn't been assigned any one of many values, an array can be passed as the value: php dontSeeInFormFields('.form-class', [ 'fieldName' => [ 'This value shouldn\'t be set', 'And this value shouldn\'t be set', ], ]); ?> Additionally, checkbox values can be checked with a boolean. php dontSeeInFormFields('#form-id', [ 'checkbox1' => true, // fails if checked 'checkbox2' => false, // fails if unchecked ]); ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeInFormFields()
public cantSeeInFormFields ( $formSelector, $params )
$formSelector
$params Conditional Assertion: Test won't be stopped on fail

cantSeeInSource() публичный метод

Checks that the current page contains the given string in its raw source code. php dontSeeInSource('

Green eggs & ham

');
См. также: Codeception\Lib\InnerBrowser::dontSeeInSource()
public cantSeeInSource ( $raw )
$raw Conditional Assertion: Test won't be stopped on fail

cantSeeInThisFile() публичный метод

Checks If opened file doesn't contain text in it php openFile('composer.json'); $I->dontSeeInThisFile('codeception/codeception'); ?>
См. также: Codeception\Module\Filesystem::dontSeeInThisFile()
public cantSeeInThisFile ( $text )
$text Conditional Assertion: Test won't be stopped on fail

cantSeeInTitle() публичный метод

Checks that the page title does not contain the given string.
См. также: Codeception\Lib\InnerBrowser::dontSeeInTitle()
public cantSeeInTitle ( $title ) : mixed
$title
Результат mixed Conditional Assertion: Test won't be stopped on fail

cantSeeOptionIsSelected() публичный метод

Checks that the given option is not selected. php dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
public cantSeeOptionIsSelected ( $selector, $optionText ) : mixed
$selector
$optionText
Результат mixed Conditional Assertion: Test won't be stopped on fail

cantSeeRecord() публичный метод

Checks that record does not exist in database. php $I->dontSeeRecord('app\models\User', array('name' => 'davert'));
См. также: Codeception\Module\Yii2::dontSeeRecord()
public cantSeeRecord ( $model, array $attributes = null )
$model
$attributes array

checkOption() публичный метод

Ticks a checkbox. For radio buttons, use the selectOption method instead. php checkOption('#agree'); ?>
См. также: Codeception\Lib\InnerBrowser::checkOption()
public checkOption ( $option )
$option

cleanDir() публичный метод

Erases directory contents php cleanDir('logs'); ?>
См. также: Codeception\Module\Filesystem::cleanDir()
public cleanDir ( $dirname )
$dirname

click() публичный метод

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']); ?>
См. также: Codeception\Lib\InnerBrowser::click()
public click ( $link, $context = null )
$link
$context

copyDir() публичный метод

Copies directory with all contents php copyDir('vendor','old_vendor'); ?>
См. также: Codeception\Module\Filesystem::copyDir()
public copyDir ( $src, $dst )
$src
$dst

deleteDir() публичный метод

Deletes directory with all subdirectories php deleteDir('vendor'); ?>
См. также: Codeception\Module\Filesystem::deleteDir()
public deleteDir ( $dirname )
$dirname

deleteFile() публичный метод

Deletes a file php deleteFile('composer.lock'); ?>
См. также: Codeception\Module\Filesystem::deleteFile()
public deleteFile ( $filename )
$filename

deleteHeader() публичный метод

Deletes the header with the passed name. Subsequent requests will not have the deleted header in its request. Example: php haveHttpHeader('X-Requested-With', 'Codeception'); $I->amOnPage('test-headers.php'); ... $I->deleteHeader('X-Requested-With'); $I->amOnPage('some-other-page.php'); ?>
См. также: Codeception\Lib\InnerBrowser::deleteHeader()
public deleteHeader ( string $name )
$name string the name of the header to delete.

deleteThisFile() публичный метод

Deletes a file
См. также: Codeception\Module\Filesystem::deleteThisFile()
public deleteThisFile ( )

dontSee() публичный метод

Checks that the current page doesn't contain the text specified (case insensitive). Give a locator as the second parameter to match a specific region. php dontSee('Login'); // I can suppose user is already logged in $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page $I->dontSee('Sign Up','//body/h1'); // with XPath Note that the search is done after stripping all HTML tags from the body, so $I->dontSee('strong') will fail on strings like: -

I am Stronger than thou

- But will ignore strings like: - Home -
Home - For checking the raw source code, use seeInSource().
См. также: Codeception\Lib\InnerBrowser::dontSee()
public dontSee ( $text, null $selector = null )
$text
$selector null

dontSeeCheckboxIsChecked() публичный метод

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. ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
public dontSeeCheckboxIsChecked ( $checkbox )
$checkbox

dontSeeCookie() публичный метод

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.
См. также: Codeception\Lib\InnerBrowser::dontSeeCookie()
public dontSeeCookie ( $cookie, array $params = null ) : mixed
$cookie
$params array
Результат mixed

dontSeeCurrentUrlEquals() публичный метод

Checks that the current URL doesn't equal the given string. Unlike dontSeeInCurrentUrl, this only matches the full URL. php dontSeeCurrentUrlEquals('/'); ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
public dontSeeCurrentUrlEquals ( $uri )
$uri

dontSeeCurrentUrlMatches() публичный метод

Checks that current url doesn't match the given regular expression. php dontSeeCurrentUrlMatches('~$/users/(\d+)~'); ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
public dontSeeCurrentUrlMatches ( $uri )
$uri

dontSeeElement() публичный метод

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']); ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeElement()
public dontSeeElement ( $selector, array $attributes = null )
$selector
$attributes array

dontSeeFileFound() публичный метод

Checks if file does not exist in path
См. также: Codeception\Module\Filesystem::dontSeeFileFound()
public dontSeeFileFound ( $filename, string $path = null )
$filename
$path string

dontSeeInCurrentUrl() публичный метод

Checks that the current URI doesn't contain the given string. php dontSeeInCurrentUrl('/users/'); ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
public dontSeeInCurrentUrl ( $uri )
$uri

dontSeeInField() публичный метод

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'); ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeInField()
public dontSeeInField ( $field, $value )
$field
$value

dontSeeInFormFields() публичный метод

Checks if the array of form parameters (name => value) are not set on the form matched with the passed selector. php dontSeeInFormFields('form[name=myform]', [ 'input1' => 'non-existent value', 'input2' => 'other non-existent value', ]); ?> To check that an element hasn't been assigned any one of many values, an array can be passed as the value: php dontSeeInFormFields('.form-class', [ 'fieldName' => [ 'This value shouldn\'t be set', 'And this value shouldn\'t be set', ], ]); ?> Additionally, checkbox values can be checked with a boolean. php dontSeeInFormFields('#form-id', [ 'checkbox1' => true, // fails if checked 'checkbox2' => false, // fails if unchecked ]); ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeInFormFields()
public dontSeeInFormFields ( $formSelector, $params )
$formSelector
$params

dontSeeInSource() публичный метод

Checks that the current page contains the given string in its raw source code. php dontSeeInSource('

Green eggs & ham

');
См. также: Codeception\Lib\InnerBrowser::dontSeeInSource()
public dontSeeInSource ( $raw )
$raw

dontSeeInThisFile() публичный метод

Checks If opened file doesn't contain text in it php openFile('composer.json'); $I->dontSeeInThisFile('codeception/codeception'); ?>
См. также: Codeception\Module\Filesystem::dontSeeInThisFile()
public dontSeeInThisFile ( $text )
$text

dontSeeInTitle() публичный метод

Checks that the page title does not contain the given string.
См. также: Codeception\Lib\InnerBrowser::dontSeeInTitle()
public dontSeeInTitle ( $title ) : mixed
$title
Результат mixed

dontSeeOptionIsSelected() публичный метод

Checks that the given option is not selected. php dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); ?>
См. также: Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
public dontSeeOptionIsSelected ( $selector, $optionText ) : mixed
$selector
$optionText
Результат mixed

dontSeeRecord() публичный метод

Checks that record does not exist in database. php $I->dontSeeRecord('app\models\User', array('name' => 'davert'));
См. также: Codeception\Module\Yii2::dontSeeRecord()
public dontSeeRecord ( $model, array $attributes = null )
$model
$attributes array

fillField() публичный метод

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

getInternalDomains() публичный метод

Returns a list of regex patterns for recognized domain names
См. также: Codeception\Module\Yii2::getInternalDomains()
public getInternalDomains ( ) : array
Результат array

getScenario() абстрактный защищенный метод

abstract protected getScenario ( ) : Codeception\Scenario
Результат Codeception\Scenario

grabAttributeFrom() публичный метод

Grabs the value of the given attribute value from the given element. Fails if element is not found. php grabAttributeFrom('#tooltip', 'title'); ?>
См. также: Codeception\Lib\InnerBrowser::grabAttributeFrom()
public grabAttributeFrom ( $cssOrXpath, $attribute ) : mixed
$cssOrXpath
$attribute
Результат mixed

grabCookie() публичный метод

Grabs a cookie value. You can set additional cookie params like domain, path in array passed as last argument.
См. также: Codeception\Lib\InnerBrowser::grabCookie()
public grabCookie ( $cookie, array $params = null ) : mixed
$cookie
$params array
Результат mixed

grabFromCurrentUrl() публичный метод

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(); ?>
См. также: Codeception\Lib\InnerBrowser::grabFromCurrentUrl()
public grabFromCurrentUrl ( null $uri = null ) : mixed
$uri null
Результат mixed

grabMultiple() публичный метод

Grabs either the text content, or attribute values, of nodes matched by $cssOrXpath and returns them as an array. html First Second Third php grabMultiple('a'); would return ['#first', '#second', '#third'] $aLinks = $I->grabMultiple('a', 'href'); ?>
См. также: Codeception\Lib\InnerBrowser::grabMultiple()
public grabMultiple ( $cssOrXpath, $attribute = null ) : string[]
$cssOrXpath
$attribute
Результат string[]

grabRecord() публичный метод

Retrieves record from database php $category = $I->grabRecord('app\models\User', array('name' => 'davert'));
См. также: Codeception\Module\Yii2::grabRecord()
public grabRecord ( $model, array $attributes = null ) : mixed
$model
$attributes array
Результат mixed

grabTextFrom() публичный метод

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('~
См. также: Codeception\Lib\InnerBrowser::grabTextFrom()
public grabTextFrom ( $cssOrXPathOrRegex ) : mixed
$cssOrXPathOrRegex
Результат mixed

grabValueFrom() публичный метод

[!] Method is generated. Documentation taken from corresponding module.
См. также: Codeception\Lib\InnerBrowser::grabValueFrom()
public grabValueFrom ( $field ) : array | mixed | null | string
$field
Результат array | mixed | null | string

haveHttpHeader() публичный метод

Sets the HTTP header to the passed value - which is used on subsequent HTTP requests through PhpBrowser. Example: php setHeader('X-Requested-With', 'Codeception'); $I->amOnPage('test-headers.php'); ?>
См. также: Codeception\Lib\InnerBrowser::haveHttpHeader()
public haveHttpHeader ( string $name, string $value )
$name string the name of the request header
$value string the value to set it to for subsequent requests

haveRecord() публичный метод

Inserts record into the database. php haveRecord('app\models\User', array('name' => 'Davert')); ?>
См. также: Codeception\Module\Yii2::haveRecord()
public haveRecord ( $model, array $attributes = null ) : mixed
$model
$attributes array
Результат mixed

moveBack() публичный метод

Moves back in history.
См. также: Codeception\Lib\InnerBrowser::moveBack()
public moveBack ( integer $numberOfSteps = null )
$numberOfSteps integer (default value 1)

openFile() публичный метод

Opens a file and stores it's content. Usage: php openFile('composer.json'); $I->seeInThisFile('codeception/codeception'); ?>
См. также: Codeception\Module\Filesystem::openFile()
public openFile ( $filename )
$filename

resetCookie() публичный метод

Unsets cookie with the given name. You can set additional cookie params like domain, path in array passed as last argument.
См. также: Codeception\Lib\InnerBrowser::resetCookie()
public resetCookie ( $name, array $params = null ) : mixed
$params array
Результат mixed

see() публичный метод

Checks that the current page contains the given string (case insensitive). You can specify a specific HTML element (via CSS or XPath) as the second parameter to only search within that element. php see('Logout'); // I can suppose user is logged in $I->see('Sign Up', 'h1'); // I can suppose it's a signup page $I->see('Sign Up', '//body/h1'); // with XPath Note that the search is done after stripping all HTML tags from the body, so $I->see('strong') will return true for strings like: -

I am Stronger than thou

- But will *not* be true for strings like: - Home -
Home - For checking the raw source code, use seeInSource().
См. также: Codeception\Lib\InnerBrowser::see()
public see ( $text, null $selector = null )
$text
$selector null

seeCheckboxIsChecked() публичный метод

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]'); ?>
См. также: Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
public seeCheckboxIsChecked ( $checkbox )
$checkbox

seeCookie() публичный метод

Checks that a cookie with the given name is set. You can set additional cookie params like domain, path as array passed in last argument. php seeCookie('PHPSESSID'); ?>
См. также: Codeception\Lib\InnerBrowser::seeCookie()
public seeCookie ( $cookie, array $params = null ) : mixed
$cookie
$params array
Результат mixed

seeCurrentUrlEquals() публичный метод

Checks that the current URL is equal to the given string. Unlike seeInCurrentUrl, this only matches the full URL. php seeCurrentUrlEquals('/'); ?>
См. также: Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
public seeCurrentUrlEquals ( $uri )
$uri

seeCurrentUrlMatches() публичный метод

Checks that the current URL matches the given regular expression. php seeCurrentUrlMatches('~$/users/(\d+)~'); ?>
См. также: Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
public seeCurrentUrlMatches ( $uri )
$uri

seeElement() публичный метод

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']); ?>
См. также: Codeception\Lib\InnerBrowser::seeElement()
public seeElement ( $selector, array $attributes = null )
$selector
$attributes array

seeFileContentsEqual() публичный метод

Checks the strict matching of file contents. Unlike seeInThisFile will fail if file has something more than expected lines. Better to use with HEREDOC strings. Matching is done after removing "\r" chars from file content. php openFile('process.pid'); $I->seeFileContentsEqual('3192'); ?>
См. также: Codeception\Module\Filesystem::seeFileContentsEqual()
public seeFileContentsEqual ( $text )
$text

seeFileFound() публичный метод

Checks if file exists in path. Opens a file when it's exists php seeFileFound('UserModel.php','app/models'); ?>
См. также: Codeception\Module\Filesystem::seeFileFound()
public seeFileFound ( $filename, string $path = null )
$filename
$path string

seeInCurrentUrl() публичный метод

Checks that current URI contains the given string. php seeInCurrentUrl('home'); to match: /users/1 $I->seeInCurrentUrl('/users/'); ?>
См. также: Codeception\Lib\InnerBrowser::seeInCurrentUrl()
public seeInCurrentUrl ( $uri )
$uri

seeInField() публичный метод

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'); ?>
См. также: Codeception\Lib\InnerBrowser::seeInField()
public seeInField ( $field, $value )
$field
$value

seeInFormFields() публичный метод

Checks if the array of form parameters (name => value) are set on the form matched with the passed selector. php seeInFormFields('form[name=myform]', [ 'input1' => 'value', 'input2' => 'other value', ]); ?> For multi-select elements, or to check values of multiple elements with the same name, an array may be passed: php seeInFormFields('.form-class', [ 'multiselect' => [ 'value1', 'value2', ], 'checkbox[]' => [ 'a checked value', 'another checked value', ], ]); ?> Additionally, checkbox values can be checked with a boolean. php seeInFormFields('#form-id', [ 'checkbox1' => true, // passes if checked 'checkbox2' => false, // passes if unchecked ]); ?> Pair this with submitForm for quick testing magic. php 'value', 'field2' => 'another value', 'checkbox1' => true, ... ]; $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); $I->amOnPage('/path/to/form-page') may be needed $I->seeInFormFields('//form[@id=my-form]', $form); ?>
См. также: Codeception\Lib\InnerBrowser::seeInFormFields()
public seeInFormFields ( $formSelector, $params )
$formSelector
$params

seeInSource() публичный метод

Checks that the current page contains the given string in its raw source code. php seeInSource('

Green eggs & ham

');
См. также: Codeception\Lib\InnerBrowser::seeInSource()
public seeInSource ( $raw )
$raw

seeInThisFile() публичный метод

Checks If opened file has text in it. Usage: php openFile('composer.json'); $I->seeInThisFile('codeception/codeception'); ?>
См. также: Codeception\Module\Filesystem::seeInThisFile()
public seeInThisFile ( $text )
$text

seeInTitle() публичный метод

Checks that the page title contains the given string. php seeInTitle('Blog - Post #1'); ?>
См. также: Codeception\Lib\InnerBrowser::seeInTitle()
public seeInTitle ( $title ) : mixed
$title
Результат mixed

seeNumberNewLines() публичный метод

Checks If opened file has the number of new lines. Usage: php openFile('composer.json'); $I->seeNumberNewLines(5); ?>
См. также: Codeception\Module\Filesystem::seeNumberNewLines()
public seeNumberNewLines ( integer $number )
$number integer New lines

seeNumberOfElements() публичный метод

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 ?>
См. также: Codeception\Lib\InnerBrowser::seeNumberOfElements()
public seeNumberOfElements ( $selector, mixed $expected )
$selector
$expected mixed : - string: strict number - array: range of numbers [0,10]

seeOptionIsSelected() публичный метод

Checks that the given option is selected. php seeOptionIsSelected('#form input[name=payment]', 'Visa'); ?>
См. также: Codeception\Lib\InnerBrowser::seeOptionIsSelected()
public seeOptionIsSelected ( $selector, $optionText ) : mixed
$selector
$optionText
Результат mixed

seePageNotFound() публичный метод

Asserts that current page has 404 response status code.
См. также: Codeception\Lib\InnerBrowser::seePageNotFound()
public seePageNotFound ( )

seeRecord() публичный метод

Checks that record exists in database. php $I->seeRecord('app\models\User', array('name' => 'davert'));
См. также: Codeception\Module\Yii2::seeRecord()
public seeRecord ( $model, array $attributes = null )
$model
$attributes array

seeResponseCodeIs() публичный метод

Checks that response code is equal to value provided.
См. также: Codeception\Lib\InnerBrowser::seeResponseCodeIs()
public seeResponseCodeIs ( $code ) : mixed
$code
Результат mixed

seeThisFileMatches() публичный метод

Checks that contents of currently opened file matches $regex
См. также: Codeception\Module\Filesystem::seeThisFileMatches()
public seeThisFileMatches ( $regex )
$regex

selectOption() публичный метод

Selects an option in a select tag or in radio button group. php selectOption('form select[name=account]', 'Premium'); $I->selectOption('form input[name=payment]', 'Monthly'); $I->selectOption('//form/select[@name=account]', 'Monthly'); ?> Provide an array for the second argument to select multiple options: php selectOption('Which OS do you use?', array('Windows','Linux')); ?> Or provide an associative array for the second argument to specifically define which selection method should be used: php selectOption('Which OS do you use?', array('text' => 'Windows')); // Only search by text 'Windows' $I->selectOption('Which OS do you use?', array('value' => 'windows')); // Only search by value 'windows' ?> +
См. также: Codeception\Lib\InnerBrowser::selectOption()
public selectOption ( $select, $option )
$select
$option

sendAjaxGetRequest() публичный метод

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.
См. также: Codeception\Lib\InnerBrowser::sendAjaxGetRequest()
public sendAjaxGetRequest ( $uri, $params = null )
$uri
$params

sendAjaxPostRequest() публичный метод

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
См. также: Codeception\Lib\InnerBrowser::sendAjaxPostRequest()
public sendAjaxPostRequest ( $uri, $params = null )
$uri
$params

sendAjaxRequest() публичный метод

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'));
См. также: Codeception\Lib\InnerBrowser::sendAjaxRequest()
public sendAjaxRequest ( $method, $uri, $params = null )
$method
$uri
$params

setCookie() публичный метод

Sets a cookie with the given name and value. You can set additional cookie params like domain, path, expires, secure in array passed as last argument. php setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); ?>
См. также: Codeception\Lib\InnerBrowser::setCookie()
public setCookie ( $name, $val, array $params = null ) : mixed
$name
$val
$params array
Результат mixed

submitForm() публичный метод

Submits the given form on the page, optionally with the given form values. Pass the form field's values as an array in the second parameter. Although this function can be used as a short-hand version of fillField(), selectOption(), click() etc. it has some important differences: * Only field *names* may be used, not CSS/XPath selectors nor field labels * If a field is sent to this function that does *not* exist on the page, it will silently be added to the HTTP request. This is helpful for testing some types of forms, but be aware that you will *not* get an exception like you would if you called fillField() or selectOption() with a missing field. Fields that are not provided will be filled by their values from the page, or from any previous calls to fillField(), selectOption() etc. You don't need to click the 'Submit' button afterwards. This command itself triggers the request to form's action. You can optionally specify which button's value to include in the request with the last parameter (as an alternative to explicitly setting its value in the second parameter), as button values are not otherwise included in the request. Examples: php submitForm('#login', [ 'login' => 'davert', 'password' => '123456' ]); or $I->submitForm('#login', [ 'login' => 'davert', 'password' => '123456' ], 'submitButtonName'); For example, given this sample "Sign Up" form: html
Login:
Password:
Do you agree to our terms?
Select pricing plan:
You could write the following to submit it: php submitForm( '#userForm', [ 'user' => [ 'login' => 'Davert', 'password' => '123456', 'agree' => true ] ], 'submitButton' ); Note that "2" will be the submitted value for the "plan" field, as it is the selected option. You can also emulate a JavaScript submission by not specifying any buttons in the third parameter to submitForm. php submitForm( '#userForm', [ 'user' => [ 'login' => 'Davert', 'password' => '123456', 'agree' => true ] ] ); This function works well when paired with seeInFormFields() for quickly testing CRUD interfaces and form validation logic. php 'value', 'field2' => 'another value', 'checkbox1' => true, ... ]; $I->submitForm('#my-form', $form, 'submitButton'); $I->amOnPage('/path/to/form-page') may be needed $I->seeInFormFields('#my-form', $form); Parameter values can be set to arrays for multiple input fields of the same name, or multi-select combo boxes. For checkboxes, you can use either the string value or boolean true/false which will be replaced by the checkbox's value in the DOM. php submitForm('#my-form', [ 'field1' => 'value', 'checkbox' => [ 'value of first checkbox', 'value of second checkbox', ], 'otherCheckboxes' => [ true, false, false ], 'multiselect' => [ 'first option value', 'second option value' ] ]); Mixing string and boolean values for a checkbox's value is not supported and may produce unexpected results. Field names ending in [] must be passed without the trailing square bracket characters, and must contain an array for its value. This allows submitting multiple values with the same name, consider: php submitForm('#my-form', [ 'field[]' => 'value', 'field[]' => 'another value', // 'field[]' is already a defined key ]); The solution is to pass an array value: php submitForm('#my-form', [ 'field' => [ 'value', 'another value', ] ]);
См. также: Codeception\Lib\InnerBrowser::submitForm()
public submitForm ( $selector, $params, $button = null )
$selector
$params
$button

switchToIframe() публичный метод

Switch to iframe or frame on the page. Example: html