-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Behat feature and (context) to view a list of versions in History Viewer #14
Merged
robbieaverill
merged 2 commits into
silverstripe:master
from
creative-commoners:pulls/1.0/view-a-list-behat
May 10, 2018
+160
−6
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add
And I should not see the "Live" badge
to ensure it doesn't show up when nothing is published yet? We can modify the regex for theAnd I should see the :arg badge
step definition to support an optionalnot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, but I am having trouble getting it to work at the moment. Below my approach:
How important do you reckon this is at this stage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to name the regex capture group for it to be assigned to a variable, e.g.: