-
Notifications
You must be signed in to change notification settings - Fork 116
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 #344 from creative-commoners/pulls/refactor-behat-…
…tests-with-new-fixture-magic-added Refactor Behat tests
- Loading branch information
Showing
8 changed files
with
180 additions
and
89 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
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
@javascript | ||
Feature: Add elements in the CMS | ||
As a CMS user | ||
I want to add elements in the CMS | ||
So that I can use multiple elements on a page | ||
|
||
Background: | ||
Given I add an extension "DNADesign\Elemental\Extensions\ElementalPageExtension" to the "Page" class | ||
And a "page" "Blocks Page" with a "Alice's Block" content element with "Some content" content | ||
And the "page" "Blocks Page" has a "Bob's Block" content element with "Some content II" content | ||
|
||
Given I am logged in with "ADMIN" permissions | ||
# Remove with 'And I click "Blocks Page" in the ".breadcrumbs-wrapper" element' once the ElementalArea refreshes, | ||
# See https://github.com/dnadesign/silverstripe-elemental/issues/320 | ||
And I go to "/admin/pages/edit/show/6" | ||
And I wait until I see the ".element-editor__element" element | ||
Then I should see "Alice's Block" | ||
And I should see "Bob's Block" | ||
|
||
Scenario: I can add elements to the page | ||
Given I wait until I see the ".element-editor__element" element | ||
When I select "Content" from "elemental-editor_add-new-block-control_select-dropdown" | ||
And I click "Add" in the ".elemental-editor__add-new-block-control" element | ||
And I fill in "Eve's Block" for "Title" | ||
And I fill in "<p>Some content III</p>" for the "HTML" HTML field | ||
And I press the "Create" button | ||
Then I should see a "Saved content block" message | ||
|
||
When I go to "/admin/pages/edit/show/6" | ||
And I wait until I see the ".element-editor__element" element | ||
And I wait 1 second | ||
Then I should see "Eve's Block" |
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,33 @@ | ||
@javascript | ||
Feature: Archive elements in the CMS | ||
As a CMS user | ||
I want to archive elements in the CMS | ||
So that I can remove elements I have used on a page | ||
|
||
|
||
Background: | ||
Given I add an extension "DNADesign\Elemental\Extensions\ElementalPageExtension" to the "Page" class | ||
And a "page" "Blocks Page" with a "Alice's Block" content element with "Some content" content | ||
And the "page" "Blocks Page" has a "Bob's Block" content element with "Some content II" content | ||
|
||
Given I am logged in with "ADMIN" permissions | ||
# Remove with 'And I click "Blocks Page" in the ".breadcrumbs-wrapper" element' once the ElementalArea refreshes, | ||
# See https://github.com/dnadesign/silverstripe-elemental/issues/320 | ||
And I go to "/admin/pages/edit/show/6" | ||
And I wait until I see the ".element-editor__element" element | ||
Then I should see "Alice's Block" | ||
And I should see "Bob's Block" | ||
|
||
@modal | ||
Scenario: I can archive a block | ||
Given I wait until I see the ".element-editor__element" element | ||
When I press the "View actions" button | ||
Then I should see the archive button for block 1 | ||
When I press the "Archive" button | ||
And I see the text "Are you sure you want to send this block to the archive?" in the alert | ||
And I confirm the dialog | ||
# Sometimes behat can be quicker than the time it takes the JS to remove the row... | ||
And I wait 1 second | ||
And I wait until I see the ".element-editor__element" element | ||
Then I should see "Bob's Block" | ||
But I should not see "Alice's Block" |
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,36 @@ | ||
@javascript | ||
Feature: Edit elements in the CMS | ||
As a CMS user | ||
I want to edit elements in the CMS | ||
So that I can modify elements I have used on a page | ||
|
||
Background: | ||
Given I add an extension "DNADesign\Elemental\Extensions\ElementalPageExtension" to the "Page" class | ||
And a "page" "Blocks Page" with a "Alice's Block" content element with "Some content" content | ||
And the "page" "Blocks Page" has a "Bob's Block" content element with "Some content II" content | ||
|
||
Given I am logged in with "ADMIN" permissions | ||
# Remove with 'And I click "Blocks Page" in the ".breadcrumbs-wrapper" element' once the ElementalArea refreshes, | ||
# See https://github.com/dnadesign/silverstripe-elemental/issues/320 | ||
And I go to "/admin/pages/edit/show/6" | ||
And I wait until I see the ".element-editor__element" element | ||
Then I should see "Alice's Block" | ||
And I should see "Bob's Block" | ||
|
||
Scenario: I can edit a non in-line editable block | ||
Given content blocks are not in-line editable | ||
And I go to "/admin/pages/edit/show/6" | ||
And I wait until I see the ".element-editor__element" element | ||
Then I should see block 1 | ||
|
||
Given I click on block 1 | ||
Then I should see "Alice's Block" | ||
And the "HTML" HTML field should contain "Some content" | ||
|
||
Given I fill in "Eve's Block" for "Title" | ||
And I fill in "<p>New sample content</p>" for the "HTML" HTML field | ||
And I press the "Publish" button | ||
Then I should see a "Published content block" message | ||
When I go to "/admin/pages/edit/show/6" | ||
Then I should see "Eve's Block" | ||
But I should not see "Alice's Block" |
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