2013-06-07 05:04:43 +02:00
|
|
|
Feature: Publish a page
|
2016-02-15 02:58:24 +01:00
|
|
|
As a site owner
|
|
|
|
I want content to go to a draft site before being published
|
|
|
|
So that only high quality changes are seen by our visitors
|
|
|
|
|
|
|
|
Background:
|
|
|
|
Given a "page" "My Page" with "URLSegment"="my-page" and "Content"="<p>initial content</p>"
|
|
|
|
And the "page" "My Page" is not published
|
2022-09-05 22:44:46 +02:00
|
|
|
And the "group" "EDITOR" has permissions "Access to 'Pages' section"
|
|
|
|
And I am logged in as a member of "EDITOR" group
|
2016-02-15 02:58:24 +01:00
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: I can have a unpublished version of a page that is not publicly available
|
|
|
|
Given I go to "/my-page"
|
|
|
|
Then the page can't be found
|
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: I can publish a previously never published page
|
2022-09-05 22:44:46 +02:00
|
|
|
Given I go to "/admin/pages"
|
2016-02-15 02:58:24 +01:00
|
|
|
And I should see "My Page" in the tree
|
|
|
|
And I click on "My Page" in the tree
|
2018-02-09 00:18:57 +01:00
|
|
|
And I press the "Publish" button
|
2016-02-15 02:58:24 +01:00
|
|
|
|
2017-06-27 07:21:55 +02:00
|
|
|
Then I am not logged in
|
2016-02-15 02:58:24 +01:00
|
|
|
And I go to "/my-page"
|
|
|
|
|
|
|
|
Then I should see "initial content"
|
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: I will get different options depending on the current publish state of the page
|
2022-09-05 22:44:46 +02:00
|
|
|
Given I go to "/admin/pages"
|
2016-02-15 02:58:24 +01:00
|
|
|
And I should see "My Page" in the tree
|
|
|
|
And I click on "My Page" in the tree
|
|
|
|
|
|
|
|
When I click "More options" in the "#ActionMenus" element
|
2017-01-10 02:40:28 +01:00
|
|
|
Then I should see "Not published" in the "#ActionMenus_MoreOptions" element
|
|
|
|
And I should not see an "Unpublish" button
|
|
|
|
And I should see an "Archive" button
|
2018-02-09 00:18:57 +01:00
|
|
|
And I should see a "Publish" button
|
2016-02-15 02:58:24 +01:00
|
|
|
And I should see a "Saved" button
|
|
|
|
|
|
|
|
When I fill in the "Content" HTML field with "<p>my new content</p>"
|
|
|
|
And I click "More options" in the "#ActionMenus" element
|
2017-01-10 02:40:28 +01:00
|
|
|
Then I should not see an "Unpublish" button
|
2018-02-09 00:18:57 +01:00
|
|
|
And I should see a "Publish" button
|
|
|
|
And I should see a "Save" button
|
2016-02-15 02:58:24 +01:00
|
|
|
|
2018-02-09 00:18:57 +01:00
|
|
|
When I press the "Publish" button
|
2016-02-15 02:58:24 +01:00
|
|
|
And I click "More options" in the "#ActionMenus" element
|
2017-01-10 02:40:28 +01:00
|
|
|
Then I should see an "Unpublish" button
|
|
|
|
And I should see an "Unpublish and archive" button
|
2016-02-15 02:58:24 +01:00
|
|
|
And I should see a "Published" button
|
|
|
|
And I should see a "Saved" button
|
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: I can unpublish a page
|
|
|
|
Given a "page" "Hello" with "URLSegment"="hello" and "Content"="<p>hello world</p>"
|
|
|
|
And I go to "/hello"
|
|
|
|
Then I should see "hello world"
|
|
|
|
|
|
|
|
And I go to "/admin/pages"
|
|
|
|
And I should see "Hello" in the tree
|
|
|
|
And I click on "Hello" in the tree
|
|
|
|
|
|
|
|
When I click "More options" in the "#ActionMenus" element
|
|
|
|
And I press the "Unpublish" button, confirming the dialog
|
|
|
|
|
2017-06-27 07:21:55 +02:00
|
|
|
Then I am not logged in
|
2016-02-15 02:58:24 +01:00
|
|
|
And I go to "/hello"
|
|
|
|
Then the page can't be found
|
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: I can delete a page from live and draft stage to completely remove it
|
2022-09-05 22:44:46 +02:00
|
|
|
Given I go to "/admin/pages"
|
2016-02-15 02:58:24 +01:00
|
|
|
And I should see "My Page" in the tree
|
|
|
|
And I click on "My Page" in the tree
|
2018-02-09 00:18:57 +01:00
|
|
|
And I press the "Publish" button
|
2016-02-15 02:58:24 +01:00
|
|
|
And I click "More options" in the "#ActionMenus" element
|
2017-01-10 02:40:28 +01:00
|
|
|
Then I should see an "Unpublish" button
|
2016-02-15 02:58:24 +01:00
|
|
|
|
|
|
|
When I press the "Unpublish" button, confirming the dialog
|
|
|
|
And I click "More options" in the "#ActionMenus" element
|
2021-03-18 03:15:16 +01:00
|
|
|
# Use a css-selector instead of the the "Archive" button otherwise it will get confused with
|
|
|
|
# the "Archive" model admin
|
|
|
|
Then I see the "#Form_EditForm_action_archive" element
|
2021-04-15 03:42:45 +02:00
|
|
|
When I click on the "#Form_EditForm_action_archive" element, confirming the dialog
|
2016-02-15 02:58:24 +01:00
|
|
|
|
|
|
|
Then I should see a "Restore" button
|
|
|
|
And I should not see a "Published" button
|
2018-02-09 00:18:57 +01:00
|
|
|
And I should not see a "Publish" button
|
2016-02-15 02:58:24 +01:00
|
|
|
And I should not see a "Saved" button
|
2018-02-09 00:18:57 +01:00
|
|
|
And I should not see a "Save" button
|
2016-02-15 02:58:24 +01:00
|
|
|
|
|
|
|
When I press the "Restore" button, confirming the dialog
|
2018-02-09 00:18:57 +01:00
|
|
|
Then I should see a "Publish" button
|