MDL-69391 behat: Grammar correction in feature
[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 |
39a736ef
AN
57
58 @javascript @accessibility
59 Scenario: Login page must be accessible
60 When I am on site homepage
61 # The following tests are all provided to ensure that the accessibility tests themselves are tested.
62 # In normal tests only one of the following is required.
63 Then the page should meet accessibility standards
db8fea04
JP
64 And the page should meet "wcag131, wcag141, wcag412" accessibility standards
65 And the page should meet accessibility standards with "wcag131, wcag141, wcag412" extra tests
39a736ef
AN
66
67 And I follow "Log in"
68 And the page should meet accessibility standards
db8fea04
JP
69 And the page should meet "wcag131, wcag141, wcag412" accessibility standards
70 And the page should meet accessibility standards with "wcag131, wcag141, wcag412" extra tests
fe346f0a
JP
71
72 @javascript @accessibility
73 Scenario: The login page must have sufficient colour contrast
74 Given the following config values are set as admin:
75 | custommenuitems | -This is a custom item\|/customurl/ |
f558127d
AN
76 When I am on site homepage
77 Then the page should meet "wcag143" accessibility standards
fe346f0a 78 And the page should meet accessibility standards with "wcag143" extra tests