1 |
efrain |
1 |
@tool_behat
|
|
|
2 |
Feature: Verify that the behat login and logout steps work as expected
|
|
|
3 |
In order to use behat login and log out steps
|
|
|
4 |
As a test writer
|
|
|
5 |
I need to verify that login and logout happen when the steps are used
|
|
|
6 |
|
|
|
7 |
Scenario: Log in as a user using the step
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname |
|
|
|
10 |
| traverst1 | Thomas | Travers |
|
|
|
11 |
When I log in as "traverst1"
|
|
|
12 |
Then I should see "Thomas Travers"
|
|
|
13 |
|
|
|
14 |
@javascript
|
|
|
15 |
Scenario: Log in as a user using the step (javascript)
|
|
|
16 |
Given the following "users" exist:
|
|
|
17 |
| username | firstname | lastname |
|
|
|
18 |
| traverst1 | Thomas | Travers |
|
|
|
19 |
When I log in as "traverst1"
|
|
|
20 |
Then I should see "Thomas Travers"
|
|
|
21 |
|
|
|
22 |
Scenario: Log out using the log out step
|
|
|
23 |
Given the following "users" exist:
|
|
|
24 |
| username | firstname | lastname |
|
|
|
25 |
| traverst1 | Thomas | Travers |
|
|
|
26 |
And I am logged in as traverst1
|
|
|
27 |
When I log out
|
|
|
28 |
Then I should not see "Thomas Travers"
|
|
|
29 |
And I should see "You are not logged in"
|
|
|
30 |
|
|
|
31 |
@javascript
|
|
|
32 |
Scenario: Log out using the log out step (javascript)
|
|
|
33 |
Given the following "users" exist:
|
|
|
34 |
| username | firstname | lastname |
|
|
|
35 |
| traverst1 | Thomas | Travers |
|
|
|
36 |
And I am logged in as traverst1
|
|
|
37 |
When I log out
|
|
|
38 |
Then I should not see "Thomas Travers"
|
|
|
39 |
And I should see "You are not logged in"
|
|
|
40 |
|
|
|
41 |
Scenario: Log in step should automatically log user out if already logged in
|
|
|
42 |
Given the following "users" exist:
|
|
|
43 |
| username | firstname | lastname |
|
|
|
44 |
| traverst1 | Thomas | Travers |
|
|
|
45 |
| emeryj | Jane | Emery |
|
|
|
46 |
And I am logged in as traverst1
|
|
|
47 |
When I log in as "emeryj"
|
|
|
48 |
Then I should not see "Thomas Travers"
|
|
|
49 |
And I should see "Jane Emery"
|
|
|
50 |
|
|
|
51 |
@javascript
|
|
|
52 |
Scenario: Log in step should automatically log user out if already logged in (javascript)
|
|
|
53 |
Given the following "users" exist:
|
|
|
54 |
| username | firstname | lastname |
|
|
|
55 |
| traverst1 | Thomas | Travers |
|
|
|
56 |
| emeryj | Jane | Emery |
|
|
|
57 |
And I am logged in as traverst1
|
|
|
58 |
When I log in as "emeryj"
|
|
|
59 |
Then I should not see "Thomas Travers"
|
|
|
60 |
And I should see "Jane Emery"
|
|
|
61 |
|
|
|
62 |
Scenario: I am on page logged in as should redirect to correct page
|
|
|
63 |
Given the following "users" exist:
|
|
|
64 |
| username | firstname | lastname |
|
|
|
65 |
| traverst1 | Thomas | Travers |
|
|
|
66 |
And the following "course" exists:
|
|
|
67 |
| fullname | Life, the Universe, and Everything |
|
|
|
68 |
| shortname | hhgttg |
|
|
|
69 |
When I am on the hhgttg Course page logged in as traverst1
|
|
|
70 |
Then I should see "Thomas Travers"
|
|
|
71 |
And I should see "Life, the Universe, and Everything"
|
|
|
72 |
|
|
|
73 |
@javascript
|
|
|
74 |
Scenario: I am on page logged in as should redirect to correct page (javascript)
|
|
|
75 |
Given the following "users" exist:
|
|
|
76 |
| username | firstname | lastname |
|
|
|
77 |
| traverst1 | Thomas | Travers |
|
|
|
78 |
And the following "course" exists:
|
|
|
79 |
| fullname | Life, the Universe, and Everything |
|
|
|
80 |
| shortname | hhgttg |
|
|
|
81 |
When I am on the hhgttg Course page logged in as traverst1
|
|
|
82 |
Then I should see "Thomas Travers"
|
|
|
83 |
And I should see "Life, the Universe, and Everything"
|
|
|
84 |
|
|
|
85 |
Scenario: I am on page logged in as should redirect to correct page when automatically logging a user out
|
|
|
86 |
Given the following "users" exist:
|
|
|
87 |
| username | firstname | lastname |
|
|
|
88 |
| traverst1 | Thomas | Travers |
|
|
|
89 |
| emeryj | Jane | Emery |
|
|
|
90 |
And the following "course" exists:
|
|
|
91 |
| fullname | Life, the Universe, and Everything |
|
|
|
92 |
| shortname | hhgttg |
|
|
|
93 |
And I am logged in as emeryj
|
|
|
94 |
When I am on the hhgttg Course page logged in as traverst1
|
|
|
95 |
Then I should see "Thomas Travers"
|
|
|
96 |
And I should see "Life, the Universe, and Everything"
|
|
|
97 |
|
|
|
98 |
@javascript
|
|
|
99 |
Scenario: I am on page logged in as should redirect to correct page when automatically logging a user out (javacript)
|
|
|
100 |
Given the following "users" exist:
|
|
|
101 |
| username | firstname | lastname |
|
|
|
102 |
| traverst1 | Thomas | Travers |
|
|
|
103 |
| emeryj | Jane | Emery |
|
|
|
104 |
And the following "course" exists:
|
|
|
105 |
| fullname | Life, the Universe, and Everything |
|
|
|
106 |
| shortname | hhgttg |
|
|
|
107 |
And I am logged in as emeryj
|
|
|
108 |
When I am on the hhgttg Course page logged in as traverst1
|
|
|
109 |
Then I should see "Thomas Travers"
|
|
|
110 |
And I should see "Life, the Universe, and Everything"
|