2012-11-09 19:15:54 +01:00
|
|
|
Feature: Preview a page
|
|
|
|
As an author
|
|
|
|
I want to preview the page I'm editing in the CMS
|
|
|
|
So that I can see how it would look like to my visitors
|
|
|
|
|
2013-06-05 13:30:15 +02:00
|
|
|
Background:
|
2013-06-05 14:18:07 +02:00
|
|
|
Given a "page" "About Us"
|
2013-06-05 13:30:15 +02:00
|
|
|
|
2012-11-09 19:15:54 +01:00
|
|
|
@javascript
|
|
|
|
Scenario: I can show a preview of the current page from the pages section
|
|
|
|
Given I am logged in with "ADMIN" permissions
|
|
|
|
And I go to "/admin/pages"
|
|
|
|
Then I should see "About Us" in CMS Tree
|
|
|
|
|
|
|
|
When I follow "About Us"
|
2012-12-10 18:09:09 +01:00
|
|
|
And I set the CMS mode to "Preview mode"
|
2012-11-09 19:15:54 +01:00
|
|
|
Then I can see the preview panel
|
|
|
|
And the preview contains "About Us"
|
2013-04-09 09:38:46 +02:00
|
|
|
Then I set the CMS mode to "Edit mode"
|
2012-11-09 19:15:54 +01:00
|
|
|
|
|
|
|
# TODO:
|
|
|
|
# - Only tests correctly on fresh database
|
|
|
|
# - We should continue testing against it after we have fixtures ready
|
|
|
|
@javascript
|
|
|
|
Scenario: I can see an updated preview when editing content
|
|
|
|
Given I am logged in with "ADMIN" permissions
|
|
|
|
And I go to "/admin/pages"
|
|
|
|
Then I should see "About Us" in CMS Tree
|
|
|
|
|
|
|
|
When I follow "About Us"
|
2013-06-07 00:52:12 +02:00
|
|
|
And I fill in the "Content" HTML field with "first content"
|
|
|
|
And I press the "Publish" button
|
2012-12-10 15:38:32 +01:00
|
|
|
And I fill in the "Content" HTML field with "my new content"
|
2013-06-05 14:18:07 +02:00
|
|
|
And I press the "Save draft" button
|
2012-12-10 18:09:09 +01:00
|
|
|
And I set the CMS mode to "Preview mode"
|
2012-11-09 19:15:54 +01:00
|
|
|
|
2012-12-10 18:09:09 +01:00
|
|
|
When I switch the preview to "Published"
|
2012-11-09 19:15:54 +01:00
|
|
|
Then the preview does not contain "my new content"
|
2013-06-07 00:52:12 +02:00
|
|
|
And the preview contains "first content"
|
2012-11-09 19:15:54 +01:00
|
|
|
|
2012-12-10 18:09:09 +01:00
|
|
|
When I switch the preview to "Draft"
|
2013-06-07 00:52:12 +02:00
|
|
|
Then the preview does not contain "first content"
|
2012-11-09 19:15:54 +01:00
|
|
|
And the preview contains "my new content"
|
|
|
|
|
2012-12-10 18:09:09 +01:00
|
|
|
And I set the CMS mode to "Edit mode"
|
2012-11-09 19:15:54 +01:00
|
|
|
Then I should see an edit page form
|