-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add behat feature for listing versions (History Viewer)
- Loading branch information
1 parent
463eb90
commit 4f5122b
Showing
4 changed files
with
162 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@javascript | ||
Feature: View a list of versions | ||
As a cms author | ||
I want to view a list past revisions of a versioned DataObject (incl. pages) | ||
|
||
Background: | ||
# Test date cannot be in the past or the version list numbers won't be descending | ||
Given the current date is "2100-01-01" | ||
Given a "page" "Home" with "Content"="Background" | ||
|
||
Given I am logged in with "ADMIN" permissions | ||
And I go to "/admin/pages" | ||
And I click on "Home" in the tree | ||
|
||
Scenario: A list of versions is displayed | ||
Given I click on "History" in the header tabs | ||
Then I should see a list of versions | ||
|
||
Scenario: List shows the publish state, publish date and the author | ||
Given I should see an edit page form | ||
When I fill in the "Content" HTML field with "<p>Publish scenario</p>" | ||
And I press the "Publish" button | ||
Then I should see a "Published 'Home' successfully." notice | ||
# This is a workaround @todo remove when https://github.com/silverstripe/silverstripe-cms/issues/2128 is resolved in framework | ||
And I go to "/admin/pages/history/show/1" | ||
Then I should see a list of versions | ||
And I should see "ADMIN User" in the author column in version 1 | ||
And I should see "Published" in the record column in version 1 | ||
And I should see "01/01/2100" in the record column in version 1 | ||
And I should see the "Live" badge | ||
|
||
Scenario: List shows the draft state, draft date and the author | ||
Given I should see an edit page form | ||
When I fill in the "Content" HTML field with "<p>Save scenario</p>" | ||
And I press the "Save" button | ||
Then I should see a "Saved 'Home' successfully." notice | ||
# This is a workaround @todo remove when https://github.com/silverstripe/silverstripe-cms/issues/2128 is resolved in framework | ||
And I go to "/admin/pages/history/show/1" | ||
Then I should see a list of versions | ||
And I should see "ADMIN User" in the author column in version 1 | ||
And I should see "Saved" in the record column in version 1 | ||
And I should see "01/01/2100" in the record column in version 1 | ||
And I should not see the "Live" badge | ||
|
||
Scenario: Revisions are ordered descending by date | ||
Given I should see an edit page form | ||
When I fill in the "Content" HTML field with "<p>Order scenario</p>" | ||
And I press the "Publish" button | ||
Then I should see a "Published 'Home' successfully." notice | ||
# This is a workaround @todo remove when https://github.com/silverstripe/silverstripe-cms/issues/2128 is resolved in framework | ||
And I go to "/admin/pages/history/show/1" | ||
Then I should see a list of versions in descending order |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters