_generated\AcceptanceTesterActions::canSeeInFormFields PHP Method

canSeeInFormFields() public method

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); ?>
See also: Codeception\Module\WebDriver::seeInFormFields()
public canSeeInFormFields ( $formSelector, $params )
$formSelector
$params Conditional Assertion: Test won't be stopped on fail
    public function canSeeInFormFields($formSelector, $params)
    {
        return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args()));
    }
AcceptanceTesterActions