mirror of
https://github.com/wassname/talk.git
synced 2026-07-13 17:45:56 +08:00
Passing tests
This commit is contained in:
+15
-1
@@ -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,7 +1,6 @@
|
||||
const embedStreamCommands = {
|
||||
url: function () {
|
||||
return this
|
||||
.api.launchUrl + '/admin';
|
||||
return `${this.api.launchUrl}/admin`;
|
||||
},
|
||||
ready() {
|
||||
return this
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,7 +15,8 @@ module.exports = {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
|
||||
embedStreamPage
|
||||
.likeComment();
|
||||
.likeComment()
|
||||
.expect.element('@likeText').text.to.equal('Liked');
|
||||
|
||||
},
|
||||
after: client => {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,7 +11,8 @@ module.exports = {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
|
||||
embedStreamPage
|
||||
.visitorLikeComment();
|
||||
.likeComment()
|
||||
.waitForElementVisible('@signInDialog', 2000);
|
||||
},
|
||||
after: client => {
|
||||
client.end();
|
||||
|
||||
Reference in New Issue
Block a user