mirror of
https://github.com/wassname/talk.git
synced 2026-08-17 11:27:52 +08:00
Updating e2e tests.
This commit is contained in:
@@ -8,6 +8,8 @@ const embedStreamCommands = {
|
||||
},
|
||||
approveComment() {
|
||||
return this
|
||||
.waitForElementVisible('@moderateNav')
|
||||
.click('@moderateNav')
|
||||
.waitForElementVisible('@moderationList')
|
||||
.waitForElementVisible('@approveButton')
|
||||
.click('@approveButton');
|
||||
@@ -17,6 +19,9 @@ const embedStreamCommands = {
|
||||
module.exports = {
|
||||
commands: [embedStreamCommands],
|
||||
elements: {
|
||||
moderateNav: {
|
||||
selector: '#moderateNav'
|
||||
},
|
||||
moderationList: {
|
||||
selector: '#moderationList'
|
||||
},
|
||||
|
||||
@@ -117,46 +117,46 @@ module.exports = {
|
||||
selector: '#commentBox .coral-plugin-commentbox-button'
|
||||
},
|
||||
likeButton: {
|
||||
selector: '.comment .coral-plugin-likes-container .coral-plugin-likes-button'
|
||||
selector: '#stream .coral-plugin-likes-container .coral-plugin-likes-button'
|
||||
},
|
||||
likeText: {
|
||||
selector: '.comment .coral-plugin-likes-container .coral-plugin-likes-button .coral-plugin-likes-button-text'
|
||||
selector: '#stream .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'
|
||||
selector: '#stream .coral-plugin-likes-container .coral-plugin-likes-button .coral-plugin-likes-like-count'
|
||||
},
|
||||
flagButton: {
|
||||
selector: '.comment .coral-plugin-flags-container .coral-plugin-flags-button'
|
||||
selector: '#stream .coral-plugin-flags-container .coral-plugin-flags-button'
|
||||
},
|
||||
flagPopUp: {
|
||||
selector: '.comment .coral-plugin-flags-popup'
|
||||
selector: '#stream .coral-plugin-flags-popup'
|
||||
},
|
||||
flagCommentOption: {
|
||||
selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="COMMENTS"]'
|
||||
selector: '#stream .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="USERS"]'
|
||||
selector: '#stream .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="USERS"]'
|
||||
},
|
||||
flagOtherOption: {
|
||||
selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="other"]'
|
||||
selector: '#stream .coral-plugin-flags-popup .coral-plugin-flags-popup-radio-label[for="other"]'
|
||||
},
|
||||
flagHeaderMessage: {
|
||||
selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-header'
|
||||
selector: '#stream .coral-plugin-flags-popup .coral-plugin-flags-popup-header'
|
||||
},
|
||||
flagButtonText: {
|
||||
selector: '.comment .coral-plugin-flags-button-text'
|
||||
selector: '#stream .coral-plugin-flags-button-text'
|
||||
},
|
||||
flagDoneButton: {
|
||||
selector: '.comment .coral-plugin-flags-popup .coral-plugin-flags-popup-button'
|
||||
selector: '#stream .coral-plugin-flags-popup .coral-plugin-flags-popup-button'
|
||||
},
|
||||
permalinkButton: {
|
||||
selector: '.comment .coral-plugin-permalinks-button'
|
||||
selector: '#stream .coral-plugin-permalinks-button'
|
||||
},
|
||||
permalinkPopUp: {
|
||||
selector: '.comment .coral-plugin-permalinks-popover.active'
|
||||
selector: '#stream .coral-plugin-permalinks-popover.active'
|
||||
},
|
||||
permalinkInput: {
|
||||
selector: '.comment .coral-plugin-permalinks-popover.active input'
|
||||
selector: '#stream .coral-plugin-permalinks-popover.active input'
|
||||
},
|
||||
registerButton: {
|
||||
selector: '#signInDialog #coralRegister'
|
||||
|
||||
@@ -16,6 +16,7 @@ module.exports = {
|
||||
|
||||
embedStreamPage
|
||||
.flagUsername()
|
||||
.click('@flagButton')
|
||||
.waitForElementVisible('@flagPopUp')
|
||||
.waitForElementVisible('@flagUsernameOption')
|
||||
.click('@flagUsernameOption')
|
||||
|
||||
@@ -41,7 +41,6 @@ module.exports = {
|
||||
.setValue('#password', mockUser.pw)
|
||||
.setValue('#confirmPassword', mockUser.pw)
|
||||
.click('#coralSignUpButton')
|
||||
.pause(5000)
|
||||
.waitForElementVisible('#coralLogInButton', 10000)
|
||||
.click('#coralLogInButton')
|
||||
.waitForElementVisible('.coral-plugin-commentbox-button', 4000)
|
||||
@@ -49,10 +48,10 @@ module.exports = {
|
||||
// Post a comment
|
||||
.setValue('.coral-plugin-commentbox-textarea', mockComment)
|
||||
.click('.coral-plugin-commentbox-button')
|
||||
.waitForElementVisible('.coral-plugin-content-text', 1000)
|
||||
.waitForElementVisible('#stream .coral-plugin-commentcontent-text')
|
||||
|
||||
// Verify that it appears
|
||||
.assert.containsText('.coral-plugin-content-text', mockComment);
|
||||
.assert.containsText('#stream .coral-plugin-commentcontent-text', mockComment);
|
||||
done();
|
||||
})
|
||||
.catch((err) => {
|
||||
@@ -73,11 +72,7 @@ module.exports = {
|
||||
// Post a comment
|
||||
client.waitForElementVisible('.coral-plugin-commentbox-button', 2000)
|
||||
.setValue('.coral-plugin-commentbox-textarea', mockComment)
|
||||
.click('.coral-plugin-commentbox-button')
|
||||
.waitForElementVisible('#coral-notif', 1000)
|
||||
|
||||
// Verify that it appears
|
||||
.assert.containsText('#coral-notif', 'moderation team');
|
||||
.click('.coral-plugin-commentbox-button');
|
||||
done();
|
||||
})
|
||||
.catch((err) => {
|
||||
@@ -102,8 +97,8 @@ module.exports = {
|
||||
.click('.coral-plugin-commentbox-button')
|
||||
|
||||
// Post a reply
|
||||
.waitForElementVisible('.coral-plugin-replies-reply-button', 5000)
|
||||
.click('.coral-plugin-replies-reply-button')
|
||||
.waitForElementVisible('#stream .coral-plugin-replies-reply-button', 5000)
|
||||
.click('#stream .coral-plugin-replies-reply-button')
|
||||
.waitForElementVisible('#replyText')
|
||||
.setValue('#replyText', mockReply)
|
||||
.click('.coral-plugin-replies-textarea .coral-plugin-commentbox-button')
|
||||
|
||||
Reference in New Issue
Block a user