From 7ec7a263c09e865e70cf19b5f934281d41b54744 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 13 Sep 2013 18:46:23 +0200 Subject: [PATCH] Behat scenarios for page permissions and search (steps only) Actual step implementation not done yet --- .../features/manage-page-permisions.feature | 56 +++++++++++++++++++ .../behat/features/search-for-a-page.feature | 51 ++++++++++++++--- 2 files changed, 98 insertions(+), 9 deletions(-) create mode 100644 tests/behat/features/manage-page-permisions.feature diff --git a/tests/behat/features/manage-page-permisions.feature b/tests/behat/features/manage-page-permisions.feature new file mode 100644 index 00000000..d606d076 --- /dev/null +++ b/tests/behat/features/manage-page-permisions.feature @@ -0,0 +1,56 @@ +@todo +Feature: Manage global 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 + +Background: + Given I have an "Administrator" user in a "Administrators" Security Group + Given I have an "Content Author" user in a "Content Authors" Security Group + And I am logged in as an "ADMIN" + And I navigate to the "Settings" CMS section + +Scenario: I can open global view permissions to everyone + Given I select the 'Access' tab + And I select "Anyone" in the 'Who can view pages on this site?' field + And press the "Save" button + When I visit the homepage without being logged in + Then I can see "Welcome" + +Scenario: I can limit global view permissions to logged-in users + Given I select the 'Access' tab + And I select "Logged-in users" in 'Who can view pages on this site?' + And press the 'Save' button + When I visit the homepage without being logged in + Then I am redirected to the log-in page + When I visit the homepage as "Content Author" + Then I can see "Welcome" + +Scenario: I can limit global view permissions to certain groups + Given I select the 'Access' tab + And I select "Only these people (choose from list)" in 'Who can view pages on this site?' + And I select "Administrators" in the "Viewer Groups" dropdown + And press the 'Save' button + When I visit the homepage without being logged in + Then I am redirected to the log-in page + When I visit the homepage as "Content Author" + Then I am redirected to the log-in page + When I visit the homepage as "Administrator" + Then I can see "Welcome" + +Scenario: I can limit global edit permissions to logged-in users + Given I select the 'Access' tab + And I select "Logged-in users" in 'Who can edit pages on this site?' + And press the 'Save' button + Then pages should be editable by "Content Authors" + And pages should be editable by "Administrators" + +Scenario: I can limit global edit permissions to certain groups + Given I select the 'Access' tab + And I select "Only these people (choose from list)" in 'Who can edit pages on this site?' + And I select "Administrators" in the "Viewer Groups" dropdown + And press the 'Save' button + Then pages should not be editable by "Content Authors" + But pages should be editable by "Administrators" + + \ No newline at end of file diff --git a/tests/behat/features/search-for-a-page.feature b/tests/behat/features/search-for-a-page.feature index 48aac0fd..b036e324 100644 --- a/tests/behat/features/search-for-a-page.feature +++ b/tests/behat/features/search-for-a-page.feature @@ -4,18 +4,51 @@ Feature: Search for a page So that I can efficiently navigate nested content structures Background: - Given a "page" "About Us" + Given a "page" "Home" + And a "page" "About Us" And a "page" "Contact Us" - - @javascript - Scenario: I can search for a page by its title - Given I am logged in with "ADMIN" permissions + And I am logged in with "ADMIN" permissions And I go to "/admin/pages" - Then I should see "About Us" in CMS Tree - And I should see "Contact Us" in CMS Tree + And I expand the "Filter" CMS Panel - When I expand the "Filter" CMS Panel - And I fill in "Content" with "About Us" + Scenario: I can search for a page by its title + Given I fill in "Content" with "About Us" And I press the "Apply Filter" button Then I should see "About Us" in CMS Tree But I should not see "Contact Us" in CMS Tree + + @todo + Scenario: I can search for a page by its type + Given a "page" "My Error Page" of type "Error Page" + And I fill in "Page Type" with "Redirector Page" + And I press the "Apply Filter" button + Then I should see "My Error Page" in CMS Tree + But I should not see "Contact Us" in CMS Tree + + @todo + Scenario: I can search for a page by its oldest last edited date + Given a "page" "Recent Page" + And a "page" "Old Page" was last edited 7 days ago + When I fill in "From" with "5 days ago" + And I press the "Apply Filter" button + Then I should see "Recent Page" in CMS Tree + But I should not see "Old Page" in CMS Tree + + @todo + Scenario: I can search for a page by its newest last edited date + Given a "page" "Recent Page" + And a "page" "Old Page" was last edited 7 days ago + When I fill in "To" with "5 days ago" + And I press the "Apply Filter" button + Then I should not see "Recent Page" in CMS Tree + But I should see "Old Page" in CMS Tree + + @todo + Scenario: I can include deleted pages in my search + Given a "page" "Deleted Page" + And the "page" "Old Page" is deleted + When I press the "Apply Filter" button + Then I should not see "Deleted Page" in CMS Tree + When I fill in "Pages" with "All pages, including deleted" + And I press the "Apply Filter" button + Then I should see "Deleted Page" in CMS Tree \ No newline at end of file