mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Electron-87 Moved the Bring to front test to Jest from mocha
This commit is contained in:
committed by
Kiran Niranjan
parent
7210f88e51
commit
4977b19d80
@@ -1,45 +0,0 @@
|
|||||||
const Application = require('../app');
|
|
||||||
const assert = require('assert');
|
|
||||||
|
|
||||||
describe('Tests for Bring to front', () => {
|
|
||||||
let app;
|
|
||||||
|
|
||||||
before(() => {
|
|
||||||
app = new Application({});
|
|
||||||
});
|
|
||||||
|
|
||||||
after(() => {
|
|
||||||
if (app && app.isRunning()) {
|
|
||||||
return app.stop();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should launch the app', () => {
|
|
||||||
return app.startApplication().then((startedApp) => {
|
|
||||||
app = startedApp;
|
|
||||||
app.client.waitUntilWindowLoaded().getWindowCount()
|
|
||||||
.should.eventually.equal(1);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should minimize the app', () => {
|
|
||||||
return app.browserWindow.minimize();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not be focused', () => {
|
|
||||||
return app.browserWindow.isFocused().then((isFocused) => {
|
|
||||||
assert.equal(isFocused, false);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should maximize browser window', () => {
|
|
||||||
return app.browserWindow.restore();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should be focused', () => {
|
|
||||||
return app.browserWindow.isFocused().then((isFocused) => {
|
|
||||||
assert.equal(isFocused, true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user