Skip to content

Commit

Permalink
Merge pull request #472 from m-tyrala/master
Browse files Browse the repository at this point in the history
EZP-29057 - Behat Covering of Content creation
  • Loading branch information
Łukasz Serwatka authored May 15, 2018
2 parents 20baceb + 6a57f68 commit 1072197
Show file tree
Hide file tree
Showing 70 changed files with 2,336 additions and 465 deletions.
7 changes: 6 additions & 1 deletion behat_suites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ adminui:
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\NavigationContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\AdministrationContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\ContentViewContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\UpdateContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\AdminUpdateContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\ContentUpdateContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\ContentPreviewContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\RightMenuContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\LeftMenuContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\NotificationContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\TrashContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\ContentTypeContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\RolesContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\SystemInfoContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\UDWContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\SectionsContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\ObjectStatesContext
- EzSystems\EzPlatformAdminUi\Behat\BusinessContext\DashboardContext
258 changes: 258 additions & 0 deletions features/ContentCreation.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
Feature: Content items creation
As an administrator
In order to menage content to my site
I want to create, edit, copy and move content items.

Background:
Given I am logged as "admin"
And I go to "Content structure" in "Content" tab

@javascript @common
Scenario: Content creation can be cancelled
When I start creating a new content "Article"
And I set content fields
| label | value |
| Title | Test Article |
And I click on the edit action bar button "Cancel"
Then I should be on content container page "eZ Platform" of type "Folder"
And there's no "Test Article" "Article" on "eZ Platform" Sub-items list

@javascript @common
Scenario: Content creation can be closed
When I start creating a new content "Article"
And I set content fields
| label | value |
| Title | Test Article |
And I click on the close button
Then I should be on content container page "eZ Platform" of type "Folder"
And there's no "Test Article" "Article" on "eZ Platform" Sub-items list

@javascript @common
Scenario: Content can be previewed during creation
When I start creating a new content "Article"
And I set content fields
| label | value |
| Title | Test Article2 |
| Intro | Test article2 intro |
And I click on the edit action bar button "Preview"
And I go to "tablet" view in "Test Article2" preview
And I go to "mobile" view in "Test Article2" preview
And I go to "desktop" view in "Test Article2" preview
And I go back from content "Test Article2" preview
Then I should be on "Content Update" "Test Article2" page
And content fields are set
| label | value |
| Title | Test Article2 |
| Intro | Test article2 intro |

@javascript @common
Scenario: Content draft can be saved
When I start creating a new content "Article"
And I set content fields
| label | value |
| Title | Test Article |
| Intro | Test article intro |
And I click on the edit action bar button "Save"
Then I should be on "Content Update" "Test Article" page
And success notification that "Content draft saved." appears
And going to dashboard we see there's draft "Test Article" on list

@javascript @common
Scenario: Content draft can be published
Given going to dashboard we see there's draft "Test Article2" on list
When I start editing content draft "Test Article2"
And I click on the edit action bar button "Publish"
Then I should be on content container page "Test Article2" of type "Article" in "eZ Platform"
And going to dashboard we see there's no draft "Test Article2" on list

@javascript @common
Scenario: Content draft can be deleted
Given going to dashboard we see there's draft "Test Article" on list
When I start editing content draft "Test Article"
And I set content fields
| label | value |
| Title | Test Article edited |
| Intro | Test article intro edited |
And I click on the edit action bar button "Delete draft"
Then I should be on content container page "eZ Platform" of type "Folder"
And going to dashboard we see there's no draft "Test Article edited" on list

@javascript @common
Scenario: Content can be published
When I start creating a new content "Article"
And I set content fields
| label | value |
| Title | Test Article |
| Intro | Test article intro |
And I click on the edit action bar button "Publish"
Then I should be on content container page "Test Article" of type "Article" in "eZ Platform"
And success notification that "Content published." appears
And content attributes equal
| label | value |
| Title | Test Article |
| Intro | Test article intro |

@javascript @common
Scenario: Content edit draft can be deleted
Given I navigate to content "Test Article" of type "Article" in "Home"
When I click on the edit action bar button "Edit"
And I set content fields
| label | value |
| Title | Test Article edited |
| Intro | Test article intro edited |
And I click on the edit action bar button "Delete draft"
Then I should be on content container page "Test Article" of type "Article" in "eZ Platform"
And going to dashboard we see there's no draft "Test Article edited" on list

