Updated tests

This commit is contained in:
okbel
2018-01-10 13:54:43 -03:00
parent 24f7405065
commit 4c3d3fb4b0
2 changed files with 39 additions and 15 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ module.exports = {
iframe: `#${iframeId}`,
commentsTabButton: '.talk-embed-stream-comments-tab > button',
profileTabButton: '.talk-embed-stream-profile-tab > button',
configTabButton: '.talk-embed-stream-profile-tab > button',
configTabButton: '.talk-embed-stream-config-tab > button',
banDialog: '.talk-ban-user-dialog',
banDialogConfirmButton: '.talk-ban-user-dialog-button-confirm',
},
+38 -14
View File
@@ -96,20 +96,6 @@ module.exports = {
profile.assert.equal(result.value, '1');
});
},
'stream is closed, user won\'t be able to perform some actions: reply ': (client) => {
const embedStream = client.page.embedStream();
embedStream
.waitForElementVisible('@firstComment')
.waitForElementVisible('@replyButton')
.goToProfileSection()
.closeStream()
.goToCommentsSection()
.waitForElementVisible('@firstComment')
.waitForElementNotVisible('@replyButton')
.openStream();
},
'user logs out': (client) => {
const embedStream = client.page.embedStream();
const comments = embedStream.goToCommentsSection();
@@ -124,4 +110,42 @@ module.exports = {
profile
.assert.visible('@notLoggedIn');
},
'admin logs in': (client) => {
const {testData: {admin}} = client.globals;
const embedStream = client.page.embedStream();
embedStream
.navigate()
.ready()
.openLoginPopup((popup) => popup.login(admin));
},
'admin closes stream, users won\'t be able to perform some actions: reply ': (client) => {
const embedStream = client.page.embedStream();
embedStream
.goToCommentsSection()
.waitForElementVisible('@firstComment')
.waitForElementVisible('@replyButton');
embedStream
.goToConfigSection()
.closeStream();
embedStream
.goToCommentsSection()
.waitForElementVisible('@firstComment')
.waitForElementNotVisible('@replyButton');
embedStream
.goToConfigSection()
.openStream();
},
'adming logs out': (client) => {
const embedStream = client.page.embedStream();
const comments = embedStream.goToCommentsSection();
comments
.logout();
},
};