Merge branch 'MDL-63528-master' of git://github.com/junpataleta/moodle
[moodle.git] / auth / tests / behat / login.feature
CommitLineData
550d842e 1@core @core_auth
0a56fc69
DM
2Feature: Authentication
3 In order to validate my credentials in the system
5d7b6307 4 As a user
0a56fc69
DM
5 I need to log into the system
6
3688bd47 7 Scenario: Log in with the predefined admin user with Javascript disabled
0a56fc69 8 Given I log in as "admin"
370e88d4 9 Then I should see "You are logged in as Admin User" in the "page-footer" "region"
3688bd47
DM
10
11 @javascript
12 Scenario: Log in with the predefined admin user with Javascript enabled
13 Given I log in as "admin"
370e88d4 14 Then I should see "You are logged in as Admin User" in the "page-footer" "region"
0a56fc69 15
07dd7fcc 16 Scenario: Log in as an existing admin user filling the form
759b323e 17 Given the following "users" exist:
bedc20aa 18 | username | password | firstname | lastname | email |
0fe86bbd 19 | testuser | testuser | Test | User | moodle@example.com |
f5da794c 20 And I am on site homepage
07dd7fcc 21 When I follow "Log in"
f083d614
DM
22 And I set the field "Username" to "testuser"
23 And I set the field "Password" to "testuser"
07dd7fcc 24 And I press "Log in"
370e88d4 25 Then I should see "You are logged in as" in the "page-footer" "region"
bedc20aa 26
07dd7fcc 27 Scenario: Log in as an unexisting user filling the form
759b323e 28 Given the following "users" exist:
bedc20aa 29 | username | password | firstname | lastname | email |
0fe86bbd 30 | testuser | testuser | Test | User | moodle@example.com |
f5da794c 31 And I am on site homepage
07dd7fcc 32 When I follow "Log in"
f083d614
DM
33 And I set the field "Username" to "testuser"
34 And I set the field "Password" to "unexisting"
07dd7fcc 35 And I press "Log in"
bedc20aa
DM
36 Then I should see "Invalid login, please try again"
37
07dd7fcc 38 Scenario: Log out
0a56fc69
DM
39 Given I log in as "admin"
40 When I log out
370e88d4 41 Then I should see "You are not logged in" in the "page-footer" "region"
428a47fc
JP
42
43 Scenario Outline: Checking the display of the Remember username checkbox
44 Given I log in as "admin"
45 And I set the following administration settings values:
46 | rememberusername | <settingvalue> |
47 And I log out
48 And I am on homepage
49 When I click on "Log in" "link" in the ".logininfo" "css_element"
50 Then I should <expect> "Remember username"
51
52 Examples:
53 | settingvalue | expect |
54 | 0 | not see |
55 | 1 | see |
56 | 2 | see |