public function testBug1637() { $this->module->amOnPage('/form/bug1637'); // confirm that options outside a form are still selectable $this->module->selectOption('input[name=first_test_radio]', 'Yes'); // confirm that it did what we expected and did not do anything else $this->module->seeOptionIsSelected('input[name=first_test_radio]', 'Yes'); $this->module->dontSeeOptionIsSelected('input[name=first_test_radio]', 'No'); }
public function testAppendFieldSelect() { $this->module->amOnPage('/form/select_multiple'); $this->module->selectOption('form #like', 'eat'); $this->module->appendField('form #like', 'code'); $this->module->click('Submit'); $form = data::get('form'); $this->assertEmpty(array_diff($form['like'], array("eat", "code"))); }
public function testBug1467() { $this->module->amOnPage('/form/bug1467'); $this->module->selectOption('form[name=form2] input[name=first_test_radio]', 'Yes'); $this->module->selectOption('form[name=form2] input[name=second_test_radio]', 'No'); $this->module->seeOptionIsSelected('form[name=form2] input[name=first_test_radio]', 'Yes'); $this->module->seeOptionIsSelected('form[name=form2] input[name=second_test_radio]', 'No'); // shouldn't have touched form1 at all $this->module->dontSeeOptionIsSelected('form[name=form1] input[name=first_test_radio]', 'No'); $this->module->dontSeeOptionIsSelected('form[name=form1] input[name=first_test_radio]', 'Yes'); $this->module->dontSeeOptionIsSelected('form[name=form1] input[name=second_test_radio]', 'No'); $this->module->dontSeeOptionIsSelected('form[name=form1] input[name=second_test_radio]', 'Yes'); }
public function testWebDriverByLocators() { $this->module->amOnPage('/login'); $this->module->seeElement(WebDriverBy::id('submit-label')); $this->module->seeElement(WebDriverBy::name('password')); $this->module->seeElement(WebDriverBy::className('optional')); $this->module->seeElement(WebDriverBy::cssSelector('form.global_form_box')); $this->module->seeElement(WebDriverBy::xpath(\Codeception\Util\Locator::tabIndex(4))); $this->module->fillField(WebDriverBy::name('password'), '123456'); $this->module->amOnPage('/form/select'); $this->module->selectOption(WebDriverBy::name('age'), 'child'); $this->module->amOnPage('/form/checkbox'); $this->module->checkOption(WebDriverBy::name('terms')); $this->module->amOnPage('/'); $this->module->seeElement(WebDriverBy::linkText('Test')); $this->module->click(WebDriverBy::linkText('Test')); $this->module->seeCurrentUrlEquals('/form/hidden'); }