Skip to content
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

MNT Behat test - removing implicitly added files #286

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions tests/behat/features/populate-campaigns.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Feature: Populate campaigns

Background:
Given a "page" "About Us"
And a "page" "Contact Us"
And a "image" "assets/folder1/file2.jpg"
And a "Campaign" "Empty Campaign"
And a campaign "Full Campaign" with changes "image"="assets/folder1/file2.jpg" and "page"="About Us"
Expand Down Expand Up @@ -84,3 +85,145 @@ Feature: Populate campaigns
Then I should see a "Published "Full Campaign" successfully." success toast
When I press the "Campaigns" button
Then I should see "Published" in column 3 of the "Full Campaign" campaign

Scenario: I can remove a campaign item with implicitly added items
When I go to "admin/pages"
And I click on "About Us" in the tree
Then I should see an edit page form
When I fill in "New About us page" for "Title"
And I fill in the "Content" HTML field with "<p>my new content</p>"
And I press the "Save" button
And I press the "Insert from Files" HTML field button
And I click the "folder1" gallery item
And I click the "file2" gallery item
And I press the "Insert file" button
Then the "Content" HTML field should contain "file2.jpg"
And I press the "Save" button
Then I should see the "Saved" button
And I click "More options" in the "#ActionMenus" element
And I press the "Add to Campaign" button
Then I should see a modal titled "Add to campaign"
When I select "Empty Campaign" from "Campaign"
And I press the "Add" button
When I close the modal
When I go to "admin/campaigns"
And I view the campaign "Empty Campaign"
Then I should see the "New About us page" campaign item
And I should see the "file2" campaign item
When I press the "Publish campaign" button, confirming the dialog
Then I should see a "Published "Empty Campaign" successfully." success toast
And I select the "New About us page" campaign item
And I wait until I see the ".campaign-admin__campaign-preview .action-menu__toggle" element
And I click on the ".campaign-admin__campaign-preview .action-menu__toggle" element
And I press the "Remove" button, confirming the dialog
Then I should not see the "New About us page" campaign item
And I should not see the "file2" campaign item

Scenario: I can remove a campaign item with shared implicitly added items that exist in other campaign items
When I go to "admin/pages"
And I click on "About Us" in the tree
Then I should see an edit page form
When I fill in "New About us page" for "Title"
And I fill in the "Content" HTML field with "<p>my new content</p>"
And I press the "Save" button
And I press the "Insert from Files" HTML field button
And I click the "folder1" gallery item
And I click the "file2" gallery item
And I press the "Insert file" button
Then the "Content" HTML field should contain "file2.jpg"
And I press the "Save" button
Then I should see the "Saved" button
And I click "More options" in the "#ActionMenus" element
And I press the "Add to Campaign" button
Then I should see a modal titled "Add to campaign"
When I select "Empty Campaign" from "Campaign"
And I press the "Add" button
When I close the modal
Then I go to "admin/pages"
And I click on "Contact Us" in the tree
Then I should see an edit page form
When I fill in "New Contact us page" for "Title"
And I fill in the "Content" HTML field with "<p>my new content</p>"
And I press the "Save" button
And I press the "Insert from Files" HTML field button
And I click the "folder1" gallery item
And I click the "file2" gallery item
And I press the "Insert file" button
Then the "Content" HTML field should contain "file2.jpg"
And I press the "Save" button
Then I should see the "Saved" button
And I click "More options" in the "#ActionMenus" element
And I press the "Add to Campaign" button
Then I should see a modal titled "Add to campaign"
When I select "Empty Campaign" from "Campaign"
And I press the "Add" button
When I close the modal
When I go to "admin/campaigns"
And I view the campaign "Empty Campaign"
Then I should see the "New About us page" campaign item
And I should see the "file2" campaign item
When I press the "Publish campaign" button, confirming the dialog
Then I should see a "Published "Empty Campaign" successfully." success toast
And I select the "New About us page" campaign item
And I wait until I see the ".campaign-admin__campaign-preview .action-menu__toggle" element
And I click on the ".campaign-admin__campaign-preview .action-menu__toggle" element
And I press the "Remove" button, confirming the dialog
Then I should not see the "New About us page" campaign item
And I should see the "New Contact us page" campaign item
And I should see the "file2" campaign item

Scenario: I can remove a campaign item with implicitly added item that exist in campaign as explicitly added item
When I go to "admin/pages"
And I click on "About Us" in the tree
Then I should see an edit page form
When I fill in "New About us page" for "Title"
And I fill in the "Content" HTML field with "<p>my new content</p>"
And I press the "Save" button
And I press the "Insert from Files" HTML field button
And I click the "folder1" gallery item
And I click the "file2" gallery item
And I press the "Insert file" button
Then the "Content" HTML field should contain "file2.jpg"
And I press the "Save" button
Then I should see the "Saved" button
And I go to "/admin/assets"
And I wait for 10 seconds
And I click the "folder1" gallery item
And I click the "file2" gallery item
Then I should see the "Form_fileEditForm" form
And I press the "Other actions" button
And I press the "Add to campaign" button
Then I should see a modal titled "Add to campaign"
When I select "Empty Campaign" from "Campaign"
And I press the "Add" button
And I wait for 1 seconds until I see the ".modal__response--good" element
Then I should see "Successfully added" in the ".modal-dialog" region
When I close the modal
When I go to "admin/pages"
And I click on "New About us page" in the tree
Then I should see an edit page form
And I click "More options" in the "#ActionMenus" element
And I press the "Add to Campaign" button
Then I should see a modal titled "Add to campaign"
When I select "Empty Campaign" from "Campaign"
And I press the "Add" button
And I wait for 1 seconds until I see the ".modal__response--good" element
Then I should see "Successfully added" in the ".modal-dialog" region
When I close the modal
When I go to "admin/campaigns"
And I view the campaign "Empty Campaign"
Then I should see the "New About us page" campaign item
And I should see the "file2" campaign item
When I press the "Publish campaign" button, confirming the dialog
Then I should see a "Published "Empty Campaign" successfully." success toast
And I select the "New About us page" campaign item
And I wait until I see the ".campaign-admin__campaign-preview .action-menu__toggle" element
And I click on the ".campaign-admin__campaign-preview .action-menu__toggle" element
And I press the "Remove" button, confirming the dialog
Then I should not see the "New About us page" campaign item
And I should see the "file2" campaign item
And I select the "file2" campaign item
And I wait until I see the ".campaign-admin__campaign-preview .action-menu__toggle" element
And I click on the ".campaign-admin__campaign-preview .action-menu__toggle" element
And I press the "Remove" button, confirming the dialog
Then I should not see the "file2" campaign item