mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Refactored spectron tests
This commit is contained in:
committed by
Kiran Niranjan
parent
d220b6ada6
commit
763d27aa8d
@@ -1,13 +1,12 @@
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
let app = new Application({});
|
||||
|
||||
describe('Tests for Always on top', () => {
|
||||
|
||||
let originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000;
|
||||
|
||||
let app;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = Application.getTimeOut();
|
||||
|
||||
beforeAll((done) => {
|
||||
const Application = require('./utils/spectronSetup');
|
||||
app = new Application({});
|
||||
return app.startApplication().then((startedApp) => {
|
||||
app = startedApp;
|
||||
done();
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
let app = new Application({});
|
||||
|
||||
describe('Tests for Bring to front', () => {
|
||||
|
||||
let originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000;
|
||||
|
||||
let app;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = Application.getTimeOut();
|
||||
|
||||
beforeAll((done) => {
|
||||
const Application = require('./utils/spectronSetup');
|
||||
app = new Application({});
|
||||
return app.startApplication().then((startedApp) => {
|
||||
app = startedApp;
|
||||
done();
|
||||
}).catch(() => {
|
||||
expect(true).toBe(false);
|
||||
}).catch((err) => {
|
||||
expect(err).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -33,11 +32,11 @@ describe('Tests for Bring to front', () => {
|
||||
return app.client.getWindowCount().then((count) => {
|
||||
expect(count === 1).toBeTruthy();
|
||||
done();
|
||||
}).catch(() => {
|
||||
expect(true).toBe(false);
|
||||
}).catch((err) => {
|
||||
expect(err).toBeNull();
|
||||
});
|
||||
}).catch(() => {
|
||||
expect(true).toBe(false);
|
||||
}).catch((err) => {
|
||||
expect(err).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -45,19 +44,19 @@ describe('Tests for Bring to front', () => {
|
||||
return app.browserWindow.minimize().then(() => {
|
||||
return app.browserWindow.isMinimized().then((isMinimized) => {
|
||||
expect(isMinimized).toBeTruthy();
|
||||
}).catch(() => {
|
||||
expect(true).toBe(false);
|
||||
}).catch((err) => {
|
||||
expect(err).toBeNull();
|
||||
});
|
||||
}).catch(() => {
|
||||
expect(true).toBe(false);
|
||||
}).catch((err) => {
|
||||
expect(err).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
it('should not be focused', () => {
|
||||
return app.browserWindow.isFocused().then((isFocused) => {
|
||||
expect(isFocused).toBeFalsy();
|
||||
}).catch(() => {
|
||||
expect(true).toBe(false);
|
||||
}).catch((err) => {
|
||||
expect(err).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -65,19 +64,19 @@ describe('Tests for Bring to front', () => {
|
||||
return app.browserWindow.restore().then(async () => {
|
||||
return app.browserWindow.isMinimized().then((isMinimized) => {
|
||||
expect(isMinimized).toBeFalsy();
|
||||
}).catch(() => {
|
||||
expect(true).toBe(false);
|
||||
}).catch((err) => {
|
||||
expect(err).toBeNull();
|
||||
});
|
||||
}).catch(() => {
|
||||
expect(true).toBe(false);
|
||||
}).catch((err) => {
|
||||
expect(err).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
it('should be focused', () => {
|
||||
return app.browserWindow.isFocused().then((isFocused) => {
|
||||
expect(isFocused).toBeTruthy();
|
||||
}).catch(() => {
|
||||
expect(true).toBe(false);
|
||||
}).catch((err) => {
|
||||
expect(err).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
const path = require('path');
|
||||
let app = new Application({});
|
||||
|
||||
describe('Tests for clipboard', () => {
|
||||
|
||||
let originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000;
|
||||
|
||||
let app;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = Application.getTimeOut();
|
||||
|
||||
beforeAll((done) => {
|
||||
const Application = require('./utils/spectronSetup');
|
||||
app = new Application({});
|
||||
return app.startApplication().then((startedApp) => {
|
||||
app = startedApp;
|
||||
done();
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
const Application = require('./utils/spectronSetup');
|
||||
const Application = require('./spectron/spectronSetup');
|
||||
const path = require('path');
|
||||
let app = new Application({});
|
||||
|
||||
describe('Tests for Notification position', () => {
|
||||
|
||||
let originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000;
|
||||
|
||||
let app;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = Application.getTimeOut();
|
||||
|
||||
beforeAll((done) => {
|
||||
app = new Application({});
|
||||
return app.startApplication().then((startedApp) => {
|
||||
app = startedApp;
|
||||
done();
|
||||
|
||||
@@ -7,7 +7,7 @@ class App {
|
||||
|
||||
this.options = options;
|
||||
|
||||
if (!this.options.path){
|
||||
if (!this.options.path) {
|
||||
this.options.path = App.getAppPath();
|
||||
this.options.args = [path.join(__dirname, '..', '..', 'js/main.js')];
|
||||
}
|
||||
@@ -16,7 +16,7 @@ class App {
|
||||
}
|
||||
|
||||
startApplication() {
|
||||
return this.app.start().then((app) =>{
|
||||
return this.app.start().then((app) => {
|
||||
return app;
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
@@ -31,6 +31,10 @@ class App {
|
||||
return electronPath
|
||||
}
|
||||
|
||||
static getTimeOut() {
|
||||
return 90000
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = App;
|
||||
Reference in New Issue
Block a user