mirror of
https://github.com/wassname/talk.git
synced 2026-07-05 02:00:39 +08:00
Commenter posts a comment
This commit is contained in:
@@ -47,6 +47,7 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// "chromeOptions" : {
|
||||
// "args" : ["start-fullscreen"]
|
||||
// }
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ selenium-standalone install
|
||||
{ echo moderator@test.com; echo test; echo test; echo Moderator Test User; echo moderator;} | dotenv ./bin/cli-users create
|
||||
|
||||
# Creating Commenter Test User
|
||||
{ echo test@test.com; echo test; echo test; echo Commenter Test User; echo '';} | dotenv ./bin/cli-users create
|
||||
{ echo commenter@test.com; echo test; echo test; echo Commenter Test User; echo '';} | dotenv ./bin/cli-users create
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
const embedStreamCommands = {
|
||||
url: function () {
|
||||
return this
|
||||
.api.launchUrl;
|
||||
},
|
||||
ready() {
|
||||
return this
|
||||
.waitForElementVisible('body', 2000)
|
||||
.waitForElementVisible('iframe#coralStreamIframe')
|
||||
api.frame('coralStreamIframe');
|
||||
.api.frame('coralStreamIframe');
|
||||
},
|
||||
login(user) {
|
||||
return this
|
||||
@@ -16,6 +20,12 @@ const embedStreamCommands = {
|
||||
.setValue('@signInDialogPassword', user.pass)
|
||||
.waitForElementVisible('@logInButton')
|
||||
.click('@logInButton');
|
||||
},
|
||||
postComment(comment = 'Test Comment') {
|
||||
return this
|
||||
.waitForElementVisible('@commentBox', 2000)
|
||||
.setValue('@commentBox', comment)
|
||||
.click('@postButton');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -41,7 +51,7 @@ export default {
|
||||
selector: '#commentBox'
|
||||
},
|
||||
postButton: {
|
||||
selector: '#commentBox .coral-plugin-commentbox-button'
|
||||
selector: '#commentBox .coral-plugin-commentbox-button button'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
module.exports = {
|
||||
'@tags': ['login'],
|
||||
before: client => {
|
||||
export default {
|
||||
'@tags': ['login', 'admin'],
|
||||
before(client) {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
const {launchUrl} = client;
|
||||
|
||||
client
|
||||
.url(launchUrl)
|
||||
.url(launchUrl);
|
||||
|
||||
embedStreamPage
|
||||
.ready();
|
||||
},
|
||||
'Commenter logs in': client => {
|
||||
'Admin logs in': client => {
|
||||
const {users} = client.globals;
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
|
||||
embedStreamPage
|
||||
.login(users.commenter);
|
||||
|
||||
.login(users.admin);
|
||||
},
|
||||
after: client => {
|
||||
client.end();
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
module.exports = {
|
||||
'@tags': ['login'],
|
||||
'@tags': ['login', 'commenter'],
|
||||
before: client => {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
const {launchUrl} = client;
|
||||
|
||||
client
|
||||
.url(launchUrl)
|
||||
|
||||
embedStreamPage
|
||||
.navigate()
|
||||
.ready();
|
||||
},
|
||||
'Commenter logs in': client => {
|
||||
@@ -16,7 +13,6 @@ module.exports = {
|
||||
|
||||
embedStreamPage
|
||||
.login(users.commenter);
|
||||
|
||||
},
|
||||
after: client => {
|
||||
client.end();
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
module.exports = {
|
||||
'@tags': ['write', 'commenter'],
|
||||
before: client => {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
const {users} = client.globals;
|
||||
|
||||
embedStreamPage
|
||||
.navigate()
|
||||
.ready();
|
||||
|
||||
embedStreamPage
|
||||
.login(users.commenter);
|
||||
},
|
||||
'Commenter posts a comment': client => {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
|
||||
embedStreamPage
|
||||
.postComment('I read the comments');
|
||||
},
|
||||
after: client => {
|
||||
client.end();
|
||||
}
|
||||
};
|
||||
@@ -1,22 +1,21 @@
|
||||
module.exports = {
|
||||
'@tags': ['login'],
|
||||
export default {
|
||||
'@tags': ['login', 'moderator'],
|
||||
before: client => {
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
const {launchUrl} = client;
|
||||
|
||||
client
|
||||
.url(launchUrl)
|
||||
.url(launchUrl);
|
||||
|
||||
embedStreamPage
|
||||
.ready();
|
||||
.ready();
|
||||
},
|
||||
'Commenter logs in': client => {
|
||||
'Moderator logs in': client => {
|
||||
const {users} = client.globals;
|
||||
const embedStreamPage = client.page.embedStreamPage();
|
||||
|
||||
embedStreamPage
|
||||
.login(users.commenter);
|
||||
|
||||
.login(users.moderator);
|
||||
},
|
||||
after: client => {
|
||||
client.end();
|
||||
|
||||
Reference in New Issue
Block a user