Ejemplo n.º 1
0
 public function testAppendFieldTextarea()
 {
     $this->module->amOnPage('/form/textarea');
     $this->module->fillField('form #description', 'eat');
     $this->module->appendField('form #description', ' code');
     $this->module->click('Submit');
     $form = data::get('form');
     $this->assertEquals('eat code', $form['description']);
 }
Ejemplo n.º 2
0
 public function testSeeInFieldTextarea()
 {
     $this->module->amOnPage('/form/textarea');
     //make sure we see 'sunrise' which is the default text in the textarea
     $this->module->seeInField('#description', 'sunrise');
     //fill in some new text and see if we can see it
     $textarea_value = 'test string';
     $this->module->fillField('#description', $textarea_value);
     $this->module->seeInField('#description', $textarea_value);
 }
Ejemplo n.º 3
0
 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');
 }