From 4bc1bd64fc502f46886822d512ad07c32812a2e0 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Mon, 17 Jul 2017 13:31:14 +1200 Subject: [PATCH] Add tests for page level edit and view permission settings --- .../features/manage-page-permissions.feature | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/tests/behat/features/manage-page-permissions.feature b/tests/behat/features/manage-page-permissions.feature index 8e89c3d3..5af1dde4 100644 --- a/tests/behat/features/manage-page-permissions.feature +++ b/tests/behat/features/manage-page-permissions.feature @@ -1,25 +1,28 @@ -Feature: Manage global page permissions +Feature: Manage page permissions As an administrator - I want to manage view and edit permission defaults on pages - In order to set good defaults and avoid repeating myself on each page + I want to manage view and edit permissions on pages + In order to allow certain groups of people to view or edit a given page Background: Given a "page" "Home" with "Content"="

Welcome

" And a "group" "AUTHOR group" has permissions "Access to 'Pages' section" And a "group" "SECURITY group" has permissions "Access to 'Security' section" And I am logged in with "ADMIN" permissions - And I go to "admin/settings" - And I click the "Access" CMS tab + And I go to "/admin/pages" + And I click on "Home" in the tree + Then I should see an edit page form + And I click the "Settings" CMS tab - Scenario: I can open global view permissions to everyone - Given I select "Anyone" from "Who can view pages on this site?" input group - And I press the "Save" button - When I am not logged in - And I go to the homepage - Then I should see "Welcome" + # BUG: https://github.com/silverstripe/silverstripe-cms/issues/1897 + # Scenario: I can open view permissions to everyone + # Given I select "Anyone" from "Who can view this page?" input group + # And I press the "Save" button + # When I am not logged in + # And I go to the homepage + # Then I should see "Welcome" - Scenario: I can limit global view permissions to logged-in users - Given I select "Logged-in users" from "Who can view pages on this site?" input group + Scenario: I can limit page view permissions to logged-in users + Given I select "Logged-in users" from "Who can view this page?" input group And I press the "Save" button When I am not logged in And I go to the homepage @@ -28,8 +31,8 @@ Feature: Manage global page permissions And I go to the homepage Then I should see "Welcome" - Scenario: I can limit global view permissions to certain groups - Given I select "Only these groups (choose from list)" from "Who can view pages on this site?" input group + Scenario: I can limit page view permissions to certain groups + Given I select "Only these groups (choose from list)" from "Who can view this page?" input group And I select "AUTHOR group" from "Viewer Groups" with javascript And I press the "Save" button When I am not logged in @@ -43,14 +46,14 @@ Feature: Manage global page permissions And I go to the homepage Then I should see "Welcome" - Scenario: I can limit global edit permissions to logged-in users - Given I select "Anyone who can log-in to the CMS" from "Who can edit pages on this site?" input group + Scenario: I can limit page edit permissions to logged-in users + Given I select "Logged-in users" from "Who can edit this page?" input group And I press the "Save" button Then pages should be editable by "AUTHOR" And pages should be editable by "ADMIN" - Scenario: I can limit global edit permissions to certain groups - Given I select "Only these groups (choose from list)" from "Who can edit pages on this site?" input group + Scenario: I can limit page edit permissions to certain groups + Given I select "Only these groups (choose from list)" from "Who can edit this page?" input group And I select "ADMIN group" from "Editor Groups" with javascript And I press the "Save" button Then pages should not be editable by "AUTHOR"