public function testValidDetails(\FunctionalTester $I) { $I->wantTo('test logging in with the correct details'); LoginPage::openBy($I); LoginPage::loginAsUser($I); $I->seeCurrentUrlEquals(IndexPage::$url); }
protected function login(FunctionalTester $I, $name, $password) { $loginPage = LoginPage::openBy($I); $I->seeInTitle('Login'); $loginPage->login($name, $password); $I->see('Logout', '.nav'); }
public function testLogin(AcceptanceTester $I) { $I->wantTo('ensure that login works'); $loginPage = LoginPage::openBy($I); $I->seeInTitle('Login'); $I->amGoingTo('try to login with empty credentials'); $loginPage->login('', ''); if (method_exists($I, 'wait')) { $I->wait(1); // only for selenium } $I->expectTo('see validations errors'); $I->see('Username cannot be blank.'); $I->see('Password cannot be blank.'); $I->amGoingTo('try to login with wrong credentials'); $loginPage->login('admin', 'wrong'); if (method_exists($I, 'wait')) { $I->wait(1); // only for selenium } $I->expectTo('see validations errors'); $I->see('Incorrect username or password.'); $I->amGoingTo('try to login with correct credentials'); $loginPage->login('admin', 'adminpass'); if (method_exists($I, 'wait')) { $I->wait(2); // only for selenium } $I->expectTo('see user info'); $I->seeLink('Profile', '.nav'); $I->dontSeeLink('Login', '.nav'); $I->dontSeeLink('Signup', '.nav'); }
public function _before(\FunctionalTester $I) { $this->page = 'tests\\codeception\\_pages\\project\\CreatePage'; $this->params = []; $this->project = '\\NewProject'; LoginPage::openBy($I); LoginPage::loginAsManager($I); }
public function _before(\FunctionalTester $I) { $this->page = 'tests\\codeception\\_pages\\activity\\UpdatePage'; $this->params = ['id' => \Activity::$id]; $this->activity = '\\NewActivity'; LoginPage::openBy($I); LoginPage::loginAsCoordinator($I); }
public function testVolunteerFormLinkAsUser(\FunctionalTester $I) { LoginPage::openBy($I); LoginPage::loginAsUser($I); $I->seeCurrentUrlEquals(IndexPage::$url); $I->seeLink(IndexPage::$logoutLinkText); $I->click(IndexPage::$volunteerFormButtonText, IndexPage::$contentSelector); $I->seeCurrentUrlEquals(VolunteerPage::$url); }
protected function login(AcceptanceTester $I, $name = 'admin', $password = '******') { $loginPage = LoginPage::openBy($I); $I->seeInTitle('Login'); $loginPage->login($name, $password); if (method_exists($I, 'wait')) { $I->wait(2); // only for selenium } $I->see('Profile', '.nav'); }
/** * @after logout */ public function testLogin(FunctionalTester $I) { $I->wantTo('ensure that login works'); $loginPage = LoginPage::openBy($I); $I->seeInTitle('Login'); $I->amGoingTo('try to login with empty credentials'); $loginPage->login('', ''); $I->expectTo('see validations errors'); $I->see('Username cannot be blank.'); $I->see('Password cannot be blank.'); $I->amGoingTo('try to login with wrong credentials'); $loginPage->login('admin', 'wrong'); $I->expectTo('see validations errors'); $I->see('Incorrect username or password.'); $I->amGoingTo('try to login with correct credentials'); $loginPage->login('admin', 'adminpass'); $I->expectTo('see user info'); $I->see('Profile', '.nav'); }
public function testFollowActivity(\FunctionalTester $I) { $I->wantTo('check that Follow button works'); LoginPage::openBy($I); LoginPage::loginAsUser($I); IndexPage::openBy($I); $I->seeLink(IndexPage::$followButtonText, IndexPage::getFollowLink(\Project::$id)); $I->dontSeeLink(IndexPage::$unfollowButtonText, IndexPage::getUnfollowLink(\Project::$id)); $I->sendAjaxPostRequest(IndexPage::getFollowLink(\Project::$id)); IndexPage::openBy($I); $I->seeRecord('app\\models\\ProjectActivityFollowers', ['activityID' => \ProjectActivity::$id, 'usersFollowing' => \Yii::$app->getUser()->getId()]); $I->seeLink(IndexPage::$unfollowButtonText, IndexPage::getUnfollowLink(\Project::$id)); $I->dontSeeLink(IndexPage::$followButtonText, IndexPage::getFollowLink(\Project::$id)); }
public function _before(\FunctionalTester $I) { $I->wantTo('log in so I can test the volunteer page'); LoginPage::openBy($I); LoginPage::loginAsUser($I); }