-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
user.feature
101 lines (84 loc) · 4.04 KB
/
user.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Feature: Check that UserTrait works
Background:
Given users:
| name | mail | roles | status |
| administrator_user | [email protected] | administrator | 1 |
| authenticated_user | [email protected] | | 1 |
| authenticated_user_disabled | [email protected] | | 0 |
@api
Scenario: Assert "When I visit user :name profile"
Given I am logged in as a user with the "administrator" role
When I visit user "authenticated_user" profile
Then I should get a 200 HTTP response
@api
Scenario: Assert "When I edit user :name profile"
Given I am logged in as a user with the "administrator" role
When I edit user "authenticated_user" profile
Then I should get a 200 HTTP response
@api
Scenario: Assert "When I go to my profile edit page"
Given I am logged in as a user with the "administrator" role
When I go to my profile edit page
Then I should get a 200 HTTP response
@api
Scenario: Assert "Given no users:" by name
Given I am logged in as a user with the "administrator" role
When I visit user "authenticated_user" profile
Then I should get a 200 HTTP response
When no users:
| name |
| authenticated_user |
Then user "authenticated_user" does not exist
@api
Scenario: Assert "Given no users:" by email
Given I am logged in as a user with the "administrator" role
When I visit user "authenticated_user" profile
Then I should get a 200 HTTP response
When no users:
| mail |
Then user "authenticated_user" does not exist
@api
Scenario: Assert "Then user :name has :roles role(s) assigned"
Given user "authenticated_user" has "authenticated" role assigned
And user "authenticated_user" has "authenticated" roles assigned
Given user "administrator_user" has "authenticated, administrator" roles assigned
@api
Scenario: Assert "Then user :name does not have :roles role(s) assigned"
Given user "authenticated_user" does not have "administrator" role assigned
And user "authenticated_user" does not have "administrator" roles assigned
@api
Scenario: Assert "Then user :name has :status status"
Given user "authenticated_user" has "active" status
And user "authenticated_user_disabled" has "blocked" status
@api
Scenario: Assert "I set user :user password to :password"
Given I set user "administrator_user" password to "password123"
Given I set user "[email protected]" password to "password123"
@trait:UserTrait @api
Scenario: Assert that negative assertions fail with an error
Given some behat configuration
And scenario steps:
"""
Given I set user "non_existing_user" password to "password123"
"""
When I run "behat --no-colors"
Then it should fail with an exception:
"""
Unable to find a user with name or email "non_existing_user".
"""
@api
Scenario: Assert "Then the last access time of user :name is :time"
Given users:
| name | mail | roles | status |
| administrator_user_test_last_access | [email protected] | administrator | 1 |
Then I am logged in as a user with the "administrator" role
And I visit "/admin/people?user=administrator_user_test_last_access"
Then I should see the text "never"
Then the last access time of user "administrator_user_test_last_access" is "[relative:-10 years]"
# We should not need clear cache at here. Re-check later.
Then I visit "/admin/config/development/performance"
Then I press the "Clear all cache" button
Then I visit "/admin/people?user=administrator_user_test_last_access"
Then I should not see the text "never"
Then I should see the text "10 years ago"