public function testCurrentUrl() { $this->module->amOnPage('/info'); $this->module->seeCurrentUrlEquals('/info'); $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'); }
/** * Get facebook test user be logged in on facebook. * This is done by going to facebook.com * * @throws ModuleConfigException */ public function haveTestUserLoggedInOnFacebook() { if (!array_key_exists('id', $this->testUser)) { throw new ModuleException(__CLASS__, 'Facebook test user was not found. Did you forget to create one?'); } $callbackUrl = $this->browserModule->_getUrl(); $this->browserModule->amOnUrl('https://facebook.com/login'); $this->browserModule->submitForm('#login_form', ['email' => $this->grabFacebookTestUserEmail(), 'pass' => $this->grabFacebookTestUserPassword()]); // if login in successful we are back on login screen: $this->browserModule->dontSeeInCurrentUrl('/login'); $this->browserModule->amOnUrl($callbackUrl); }