Moving configuration setting to shared function

This commit is contained in:
David Jay
2016-11-22 16:01:50 -05:00
parent e40d5312da
commit 2a19399b81
2 changed files with 51 additions and 31 deletions
+12
View File
@@ -1,3 +1,5 @@
const fetch = require('node-fetch');
const embedCommands = {
ready() {
return this.resizeWindow(1200, 800)
@@ -5,6 +7,16 @@ const embedCommands = {
.waitForElementVisible('body', 2000)
.frame('coralStreamIframe');
},
setConfig(config, baseUrl) {
return fetch(`${baseUrl}/api/v1/settings`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify(config)
});
},
enterComment() {
const comment = 'This is a test comment';
return this