mirror of
https://github.com/wassname/talk.git
synced 2026-07-27 11:28:12 +08:00
Flag Comment
This commit is contained in:
@@ -1,18 +1,4 @@
|
||||
export default {
|
||||
beforeEach: function(browser, done) {
|
||||
console.log('Before Each');
|
||||
setTimeout(function() {
|
||||
// finished async duties
|
||||
done();
|
||||
}, 100);
|
||||
},
|
||||
afterEach: function(browser, done) {
|
||||
console.log('After Each');
|
||||
setTimeout(function() {
|
||||
// finished async duties
|
||||
done();
|
||||
}, 200);
|
||||
},
|
||||
waitForConditionTimeout: 8000,
|
||||
baseUrl: 'http://localhost:3000',
|
||||
users: {
|
||||
|
||||
@@ -43,7 +43,32 @@ const embedStreamCommands = {
|
||||
flagComment() {
|
||||
return this
|
||||
.waitForElementVisible('@flagButton')
|
||||
.click('@flagButton');
|
||||
.click('@flagButton')
|
||||
.waitForElementVisible('@flagPopUp')
|
||||
.waitForElementVisible('@flagCommentOption')
|
||||
.click('@flagCommentOption')
|
||||
.waitForElementVisible('@flagDoneButton')
|
||||
.click('@flagDoneButton')
|
||||
.waitForElementVisible('@flagOtherOption')
|
||||
.click('@flagOtherOption')
|
||||
.waitForElementVisible('@flagDoneButton')
|
||||
.click('@flagDoneButton')
|
||||
.click('@flagDoneButton');
|
||||
},
|
||||
flagUsername() {
|
||||
return this
|
||||
.waitForElementVisible('@flagButton')
|
||||
.click('@flagButton')
|
||||
.waitForElementVisible('@flagPopUp')
|
||||
.waitForElementVisible('@flagUsernameOption')
|
||||
.click('@flagUsernameOption')
|
||||
.waitForElementVisible('@flagDoneButton')
|
||||
.click('@flagDoneButton')
|
||||
.waitForElementVisible('@flagOtherOption')
|
||||
.click('@flagOtherOption')
|
||||
.waitForElementVisible('@flagDoneButton')
|
||||
.click('@flagDoneButton')
|
||||
.click('@flagDoneButton');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -88,6 +113,24 @@ export default {
|
||||
},
|
||||
flagPopUp: {
|
||||
selector: '.comment .coral-plugin-flags-popup'
|
||||
},
|
||||
flagCommentOption: {
|
||||
selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="comments"]'
|
||||
},
|
||||
flagUsernameOption: {
|
||||
selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="user"]'
|
||||
},
|
||||
flagOtherOption: {
|
||||
selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="other"]'
|
||||
},
|
||||
flagHeaderMessage: {
|
||||
selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-header'
|
||||
},
|
||||
flagButtonText: {
|
||||
selector: '.comment .coral-plugin-flags-button-text'
|
||||
},
|
||||
flagDoneButton: {
|
||||
selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-button'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,7 +15,8 @@ export default {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
|
||||
embedStreamPage
|
||||
.flagComment();
|
||||
.flagComment()
|
||||
.expect.element('@flagButtonText').text.to.equal('Reported');
|
||||
},
|
||||
after: client => {
|
||||
client.end();
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
export default {
|
||||
'@tags': ['flag', 'comments', 'username', 'commenter'],
|
||||
'Commenter flags a username': () => {
|
||||
tags: 'flag',
|
||||
before: client => {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
const {users} = client.globals;
|
||||
|
||||
embedStreamPage
|
||||
.navigate()
|
||||
.ready();
|
||||
|
||||
embedStreamPage
|
||||
.login(users.commenter);
|
||||
},
|
||||
'Commenter flags a comment': client => {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
|
||||
embedStreamPage
|
||||
.flagComment();
|
||||
},
|
||||
after: client => {
|
||||
client.end();
|
||||
|
||||
Reference in New Issue
Block a user