mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-23 01:16:24 -06:00
Merge pull request #150 from KiranNiranjan/ELECTRON-87
Electron-87 (Bring to front)
This commit is contained in:
commit
2361f00897
57
tests/bringToFront.test.js
Normal file
57
tests/bringToFront.test.js
Normal file
@ -0,0 +1,57 @@
|
||||
const Application = require('./spectronSetup');
|
||||
|
||||
describe('Tests for Bring to front', () => {
|
||||
|
||||
let originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
|
||||
|
||||
let app;
|
||||
|
||||
beforeAll(() => {
|
||||
app = new Application({});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
if (app && app.isRunning()) {
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
|
||||
return app.stop();
|
||||
}
|
||||
});
|
||||
|
||||
it('should launch the app', () => {
|
||||
return app.startApplication().then((startedApp) => {
|
||||
app = startedApp;
|
||||
return app.client.waitUntilWindowLoaded().then(async () => {
|
||||
const count = await app.client.getWindowCount();
|
||||
expect(count === 1).toBeTruthy();
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
it('should minimize the app', () => {
|
||||
return app.browserWindow.minimize().then(async () => {
|
||||
const isMinimized = await app.browserWindow.isMinimized();
|
||||
expect(isMinimized).toBeTruthy();
|
||||
})
|
||||
});
|
||||
|
||||
it('should not be focused', () => {
|
||||
return app.browserWindow.isFocused().then((isFocused) => {
|
||||
expect(isFocused).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
it('should maximize browser window', () => {
|
||||
return app.browserWindow.restore().then(async () => {
|
||||
const isMinimized = await app.browserWindow.isMinimized();
|
||||
expect(isMinimized).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
it('should be focused', () => {
|
||||
return app.browserWindow.isFocused().then((isFocused) => {
|
||||
expect(isFocused).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user