Esempio n. 1
0
 public function testChecxboxByLabel()
 {
     $this->module->amOnPage('/form/checkbox');
     $this->module->checkOption('I Agree');
     $this->module->click('Submit');
     $form = data::get('form');
     $this->assertEquals('agree', $form['terms']);
 }
Esempio n. 2
0
 /**
  * @Issue https://github.com/Codeception/Codeception/issues/1535
  */
 public function testCheckingOptionsWithComplexNames()
 {
     $this->module->amOnPage('/form/bug1535');
     $this->module->checkOption('#bmessage-topicslinks input[value="4"]');
     $this->module->click('Submit');
     $data = data::get('form');
     $this->assertContains(4, $data['BMessage']['topicsLinks']);
 }
Esempio n. 3
0
 public function testExample1()
 {
     $this->module->amOnPage('/form/example1');
     $this->module->see('Login', 'button');
     $this->module->fillField('#LoginForm_username', 'davert');
     $this->module->fillField('#LoginForm_password', '123456');
     $this->module->checkOption('#LoginForm_rememberMe');
     $this->module->click('Login');
     $login = data::get('form');
     $this->assertEquals('davert', $login['LoginForm']['username']);
     $this->assertEquals('123456', $login['LoginForm']['password']);
     $this->assertNotEmpty($login['LoginForm']['rememberMe']);
 }
Esempio n. 4
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');
 }