@javascript @common
Scenario: Content draft can be edited from dashboard
Given I navigate to content "Test Article" of type "Article" in "Home"
And I click on the edit action bar button "Edit"
And I set content fields
| label | value |
| Title | Test Article edited |
| Intro | Test article intro edited |
And I click on the edit action bar button "Save"
And I click on the close button
And going to dashboard we see there's draft "Test Article edited" on list
When I start editing content draft "Test Article edited"
Then I should be on "Content Update" "Test Article edited" page

@javascript @common
Scenario: Content draft edition can be closed
Given going to dashboard we see there's draft "Test Article edited" on list
When I start editing content draft "Test Article edited"
And I set content fields
| label | value |
| Title | Test Article edited2 |
| Intro | Test article intro edited2 |
And I click on the close button
Then I should be on content container page "Test Article" of type "Article" in "eZ Platform"

@javascript @common
Scenario: Content edit draft can be saved
Given going to dashboard we see there's draft "Test Article edited" on list
When I start editing content draft "Test Article edited"
And I set content fields
| label | value |
| Title | Test Article edited2 |
| Intro | Test article intro edited2 |
And I click on the edit action bar button "Save"
Then I should be on "Content Update" "Test Article edited2" page
And success notification that "Content draft saved." appears
And going to dashboard we see there's draft "Test Article edited2" on list

@javascript @common
Scenario: Content draft can be created and published through draft list modal
Given I navigate to content "Test Article" of type "Article" in "Home"
When I click on the edit action bar button "Edit"
And I start creating new draft from draft conflict modal
And I set content fields
| label | value |
| Title | Test Article edited3 |
And I click on the edit action bar button "Publish"
Then I should be on content container page "Test Article edited3" of type "Article" in "eZ Platform"
And success notification that "Content published." appears
And content attributes equal
| label | value |
| Title | Test Article edited3 |
| Intro | Test article intro |

@javascript @common
Scenario: Content can be previewed during edition
Given I navigate to content "Test Article edited3" of type "Article" in "Home"
When I click on the edit action bar button "Edit"
And I click on the edit action bar button "Preview"
And I go to "tablet" view in "Test Article edited3" preview
And I go to "mobile" view in "Test Article edited3" preview
And I go to "desktop" view in "Test Article edited3" preview
And I go back from content "Test Article edited3" preview
Then I should be on "Content Update" "Test Article edited3" page
And content fields are set
| label | value |
| Title | Test Article edited3 |
| Intro | Test article intro |

@javascript @common
Scenario: Content draft from draft list modal can be published
Given I navigate to content "Test Article edited3" of type "Article" in "Home"
When I click on the edit action bar button "Edit"
And I start editing draft with ID "4" from draft conflict modal
And I set content fields
| label | value |
| Title | Test Article edited4 |
And I click on the edit action bar button "Publish"
Then I should be on content container page "Test Article edited4" of type "Article" in "eZ Platform"
And success notification that "Content published." appears
And content attributes equal
| label | value |
| Title | Test Article edited4 |
| Intro | Test article intro |

@javascript @common
Scenario: Content moving can be cancelled
Given I navigate to content "Test Article edited4" of type "Article" in "Home"
When I click on the edit action bar button "Move"
And I select content "Media/Images" through UDW
And I close the UDW window
Then I should be on content container page "Test Article edited4" of type "Article" in "eZ Platform"
And content attributes equal
| label | value |
| Title | Test Article edited4 |
| Intro | Test article intro |
And breadcrumb shows "eZ Platform/Test Article edited4" path

@javascript @common
Scenario: Content can be moved
Given I navigate to content "Test Article edited4" of type "Article" in "Home"
When I click on the edit action bar button "Move"
And I select content "Media/Images" through UDW
And I confirm the selection in UDW
Then I should be on content container page "Test Article edited4" of type "Article" in "Media/Images"
And success notification that "Location 'Test Article edited4' moved to location 'Images'" appears
And content attributes equal
| label | value |
| Title | Test Article edited4 |
| Intro | Test article intro |
And breadcrumb shows "Media/Images/Test Article edited4" path
And going to "Home" there is no "Test Article edited4" "Article" on Sub-items list

@javascript @common
Scenario: Content copying can be cancelled
Given I navigate to content "Test Article edited4" of type "Article" in "Media/Images"
When I click on the edit action bar button "Copy"
And I select content "eZ Platform" through UDW
And I close the UDW window
Then I should be on content container page "Test Article edited4" of type "Article" in "Media/Images"
And content attributes equal
| label | value |
| Title | Test Article edited4 |
| Intro | Test article intro |
And going to "Home" there is no "Test Article edited4" "Article" on Sub-items list

