Flag Comment

This commit is contained in:
Belen Curcio
2016-12-19 10:31:51 -03:00
parent f493e5413d
commit 89709a80c1
4 changed files with 63 additions and 18 deletions
-14
View File
@@ -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: {
+44 -1
View File
@@ -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'
}
}
};
+2 -1
View File
@@ -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();
+17 -2
View File
@@ -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();