Fix tests with proper promise chain

This commit is contained in:
Yuya Ochiai
2018-02-02 22:45:54 +09:00
parent abfe5f1ae8
commit 88e6dd9de0
6 changed files with 190 additions and 65 deletions

View File

@@ -24,9 +24,15 @@ describe('application', function desc() {
return this.app.start().then(() => {
return this.app.client.
waitUntilWindowLoaded().
getWindowCount().then((count) => count.should.equal(1)).
browserWindow.isDevToolsOpened().then((opened) => opened.should.be.false).
browserWindow.isVisible().then((visible) => visible.should.be.true);
getWindowCount().then((count) => {
count.should.equal(1);
}).
browserWindow.isDevToolsOpened().then((opened) => {
opened.should.be.false;
}).
browserWindow.isVisible().then((visible) => {
visible.should.be.true;
});
});
});
@@ -66,8 +72,12 @@ describe('application', function desc() {
return this.app.start().then(() => {
return this.app.client.
waitUntilWindowLoaded().
getUrl().then((url) => url.should.match(/\/settings.html$/)).
isExisting('#newServerModal').then((existing) => existing.should.equal(true));
getUrl().then((url) => {
url.should.match(/\/settings.html$/);
}).
isExisting('#newServerModal').then((existing) => {
existing.should.equal(true);
});
});
});
@@ -78,7 +88,9 @@ describe('application', function desc() {
return this.app.start().then(() => {
return this.app.client.
waitUntilWindowLoaded().
getUrl().then((url) => url.should.match(/\/index.html$/));
getUrl().then((url) => {
url.should.match(/\/index.html$/);
});
});
});
@@ -90,7 +102,9 @@ describe('application', function desc() {
return this.app.start().then(() => {
return this.app.client.
waitUntilWindowLoaded().
getUrl().then((url) => url.should.match(/\/index.html$/));
getUrl().then((url) => {
url.should.match(/\/index.html$/);
});
}).then(() => {
var str = fs.readFileSync(env.configFilePath, 'utf8');
var config = JSON.parse(str);