@javascript @common
Scenario: Content can be copied
Given I navigate to content "Test Article edited4" of type "Article" in "Media/Images"
When I click on the edit action bar button "Copy"
And I select content "eZ Platform" through UDW
And I confirm the selection in UDW
Then I should be on content container page "Test Article edited4" of type "Article" in "eZ Platform"
And success notification that "Location 'Test Article edited4' copied to location 'eZ Platform'" appears
And content attributes equal
| label | value |
| Title | Test Article edited4 |
| Intro | Test article intro |
And going to "Media/Images" there is a "Test Article edited4" "Article" on Sub-items list

@javascript @common
Scenario Outline: Content can be moved to trash
Given I navigate to content "<itemName>" of type "<itemType>" in "<path>"
When I send content to trash
Then there's no "<itemType>" "<itemName>" on "<folder>" Sub-items list
And going to trash there is "<itemType>" "<itemName>" on list

Examples:
| itemName | itemType | path | folder |
| Test Article edited4 | Article | Media/Images | Images |
| Test Article edited4 | Article | Home | Home |
| Test Article2 | Article | Home | Home |
50 changes: 28 additions & 22 deletions features/ContentType.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,22 @@ Feature: Content types management
Scenario: New Content Type can be added to Content Type Group
When I start creating new "Content Type" in "Content"
And I set fields
| label | value |
| Name | Test Content Type |
| Identifier | TestContentTypeIdentifier |
| Content name pattern | <name> |
And I add field "ezcountry" to Content Type definition
And I set "Name" in "ezcountry" to "CountryField"
| label | value |
| Name | Test Content Type |
| Identifier | TestContentTypeIdentifier |
| Content name pattern | <name> |
And I add field "Country" to Content Type definition
And I set "Name" in "Country" to "CountryField"
And I click on the edit action bar button "Save"
Then I should be on "Content Type" "Test Content Type" page
And Content Type has proper Global properties
| label | value |
| Name | Test Content Type |
| Identifier | TestContentTypeIdentifier |
| Content name pattern | <name> |
And Content Type "Test Content Type" has field "CountryField" of type "ezcountry"
| label | value |
| Name | Test Content Type |
| Identifier | TestContentTypeIdentifier |
| Content name pattern | <name> |
And Content Type "Test Content Type" has proper fields
| fieldName | fieldType |
| CountryField | ezcountry |
And notification that "Content type" "Test Content Type" is updated appears

@javascript @common
Expand All @@ -49,7 +51,9 @@ Feature: Content types management
Scenario: Changes can be discarded while editing Content type
Given there's "Test Content Type" on "Content" "Content Type Group" list
When I start editing "Content Type" "Test Content Type" from "Content"
And I set "Name" to "Test Content Type edited"
And I set fields
| label | value |
| Name | Test Content Type edited |
And I click on the edit action bar button "Discard changes"
Then I should be on "Content Type Group" "Content" page
And there's "Test Content Type" on "Content" "Content Type Group" list
Expand All @@ -59,20 +63,22 @@ Feature: Content types management
Scenario: New Field can be added while editing Content Type
Given there's "Test Content Type" on "Content" "Content Type Group" list
When I start editing "Content Type" "Test Content Type" from "Content"
And I set "Name" to "Test Content Type edited"
And I add field "ezdate" to Content Type definition
And I set "Name" in "ezdate" to "DateField"
And I set fields
| label | value |
| Name | Test Content Type edited |
And I add field "Date" to Content Type definition
And I set "Name" in "Date" to "DateField"
And I click on the edit action bar button "Save"
Then I should be on "Content Type" "Test Content Type edited" page
And Content Type has proper Global properties
| label | value |
| Name | Test Content Type edited |
| Identifier | TestContentTypeIdentifier |
| Content name pattern | <name> |
| label | value |
| Name | Test Content Type edited |
| Identifier | TestContentTypeIdentifier |
| Content name pattern | <name> |
And Content Type "Test Content Type" has proper fields
| fieldName | fieldType |
| CountryField | ezcountry |
| DateField | ezdate |
| fieldName | fieldType |
| CountryField | ezcountry |
| DateField | ezdate |
And notification that "Content type" "Test Content Type edited" is updated appears

@javascript @common
Expand Down
Loading

0 comments on commit 1072197

Please sign in to comment.