Commit c84aa890 authored by Tasso Evangelista's avatar Tasso Evangelista

Fix e2e tests

parent 1ad410e6
.DS_Store .DS_Store
Thumbs.db Thumbs.db
*.log *.log
*.autogenerated
/node_modules /node_modules
/package-lock.json /package-lock.json
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"coverage-renderer": "electron-mocha --require source-map-support/register --reporter scripts/istanbul-reporter app/renderer.specs.js", "coverage-renderer": "electron-mocha --require source-map-support/register --reporter scripts/istanbul-reporter app/renderer.specs.js",
"coverage": "npm-run-all coverage-main coverage-renderer", "coverage": "npm-run-all coverage-main coverage-renderer",
"pree2e": "gulp build-e2e-tests --env=test", "pree2e": "gulp build-e2e-tests --env=test",
"e2e": "mocha app/e2e.js.autogenerated --require source-map-support/register" "e2e": "mocha --require source-map-support/register app/e2e.js"
}, },
"dependencies": { "dependencies": {
"@paulcbetts/system-idle-time": "^1.0.4", "@paulcbetts/system-idle-time": "^1.0.4",
......
...@@ -8,7 +8,7 @@ describe('application', function() { ...@@ -8,7 +8,7 @@ describe('application', function() {
after(stopApp); after(stopApp);
it('shows the main window', async function() { it('shows the main window', async function() {
expect(await app.browserWindow.getTitle()).to.be.equals(appManifest.productName);
expect(await app.browserWindow.isVisible()).to.be.true; expect(await app.browserWindow.isVisible()).to.be.true;
expect(await app.browserWindow.getTitle()).to.be.equal(appManifest.productName);
}); });
}); });
import path from 'path';
import electron from 'electron'; import electron from 'electron';
import { Application } from 'spectron'; import { Application } from 'spectron';
...@@ -16,7 +15,7 @@ export async function startApp() { ...@@ -16,7 +15,7 @@ export async function startApp() {
app = new Application({ app = new Application({
path: electron, path: electron,
cwd: process.cwd(), cwd: process.cwd(),
args: [path.join(__dirname, '..')], args: [process.cwd()],
quitTimeout: 5000, quitTimeout: 5000,
startTimeout: 5000, startTimeout: 5000,
waitTimeout: 5000, waitTimeout: 5000,
...@@ -24,6 +23,7 @@ export async function startApp() { ...@@ -24,6 +23,7 @@ export async function startApp() {
await app.start(); await app.start();
await app.client.waitUntilWindowLoaded(); await app.client.waitUntilWindowLoaded();
await app.client.windowByIndex(1);
logFetchInterval = setInterval(fetchLogs, 100); logFetchInterval = setInterval(fetchLogs, 100);
} }
......
...@@ -13,5 +13,5 @@ gulp.task('build-coverage-tests', ['build-app'], async() => { ...@@ -13,5 +13,5 @@ gulp.task('build-coverage-tests', ['build-app'], async() => {
}); });
gulp.task('build-e2e-tests', ['build-app'], async() => { gulp.task('build-e2e-tests', ['build-app'], async() => {
await bundle.many('src', '*.e2e.js', 'app/e2e.js.autogenerated'); await bundle.many('src', '*.e2e.js', 'app/e2e.js');
}); });
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment