Passing tests

This commit is contained in:
Belen Curcio
2016-12-19 09:30:28 -03:00
parent 34b56a3044
commit f493e5413d
8 changed files with 46 additions and 38 deletions
+15 -1
View File
@@ -1,4 +1,18 @@
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: {
@@ -14,5 +28,5 @@ export default {
email: 'commenter@test.com',
pass: 'test'
}
}
},
};
+1 -2
View File
@@ -1,7 +1,6 @@
const embedStreamCommands = {
url: function () {
return this
.api.launchUrl + '/admin';
return `${this.api.launchUrl}/admin`;
},
ready() {
return this
+8 -10
View File
@@ -38,20 +38,12 @@ const embedStreamCommands = {
return this
.waitForElementVisible('@likeButton')
.waitForElementVisible('@likesCount')
.click('@likeButton')
.expect.element('@likeText').text.to.equal('Liked');
},
visitorLikeComment() {
return this
.waitForElementVisible('@likeButton')
.waitForElementVisible('@likesCount')
.click('@likeButton')
.waitForElementVisible('@signInDialog', 2000);
.click('@likeButton');
},
flagComment() {
return this
.waitForElementVisible('@flagButton')
.click('@likeButton');
.click('@flagButton');
}
};
@@ -88,8 +80,14 @@ 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-button .coral-plugin-likes-like-count'
},
flagButton: {
selector: '.comment .coral-plugin-flags-container .coral-plugin-flags-button'
},
flagPopUp: {
selector: '.comment .coral-plugin-flags-popup'
}
}
};
+2 -3
View File
@@ -11,12 +11,11 @@ export default {
embedStreamPage
.login(users.commenter);
},
'Commenter likes a comment': client => {
'Commenter flags a comment': client => {
const embedStreamPage = client.page.embedStreamPage();
embedStreamPage
.likeComment();
.flagComment();
},
after: client => {
client.end();
@@ -1,9 +1,8 @@
// 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 username
// 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 username should show in the Flagged moderation queue
export default {
'@tags': ['flag', 'comments', 'username', 'commenter'],
'Commenter flags a username': () => {
},
after: client => {
client.end();
}
};
+2 -1
View File
@@ -15,7 +15,8 @@ module.exports = {
const embedStreamPage = client.page.embedStreamPage();
embedStreamPage
.likeComment();
.likeComment()
.expect.element('@likeText').text.to.equal('Liked');
},
after: client => {
+8 -11
View File
@@ -1,11 +1,8 @@
//
// Given I am signed into my commenter account
// And I visit the comment stream page
// And I should see the option to link to a comment
// When I click to link to a comment
// Then the link should be there for me to copy
//
// Given I have clicked the link to a comment
// When I copy and paste that comment
// Then I should be directed to that comment stream
// And the page should scroll to where that comment is in the stream
export default {
'@tags': ['permalink', 'commenter'],
'Permalink': () => {
},
after: client => {
client.end();
}
};
+2 -1
View File
@@ -11,7 +11,8 @@ module.exports = {
const embedStreamPage = client.page.embedStreamPage();
embedStreamPage
.visitorLikeComment();
.likeComment()
.waitForElementVisible('@signInDialog', 2000);
},
after: client => {
client.end();