-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1310 from creative-commoners/pulls/1/group-title-…
…test MNT Add new behat test for Group title validation
- Loading branch information
Showing
2 changed files
with
47 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@javascript @retry | ||
Feature: Manage groups | ||
As a site administrator | ||
I want to create and manage user groups on my site | ||
So that I can control access to the CMS | ||
|
||
Background: | ||
Given a "group" "BOB group" | ||
And a "group" "Jane group" with permissions "View draft content" | ||
And the "page" "My page" | ||
And I am logged in with "ADMIN" permissions | ||
And I go to "/admin/security" | ||
|
||
Scenario: I can create a new group with permissions | ||
# Create a user group | ||
When I click the "Groups" CMS tab | ||
And I press the "Add Group" button | ||
And I fill in "Group name" with "MyGroup" | ||
And I press the "Create" button | ||
Then I should not see "Validation Error" | ||
|
||
# Assign various permissions to the group | ||
And I click the "Permissions" CMS tab | ||
And I check "View draft content" | ||
And I press the "Save" button | ||
Then I should not see "Validation Error" | ||
|
||
Scenario: Group cannot have a blank name | ||
When I click the "Groups" CMS tab | ||
And I press the "Add Group" button | ||
And I fill in "Group name" with "" | ||
And I press the "Create" button | ||
Then I should see "Validation Error" | ||
|
||
Scenario: Members of a group without permissions cannot view draft content | ||
Given I go to "/Security/login" | ||
And I press the "Log in as someone else" button | ||
And I am logged in with "BOB" permissions | ||
When I go to "/my-page?stage=Stage" | ||
Then I should not see "My page" | ||
|
||
Scenario: Members of a group with relevant permissions can view draft content | ||
Given I go to "/Security/login" | ||
And I press the "Log in as someone else" button | ||
And I am logged in with "Jane" permissions | ||
When I go to "/my-page?stage=Stage" | ||
Then I should see "My page" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,49 +131,3 @@ Feature: Manage users | |
And I press the "Delete" button, confirming the dialog | ||
Then I should see "[email protected]" | ||
And I should not see "[email protected]" | ||
|
||
Scenario: User group | ||
|
||
Given the "group" "BOB group" | ||
And the "page" "My page" has the "Content" "<p>My content</p>" | ||
|
||
# Login to create BOB member | ||
When I go to "/Security/login" | ||
And I press the "Log in as someone else" button | ||
And I am logged in with "BOB" permissions | ||
|
||
# BOB cannot view draft content | ||
When I go to "/my-page?stage=Stage" | ||
Then I should not see "My page" | ||
|
||
# Log back in as ADMIN | ||
When I go to "/Security/login" | ||
And I press the "Log in as someone else" button | ||
And I am logged in with "ADMIN" permissions | ||
|
||
# Create a user group | ||
And I go to "/admin/security" | ||
And I click the "Groups" CMS tab | ||
And I press the "Add Group" button | ||
And I fill in "Group name" with "MyGroup" | ||
And I press the "Create" button | ||
|
||
# Assign various permissions to the group | ||
And I click the "Permissions" CMS tab | ||
And I check "View draft content" | ||
And I press the "Save" button | ||
|
||
# Users that belong to that group have permissions applied | ||
And I click the "Members" CMS tab | ||
And I fill in "Form_ItemEditForm_gridfield_relationsearch" with "BOB" | ||
And I click on the ".ui-menu-item > a" element | ||
And I click on the "#Form_ItemEditForm_action_gridfield_relationadd" element | ||
|
||
# Log back in as BOB | ||
Given I go to "/Security/login" | ||
And I press the "Log in as someone else" button | ||
And I am logged in with "BOB" permissions | ||
|
||
# BOB can now view draft content | ||
When I go to "/my-page?stage=Stage" | ||
Then I should see "My page" |