MDL-39813 behat: fixed up behat expectations
This commit is contained in:
@@ -49,10 +49,10 @@ class behat_auth extends behat_base {
|
||||
public function i_log_in_as($username) {
|
||||
|
||||
return array(new Given('I am on homepage'),
|
||||
new Given('I follow "Login"'),
|
||||
new Given('I follow "Log in"'),
|
||||
new Given('I fill in "Username" with "'.$username.'"'),
|
||||
new Given('I fill in "Password" with "'.$username.'"'),
|
||||
new Given('I press "Login"')
|
||||
new Given('I press "Log in"')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class behat_auth extends behat_base {
|
||||
* @Given /^I log out$/
|
||||
*/
|
||||
public function i_log_out() {
|
||||
return new When('I follow "Logout"');
|
||||
return new When('I follow "Log out"');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,32 +4,32 @@ Feature: Authentication
|
||||
As a user
|
||||
I need to log into the system
|
||||
|
||||
Scenario: Login with the predefined admin user
|
||||
Scenario: Log in with the predefined admin user
|
||||
Given I log in as "admin"
|
||||
|
||||
Scenario: Login as an existing admin user filling the form
|
||||
Scenario: Log in as an existing admin user filling the form
|
||||
Given the following "users" exists:
|
||||
| username | password | firstname | lastname | email |
|
||||
| testuser | testuser | Test | User | moodle@moodlemoodle.com |
|
||||
And I am on homepage
|
||||
When I follow "Login"
|
||||
When I follow "Log in"
|
||||
And I fill in "Username" with "testuser"
|
||||
And I fill in "Password" with "testuser"
|
||||
And I press "Login"
|
||||
And I press "Log in"
|
||||
Then I should see "You are logged in as"
|
||||
|
||||
Scenario: Login as an unexisting user filling the form
|
||||
Scenario: Log in as an unexisting user filling the form
|
||||
Given the following "users" exists:
|
||||
| username | password | firstname | lastname | email |
|
||||
| testuser | testuser | Test | User | moodle@moodlemoodle.com |
|
||||
And I am on homepage
|
||||
When I follow "Login"
|
||||
When I follow "Log in"
|
||||
And I fill in "Username" with "testuser"
|
||||
And I fill in "Password" with "unexisting"
|
||||
And I press "Login"
|
||||
And I press "Log in"
|
||||
Then I should see "Invalid login, please try again"
|
||||
|
||||
Scenario: Logout
|
||||
Scenario: Log out
|
||||
Given I log in as "admin"
|
||||
When I log out
|
||||
Then I should see "You are not logged in"
|
||||
|
||||
Reference in New Issue
Block a user