-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Behat test coverage of posts and comments deletion
- Loading branch information
Showing
4 changed files
with
193 additions
and
10 deletions.
There are no files selected for viewing
67 changes: 61 additions & 6 deletions
67
tests/behat/features/capabilities/comment/comment-delete.feature
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 |
---|---|---|
@@ -1,19 +1,74 @@ | ||
@api @comment @stability @DS-478 @stability-3 @comment-delete | ||
@api | ||
Feature: Delete Comment | ||
Benefit: In order to manage my content | ||
Role: As a Verified | ||
Goal/desire: I want to delete my comments on the platform | ||
|
||
Scenario: Successfully delete comment | ||
Scenario: Successfully delete comment on a topic | ||
Given I am logged in as an "verified" | ||
And I am viewing a "topic" with the title "Comment delete topic" | ||
|
||
When I fill in the following: | ||
| Add a comment | This is my comment | | ||
And I press "Comment" | ||
Then I should see "This is my comment" in the "Main content" | ||
When I click the element with css selector ".comment .comment__actions .dropdown-toggle" | ||
And I should see "This is my comment" in the "Main content" | ||
And I click the element with css selector ".comment .comment__actions .dropdown-toggle" | ||
And I should see the link "Delete" | ||
When I click "Delete" | ||
And I click "Delete" | ||
And I should see "Any replies to this comment will be lost." | ||
And I click "Delete" | ||
And I should not see "This is my comment" | ||
|
||
Then I should not see "This is my comment" | ||
|
||
Scenario: Successfully delete comment on a homepage | ||
Given I am logged in as an "verified" | ||
And I am viewing a "topic" with the title "Comment delete topic" | ||
|
||
When I fill in the following: | ||
| Add a comment | This is my comment | | ||
And I press "Comment" | ||
And I should see "This is my comment" in the "Main content" | ||
And I click the element with css selector ".comment .comment__actions .dropdown-toggle" | ||
And I should see the link "Delete" | ||
And I click "Delete" | ||
And I should see "Any replies to this comment will be lost." | ||
And I click "Delete" | ||
|
||
Then I should not see "This is my comment" | ||
|
||
Scenario: Successfully delete comment on a group | ||
Given users: | ||
| name | mail | status | roles | | ||
| Group User One | group_user_1@example.com | 1 | verified | | ||
And groups with non-anonymous owner: | ||
| label | field_group_description | type | langcode | field_flexible_group_visibility | field_group_allowed_join_method | | ||
| Test group | Public visibility | flexible_group | en | public | direct | | ||
And group members: | ||
| group | user | | ||
| Test group | Group User One | | ||
And I am logged in as "Group User One" | ||
|
||
When I am viewing the group "Test group" | ||
And I click "Stream" | ||
And I fill in "Say something to the group" with "This is a post in a group." | ||
And I press "Post" | ||
And I should see "This is a post in a group." | ||
And I should see "Group User One" in the ".media-heading" element | ||
And I fill in "Write a comment..." with "This is a comment in post in a group." | ||
And I press "Comment" | ||
And I should see "Your comment has been posted." | ||
And I should see "This is a comment in post in a group." | ||
And I am on the homepage | ||
And I should see "This is a comment in post in a group." | ||
|
||
# Delete post | ||
Then I am viewing the group "Test group" | ||
And I click the element with css selector ".comment .comment__actions .dropdown-toggle" | ||
And I click the element with css selector ".comment-delete" | ||
And I should see "Any replies to this comment will be lost. This action cannot be undone." | ||
And I press "Delete" | ||
And I wait for AJAX to finish | ||
And I should see "The comment and all its replies have been deleted." | ||
And I should not see "This is a comment in post in a group." | ||
And I am on the homepage | ||
And I should not see "This is a comment in post in a group." |
54 changes: 54 additions & 0 deletions
54
tests/behat/features/capabilities/event/event-delete.feature
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,54 @@ | ||
@api | ||
Feature: Delete Event | ||
Benefit: In order to delete content created | ||
Role: As a Verified | ||
Goal/desire: I want to delete Events | ||
|
||
@verified @perfect @critical | ||
Scenario: Successfully create event within a group | ||
Given I enable the module "automated_cron" | ||
And users: | ||
| name | status | roles | | ||
| Event enrollee 1 | 1 | verified | | ||
| Event enrollee 2 | 1 | verified | | ||
| Event manager | 1 | verified | | ||
And groups with non-anonymous owner: | ||
| label | field_group_description | type | langcode | field_flexible_group_visibility | field_group_allowed_join_method | | ||
| Test group | Public visibility | flexible_group | en | public | direct | | ||
And group members: | ||
| group | user | | ||
| Test group | Event enrollee 1 | | ||
| Test group | Event enrollee 2 | | ||
| Test group | Event manager | | ||
And event content: | ||
| title | body | field_event_date | field_event_date_end | groups | field_content_visibility | author | | ||
| Public event in group | Body description text. | +2 days | +3 days | 6 | public | Event manager | | ||
And event enrollees: | ||
| event | user | | ||
| Public event in group | Event enrollee 1 | | ||
| Public event in group | Event enrollee 2 | | ||
| Public event in group | Event manager | | ||
And I run cron | ||
And I wait for the queue to be empty | ||
And I am logged in as "Event manager" | ||
And I should see "Event manager created an event in Test group" | ||
And I should see "Public event in group" | ||
And I am viewing the group "Test group" | ||
And I click "Stream" | ||
And I should see "Event manager created an event in Test group" | ||
And I should see "Public event in group" | ||
|
||
#delete event | ||
When I click "Public event in group" | ||
And I click "Edit content" | ||
And I click "Delete" | ||
And I should see "Are you sure you want to delete the content item Public event in group?" | ||
And I should see "This action cannot be undone." | ||
And I press "Delete" | ||
And I wait for AJAX to finish | ||
|
||
Then I should see "The Event Public event in group has been deleted." | ||
And I should not see "Event manager created an event in Test group" | ||
And I am viewing the group "Test group" | ||
And I click "Stream" | ||
And I should not see "Event manager created an event in Test group" |
39 changes: 39 additions & 0 deletions
39
tests/behat/features/capabilities/post/post-delete.feature
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,39 @@ | ||
@api | ||
Feature: Delete Post | ||
Benefit: In order to be able to delete content created | ||
Role: As a Verified | ||
Goal/desire: I want to delete Posts | ||
|
||
Scenario: Successfully delete post | ||
Given users: | ||
| name | status | pass | roles | | ||
| PostCreateUser1 | 1 | PostCreateUser1 | verified | | ||
| PostCreateUser2 | 1 | PostCreateUser2 | verified | | ||
And I am logged in as "PostCreateUser1" | ||
And I am on the homepage | ||
|
||
When I fill in "Say something to the Community" with "This is a post made on the homepage." | ||
And I select post visibility "Public" | ||
And I press "Post" | ||
And I should see the success message "Your post has been posted." | ||
And I should see "This is a post made on the homepage." | ||
And I should see "PostCreateUser1" in the "Main content front" | ||
And I am on "/user" | ||
And I should see "This is a post made on the homepage." | ||
|
||
# Delete post | ||
Then I click the element with css selector ".btn.btn-icon-toggle.dropdown-toggle.waves-effect.waves-circle" | ||
And I click "Delete" | ||
And I should see "Are you sure you want to delete the post" | ||
And I should see "This action cannot be undone." | ||
And I press "Delete" | ||
And I wait for AJAX to finish | ||
And I should see "has been deleted." | ||
And I should not see "This is a post made on the homepage." | ||
And I am on the homepage | ||
And I should not see "This is a post made on the homepage." | ||
And I am logged in as "PostCreateUser2" | ||
And I am on the homepage | ||
And I should not see "This is a post made on the homepage." | ||
|
||
|
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