-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #469 from creative-commoners/pulls/2.4/behat
MNT Update behat tests
- Loading branch information
Showing
6 changed files
with
95 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
@javascript | ||
Feature: Create and select a subsite | ||
As a CMS user | ||
I want to be able to select a subsite | ||
So that I can edit content for a specific subsite | ||
|
||
Background: | ||
# There's a bug where you need CMS_ACCESS_CMSMain rather than CMS_ACCESS_LeftAndMain permissions to | ||
# use subsites as expected | ||
# Given the "group" "EDITOR group" has permissions "CMS_ACCESS_LeftAndMain" and "FILE_EDIT_ALL" | ||
Given the "group" "EDITOR group" has permissions "CMS_ACCESS_CMSMain" and "CMS_ACCESS_AssetAdmin" and "FILE_EDIT_ALL" | ||
And a "page" "My page" with "URLSegment"="my-page", "Content"="My page content" | ||
And an "image" "file1.jpg" | ||
And an "image" "file2.jpg" | ||
|
||
Scenario: I can operate subsites | ||
|
||
# Create subsite as Admin | ||
Given I am logged in with "ADMIN" permissions | ||
Then I go to "admin/subsites" | ||
|
||
# Add subsites button is not a regular button, so click using css selector | ||
And I click on the ".btn-toolbar .btn__title" element | ||
And I fill in "Subsite Name" with "My subsite" | ||
And I press "Create" | ||
|
||
# Add a file to the main site | ||
When I go to "admin/assets" | ||
And I press the "Add folder" button | ||
And I select "Main site" from "SubsitesSelect" | ||
# Using a short folder name so that it doesn't get truncated on the frontend | ||
And I fill in "Folder name" with "mfol" | ||
And I press the "Create" button | ||
When I go to "admin/assets" | ||
|
||
And I click on the file named "mfol" in the gallery | ||
And I attach the file "file1.jpg" to dropzone "gallery-container" | ||
|
||
# Change to Editor user | ||
When I go to "/Security/login" | ||
And I press the "Log in as someone else" button | ||
When I am logged in with "EDITOR" permissions | ||
And I go to "admin/pages" | ||
|
||
# Can see main site page on main site | ||
When I go to "admin/pages" | ||
Then I should see "My page" in the tree | ||
|
||
# Cannot see main site page on subsite | ||
When I select "My subsite" from "SubsitesSelect" | ||
And I go to "admin/pages" | ||
Then I should not see "My page" in the tree | ||
|
||
# Create a page on the subsite | ||
When I press the "Add new" button | ||
And I select the "Page" radio button | ||
And I press the "Create" button | ||
When I fill in "Page name" with "My subsite page" | ||
And I press the "Publish" button | ||
Then I should see "My subsite page" | ||
|
||
# Can see main site folders/files from subsite | ||
When I go to "admin/assets" | ||
Then I should see "mfol" | ||
When I click on the file named "mfol" in the gallery | ||
Then I should see "file1" | ||
|
||
# Add a file to the subsite | ||
When I go to "admin/assets" | ||
And I select "My subsite" from "SubsitesSelect" | ||
And I press the "Add folder" button | ||
And I fill in "Folder name" with "sfol" | ||
And I press the "Create" button | ||
When I go to "admin/assets" | ||
And I click on the file named "sfol" in the gallery | ||
And I attach the file "file2.jpg" to dropzone "gallery-container" | ||
|
||
# Change back to main subsite - cannot see subsite folders/files | ||
When I go to "admin/assets" | ||
And I select "Main site" from "SubsitesSelect" | ||
Then I should see "mfol" | ||
Then I should not see "My subsite page" |
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 |
---|---|---|
|
@@ -4,18 +4,19 @@ Feature: Preview navigation | |
In order to preview my content | ||
|
||
Background: | ||
Given a "subsite" "My subsite" | ||
And a "page" "My page" with "URLSegment"="my-page", "Content"="My page content <a name='aname'>aname</a><a href='other-page'>ahref</a>" and "Subsite"="=>SilverStripe\Subsites\Model\Subsite.My subsite" | ||
And a "page" "Other page" with "URLSegment"="other-page", "Content"="Other page content <a href='my-page'>Goto my page></a>" and "Subsite"="=>SilverStripe\Subsites\Model\Subsite.My subsite" | ||
Given a "member" "Joe" belonging to "Admin Group" with "Email"="[email protected]" and "Password"="Password1" | ||
And the "group" "Admin Group" has permissions "Full administrative rights" | ||
And I log in with "[email protected]" and "Password1" | ||
Given a "subsite" "MySubsite" | ||
And a "page" "My page" with "URLSegment"="my-page", "Content"="My page content <a name='aname'>aname</a> <a href='[sitetree_link,id=5]'>ahref</a>" and "SubsiteID"="1" | ||
And a "page" "Other page" with "URLSegment"="other-page", "Content"="Other page content <a href='[sitetree_link,id=4]'>Goto my page</a>" and "SubsiteID"="1" | ||
|
||
@javascript | ||
Scenario: I can navigate the subsite preview | ||
When I go to "admin" | ||
And I select "My subsite" from "SubsitesSelect" | ||
And I go to "admin/pages" | ||
Given I am logged in with "ADMIN" permissions | ||
When I go to "/admin/pages" | ||
And I select "MySubsite" from "SubsitesSelect" | ||
And I click on "My page" in the tree | ||
And I press the "Publish" button | ||
And I click on "Other page" in the tree | ||
And I press the "Publish" button | ||
And I click on "My page" in the tree | ||
And I set the CMS mode to "Preview mode" | ||
And I follow "ahref" in preview | ||
|
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.