From 09ddb41c4637e4983edc68869c4823dd36bc885a Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: Tue, 26 Apr 2016 09:38:46 -0700 Subject: [PATCH 1/7] use edge spectron --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bf805b6..fecaf4fe 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "request": "^2.70.0", "rimraf": "^2.5.2", "signcode": "^0.4.0", - "spectron": "~1.37.0", + "spectron": "git://github.com/kevinsawicki/spectron.git#full-api", "standard": "^6.0.8" }, "dependencies": { From 8832676047328edfa5692fb3de4aef789d7cd0d2 Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: Tue, 26 Apr 2016 09:51:51 -0700 Subject: [PATCH 2/7] use edge spectron --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index fecaf4fe..1fcb2dad 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,8 @@ "dependencies": { "electron-json-storage": "^2.0.0", "glob": "^6.0.4", - "highlight.js": "^9.3.0" + "highlight.js": "^9.3.0", + "spectron": "git://github.com/kevinsawicki/spectron.git#full-api" }, "standard": { "env": { From 138e0ba385492e85a17a653be617abbead85ff75 Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: Tue, 26 Apr 2016 09:52:02 -0700 Subject: [PATCH 3/7] update spec for new spectron API --- tests/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/index.js b/tests/index.js index a76690b2..1b8ea60a 100644 --- a/tests/index.js +++ b/tests/index.js @@ -39,7 +39,7 @@ describe('demo app', function () { }) return app.start().then(function () { - chaiAsPromised.transferPromiseness = app.client.transferPromiseness + chaiAsPromised.transferPromiseness = app.transferPromiseness }).then(function () { return app.client.waitUntilWindowLoaded() }) @@ -64,12 +64,12 @@ describe('demo app', function () { it('opens a window displaying the about page', function () { return app.client.getWindowCount().should.eventually.equal(1) - .isWindowMinimized().should.eventually.be.false - .isWindowDevToolsOpened().should.eventually.be.false - .isWindowVisible().should.eventually.be.true - .isWindowFocused().should.eventually.be.true - .getWindowWidth().should.eventually.be.above(0) - .getWindowHeight().should.eventually.be.above(0) + .browserWindow.isMinimized().should.eventually.be.false + .browserWindow.isDevToolsOpened().should.eventually.be.false + .browserWindow.isVisible().should.eventually.be.true + .browserWindow.isFocused().should.eventually.be.true + .browserWindow.getBounds().should.eventually.have.property('width').and.be.above(0) + .browserWindow.getBounds().should.eventually.have.property('height').and.be.above(0) .getTitle().should.eventually.equal('Electron API Demos') .waitForVisible('#about-modal').should.eventually.be.true .isVisible('.js-nav').should.eventually.be.false From 3bdcb9318ed36eb6ae4d7fdd2d3eea04a70353aa Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: Tue, 26 Apr 2016 15:06:28 -0700 Subject: [PATCH 4/7] use spectron 2.37.0 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1fcb2dad..ef7d4864 100644 --- a/package.json +++ b/package.json @@ -45,14 +45,14 @@ "request": "^2.70.0", "rimraf": "^2.5.2", "signcode": "^0.4.0", - "spectron": "git://github.com/kevinsawicki/spectron.git#full-api", + "spectron": "^2.37.0", "standard": "^6.0.8" }, "dependencies": { "electron-json-storage": "^2.0.0", "glob": "^6.0.4", - "highlight.js": "^9.3.0", - "spectron": "git://github.com/kevinsawicki/spectron.git#full-api" + "highlight.js": "^9.3.0" + }, "standard": { "env": { From b896c80cfcc50fa805404dbedcab63c092b70417 Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: Tue, 26 Apr 2016 15:08:24 -0700 Subject: [PATCH 5/7] whitespace --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index ef7d4864..624eccd9 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "electron-json-storage": "^2.0.0", "glob": "^6.0.4", "highlight.js": "^9.3.0" - }, "standard": { "env": { From cec99b3ed5e7d799e1f0341242686e9cf9c84461 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 26 Apr 2016 12:57:05 -0700 Subject: [PATCH 6/7] Use new spectron restart helper --- tests/index.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/index.js b/tests/index.js index 1b8ea60a..1d00f75e 100644 --- a/tests/index.js +++ b/tests/index.js @@ -29,6 +29,11 @@ describe('demo app', function () { } } + const setupApp = function (app) { + chaiAsPromised.transferPromiseness = app.transferPromiseness + return app.client.waitUntilWindowLoaded() + } + const startApp = function () { app = new Application({ path: path.join(__dirname, '..', 'node_modules', '.bin', 'electron'), @@ -38,17 +43,11 @@ describe('demo app', function () { waitTimeout: 10000 }) - return app.start().then(function () { - chaiAsPromised.transferPromiseness = app.transferPromiseness - }).then(function () { - return app.client.waitUntilWindowLoaded() - }) + return app.start().then(setupApp) } const restartApp = function () { - return app.stop().then(function () { - return startApp() - }) + return app.restart().then(setupApp) } before(function () { From a22838c0bbe73f1bd95e07fdcd70a8fd79033e36 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 27 Apr 2016 14:44:51 -0700 Subject: [PATCH 7/7] Use ~ instead of ^ since minor tracks Electron version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 624eccd9..7163c1e3 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "request": "^2.70.0", "rimraf": "^2.5.2", "signcode": "^0.4.0", - "spectron": "^2.37.0", + "spectron": "~2.37.0", "standard": "^6.0.8" }, "dependencies": {