Skip to content

Commit 13a6832

Browse files
MNT Behat for permission roles (#1712)
* MNT Remove duplicate behat scenarios * MNT Add new behat scenarios for permission roles
1 parent 0583c6c commit 13a6832

File tree

2 files changed

+43
-14
lines changed

2 files changed

+43
-14
lines changed

tests/behat/features/manage-groups.feature

-14
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ Feature: Manage groups
3434
And I press the "Create" button
3535
Then I should see "Validation Error"
3636

37-
Scenario: Members of a group with permissions
38-
Given I go to "/Security/login"
39-
And I press the "Log in as someone else" button
40-
And I am logged in as a member of "BOB" group
41-
When I go to "/my-page?stage=Stage"
42-
Then I should not see "My page"
43-
4437
Scenario: Members of a group with permissions can edit Group data
4538
Given I go to "/Security/login"
4639
And I press the "Log in as someone else" button
@@ -68,13 +61,6 @@ Feature: Manage groups
6861
And I click "Users" in the ".breadcrumbs-wrapper" element
6962
And I should see "General Editor"
7063

71-
Scenario: Members of a group with permissions cannot view draft content
72-
Given I go to "/Security/login"
73-
And I press the "Log in as someone else" button
74-
And I am logged in as a member of "BOB" group
75-
When I go to "/my-page?stage=Stage"
76-
Then I should not see "My page"
77-
7864
Scenario: Members of a group without permissions cannot view draft content
7965
Given I go to "/Security/login"
8066
And I press the "Log in as someone else" button
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@javascript @retry
2+
Feature: Manage Roles
3+
As a site administrator
4+
I want to create and manage group roles on my site
5+
So that I can control access to the CMS
6+
7+
Background:
8+
Given a "group" "Jane"
9+
And the "role" "This role is just another role"
10+
And the "role" "View draft content" has permissions "View draft content"
11+
And the "page" "My page"
12+
And I am logged in with "ADMIN" permissions
13+
And I go to "/admin/security"
14+
15+
Scenario: I can create a new role with permissions
16+
When I click the "Roles" CMS tab
17+
And I press the "Add Role" button
18+
And I fill in "Title" with "MyRole"
19+
And I check "View draft content"
20+
And I press the "Create" button
21+
Then I should not see "Validation Error"
22+
And the "View draft content" checkbox should be checked
23+
24+
Scenario: Manage roles link works correctly
25+
When I click the "Groups" CMS tab
26+
And I click "Jane" in the "#Form_EditForm_groups" element
27+
And I click the "Roles" CMS tab
28+
And I click "Manage roles" in the "#Root_Roles" element
29+
Then I should see "Add Role"
30+
And I should see "This role is just another role"
31+
32+
Scenario: Members of a group with role permissions can view draft content
33+
When I click the "Groups" CMS tab
34+
And I click "Jane" in the "#Form_EditForm_groups" element
35+
And I click the "Roles" CMS tab
36+
And I select "View draft content" from "Roles[]"
37+
And I press the "Save" button
38+
Then I should not see "Validation Error"
39+
Given I go to "/Security/login"
40+
And I press the "Log in as someone else" button
41+
And I am logged in as a member of "Jane" group
42+
When I go to "/my-page?stage=Stage"
43+
Then I should see "My page"

0 commit comments

Comments
 (0)