mirror of
https://github.com/wassname/talk.git
synced 2026-08-20 12:50:41 +08:00
tests
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
const embedCommands = {
|
||||
const embedStreamCommands = {
|
||||
ready() {
|
||||
return this.resizeWindow(1200, 800)
|
||||
.url(client.globals.baseUrl)
|
||||
.waitForElementVisible('body', 2000)
|
||||
.frame('coralStreamIframe');
|
||||
},
|
||||
login(userData) {
|
||||
return this
|
||||
.waitForElementVisible('@signInButton')
|
||||
.click('@signInButton')
|
||||
.waitForElementVisible('@signInDialog');
|
||||
},
|
||||
setConfig(config, baseUrl) {
|
||||
return fetch(`${baseUrl}/api/v1/settings`, {
|
||||
method: 'PUT',
|
||||
@@ -28,12 +34,18 @@ const embedCommands = {
|
||||
validateComment(comment) {
|
||||
return this
|
||||
.assert.equal(comment, '.comment');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
commands: [embedCommands],
|
||||
commands: [embedStreamCommands],
|
||||
elements: {
|
||||
signInButton: {
|
||||
selector: '#coralSignInButton'
|
||||
},
|
||||
signInDialog:{
|
||||
selector: '#signInDialog'
|
||||
},
|
||||
commentBox: {
|
||||
selector: '#commentBox'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user