Visitor tries to flag a comment

This commit is contained in:
Belen Curcio
2016-12-18 20:21:26 -03:00
parent 3f56fcba07
commit 34b56a3044
3 changed files with 51 additions and 17 deletions
+7 -2
View File
@@ -47,6 +47,11 @@ const embedStreamCommands = {
.waitForElementVisible('@likesCount')
.click('@likeButton')
.waitForElementVisible('@signInDialog', 2000);
},
flagComment() {
return this
.waitForElementVisible('@flagButton')
.click('@likeButton');
}
};
@@ -83,8 +88,8 @@ export default {
likeText: {
selector: '.comment .coral-plugin-likes-container .coral-plugin-likes-button .coral-plugin-likes-button-text'
},
likesCount: {
selector: '.comment .coral-plugin-likes-container .coral-plugin-likes-like-count'
flagButton: {
selector: '.comment .coral-plugin-flags-container .coral-plugin-flags-button'
}
}
};
+24 -15
View File
@@ -1,15 +1,24 @@
// Given I am signed into my commenter account
// And I am on the comment stream page
// And I see the option to report a comment
// When I report the comment
// And choose to flag the comment
// Then I should see the option to give a flag reason
// Then I should see a thank you message
// And the comment should still show on the comment stream
// And the comment should show in the Flagged moderation queue
//
// Given I am a visitor and not logged in
// And I am on the comment stream page
// And I see the option to report a comment
// When I click to report the comment
// Then I should be prompted to login to report
export default {
'@tags': ['flag', 'comments', 'commenter'],
before: client => {
const embedStreamPage = client.page.embedStreamPage();
const {users} = client.globals;
embedStreamPage
.navigate()
.ready();
embedStreamPage
.login(users.commenter);
},
'Commenter likes a comment': client => {
const embedStreamPage = client.page.embedStreamPage();
embedStreamPage
.likeComment();
},
after: client => {
client.end();
}
};
@@ -0,0 +1,20 @@
export default {
'@tags': ['flag', 'comments', 'visitor'],
before: client => {
const embedStreamPage = client.page.embedStreamPage();
embedStreamPage
.navigate()
.ready();
},
'Visitor tries to flag a comment': client => {
const embedStreamPage = client.page.embedStreamPage();
embedStreamPage
.flagComment()
.waitForElementVisible('@signInDialog', 2000);
},
after: client => {
client.end();
}
};