public function testSelectTwoSubmitsByCSS()
 {
     $this->module->amOnPage('/form/select_two_submits');
     $this->module->selectOption("form select[name='sandwich_select']", '2');
     $this->module->click('Save');
     $form = data::get('form');
     $this->assertEquals(2, $form['sandwich_select']);
 }
 public function testSelectMultipleOptionsByValue()
 {
     $this->module->amOnPage('/form/select_multiple');
     $this->module->selectOption('What do you like the most?', array('eat', 'adult'));
     $this->module->click('Submit');
     $form = data::get('form');
     $this->assertEquals(array('eat', 'adult'), $form['like']);
 }
 public function testSelectOptionTextSelector()
 {
     $this->module->amOnPage('/form/select_selectors');
     $this->module->selectOption('age', ['text' => '20']);
     $this->module->seeOptionIsSelected('age', '20');
     $this->module->selectOption('age', ['text' => '21']);
     $this->module->seeOptionIsSelected('age', '21');
 }
Beispiel #4
0
 public function testSelectByLabelAndOptionText()
 {
     $this->module->amOnPage('/form/select');
     $this->module->selectOption('Select your age', '21-60');
     $this->module->click('Submit');
     $form = data::get('form');
     $this->assertEquals('adult', $form['age']);
 }
Beispiel #5
0
 public function testSelectAndCheckOptionSquareBracketNames()
 {
     $this->module->amOnPage('/form/names-sq-brackets');
     $this->module->selectOption('//input[@name="input_radio_name"]', '1');
     $this->module->selectOption('//input[@name="input_radio_name"]', '2');
     $this->module->checkOption('//input[@name="input_checkbox_name"]', '1');
     $this->module->checkOption('//input[@name="input_checkbox_name"]', '2');
     $this->module->checkOption('//input[@name="input[checkbox][name][]"]', '1');
     $this->module->checkOption('//input[@name="input[checkbox][name][]"]', '2');
     $this->module->checkOption('//input[@name="input[checkbox][name][]"]', '1');
     $this->module->selectOption('//select[@name="select_name"]', '1');
     $this->module->selectOption('//input[@name="input[radio][name][]"]', '1');
     $this->module->selectOption('//input[@name="input[radio][name][]"]', '2');
     $this->module->selectOption('//input[@name="input[radio][name][]"]', '1');
     $this->module->selectOption('//select[@name="select[name][]"]', '1');
 }
Beispiel #6
0
 public function testStrictLocators()
 {
     $this->module->amOnPage('/login');
     $this->module->seeElement(['id' => 'submit-label']);
     $this->module->seeElement(['name' => 'password']);
     $this->module->seeElement(['class' => 'optional']);
     $this->module->seeElement(['css' => 'form.global_form_box']);
     $this->module->seeElement(['xpath' => \Codeception\Util\Locator::tabIndex(4)]);
     $this->module->fillField(['name' => 'password'], '123456');
     $this->module->amOnPage('/form/select');
     $this->module->selectOption(['name' => 'age'], 'child');
     $this->module->amOnPage('/form/checkbox');
     $this->module->checkOption(['name' => 'terms']);
     $this->module->amOnPage('/');
     $this->module->seeElement(['link' => 'Test']);
     $this->module->click(['link' => 'Test']);
     $this->module->seeCurrentUrlEquals('/form/hidden');
 }