Fixing up scenarios for managing page permissions Behat tests.

Relies on changes from silverstripe-behat-extension:

silverstripe-behat-extension/pull/15
silverstripe-behat-extension/pull/14
silverstripe-behat-extension/pull/13
silverstripe-behat-extension/pull/12
This commit is contained in:
Sean Harvey 2013-11-28 23:22:44 +13:00 committed by Ingo Schommer
parent 6804461539
commit a79ac87e2b

View File

@ -1,56 +1,60 @@
@todo
Feature: Manage global page permissions Feature: Manage global page permissions
As an administrator As an administrator
I want to manage view and edit permission defaults on pages I want to manage view and edit permission defaults on pages
In order to set good defaults and avoid repeating myself on each page In order to set good defaults and avoid repeating myself on each page
Background: Background:
Given I have an "Administrator" user in a "Administrators" Security Group Given a "page" "Home" with "Content"="Welcome"
Given I have an "Content Author" user in a "Content Authors" Security Group And a "group" "AUTHOR group" has permissions "Access to 'Pages' section"
And I am logged in as an "ADMIN" And a "group" "SECURITY group" has permissions "Access to 'Security' section"
And I navigate to the "Settings" CMS section And I am logged in with "ADMIN" permissions
And I go to "admin/settings"
And I click the "Access" CMS tab
Scenario: I can open global view permissions to everyone Scenario: I can open global view permissions to everyone
Given I select the 'Access' tab Given I select "Anyone" from "Who can view pages on this site?" input group
And I select "Anyone" in the 'Who can view pages on this site?' field And I press the "Save" button
And press the "Save" button When I am not logged in
When I visit the homepage without being logged in And I go to the homepage
Then I can see "Welcome" Then I should see "Welcome"
Scenario: I can limit global view permissions to logged-in users Scenario: I can limit global view permissions to logged-in users
Given I select the 'Access' tab Given I select "Logged-in users" from "Who can view pages on this site?" input group
And I select "Logged-in users" in 'Who can view pages on this site?' And I press the "Save" button
And press the 'Save' button When I am not logged in
When I visit the homepage without being logged in And I go to the homepage
Then I am redirected to the log-in page Then I should see a log-in form
When I visit the homepage as "Content Author" When I am logged in with "AUTHOR" permissions
Then I can see "Welcome" And I go to the homepage
Then I should see "Welcome"
Scenario: I can limit global view permissions to certain groups Scenario: I can limit global view permissions to certain groups
Given I select the 'Access' tab Given I select "Only these people (choose from list)" from "Who can view pages on this site?" input group
And I select "Only these people (choose from list)" in 'Who can view pages on this site?' And I select "AUTHOR group" from "Viewer Groups"
And I select "Administrators" in the "Viewer Groups" dropdown And I press the "Save" button
And press the 'Save' button When I am not logged in
When I visit the homepage without being logged in And I go to the homepage
Then I am redirected to the log-in page Then I should see a log-in form
When I visit the homepage as "Content Author" When I am logged in with "SECURITY" permissions
Then I am redirected to the log-in page And I go to the homepage
When I visit the homepage as "Administrator" Then I will see a "warning" log-in message
Then I can see "Welcome" When I am not logged in
And I am logged in with "AUTHOR" permissions
And I go to the homepage
Then I should see "Welcome"
@todo
Scenario: I can limit global edit permissions to logged-in users Scenario: I can limit global edit permissions to logged-in users
Given I select the 'Access' tab Given I select "Logged-in users" in "Who can edit pages on this site?" input group
And I select "Logged-in users" in 'Who can edit pages on this site?' And I press the "Save" button
And press the 'Save' button
Then pages should be editable by "Content Authors" Then pages should be editable by "Content Authors"
And pages should be editable by "Administrators" And pages should be editable by "Administrators"
@todo
Scenario: I can limit global edit permissions to certain groups Scenario: I can limit global edit permissions to certain groups
Given I select the 'Access' tab Given I select "Only these people (choose from list)" from "Who can edit pages on this site?" input group
And I select "Only these people (choose from list)" in 'Who can edit pages on this site?' And I select "Administrators" from "Viewer Groups"
And I select "Administrators" in the "Viewer Groups" dropdown And I press the "Save" button
And press the 'Save' button
Then pages should not be editable by "Content Authors" Then pages should not be editable by "Content Authors"
But pages should be editable by "Administrators" But pages should be editable by "Administrators"