public function testCurrentUrl()
 {
     $this->module->amOnPage('/');
     $this->module->seeCurrentUrlEquals('/');
     $this->module->dontSeeInCurrentUrl('/user');
     $this->module->dontSeeCurrentUrlMatches('~user~');
     $this->module->amOnPage('/form/checkbox');
     $this->module->seeCurrentUrlEquals('/form/checkbox');
     $this->module->seeInCurrentUrl('form');
     $this->module->seeCurrentUrlMatches('~form/.*~');
     $this->module->dontSeeCurrentUrlEquals('/');
     $this->module->dontSeeCurrentUrlMatches('~form/a~');
     $this->module->dontSeeInCurrentUrl('user');
 }
 /**
  * @Issue https://github.com/Codeception/Codeception/issues/933
  */
 public function testSubmitFormWithQueries()
 {
     $this->module->amOnPage('/form/example3');
     $this->module->seeElement('form');
     $this->module->submitForm('form', array('name' => 'jon'));
     $form = data::get('form');
     $this->assertEquals('jon', $form['name']);
     $this->module->seeCurrentUrlEquals('/form/example3?validate=yes');
 }
Beispiel #3
0
 /**
  * @issue https://github.com/Codeception/Codeception/issues/2653
  */
 public function testSetCookiesByOptions()
 {
     $config = $this->module->_getConfig();
     $config['cookies'] = [['Name' => 'foo', 'Value' => 'bar1'], ['Name' => 'baz', 'Value' => 'bar2']];
     $this->module->_reconfigure($config);
     // this url redirects if cookies are present
     $this->module->amOnPage('/cookies');
     $this->module->seeCurrentUrlEquals('/info');
 }
 public function testLinkWithDocRelativeURLFromDefaultPage()
 {
     $this->module->amOnPage('/form/');
     $this->module->click('Doc-Relative Link');
     $this->module->seeCurrentUrlEquals('/form/example11');
 }
 /**
  * @issue https://github.com/Codeception/Codeception/issues/2960
  */
 public function testClickMultiByteLink()
 {
     $this->module->amOnPage('/info');
     $this->module->click('Franšízy - pobočky');
     $this->module->seeCurrentUrlEquals('/');
 }
Beispiel #6
0
 public function testSubmitFormWithDocRelativePathForAction()
 {
     $this->module->amOnPage('/form/example12');
     $this->module->submitForm('form', array('test' => 'value'));
     $this->module->seeCurrentUrlEquals('/form/example11');
 }
Beispiel #7
0
 public function testExample5WithSubmitForm()
 {
     $this->module->amOnPage('/form/example5');
     $this->module->submitForm('form', ['username' => 'John', 'password' => '1234']);
     $this->module->seeCurrentUrlEquals('/form/example5?username=John&password=1234');
 }