Electron-87 1. Spectron test for Bring to front feature

This commit is contained in:
Kiran Niranjan 2017-07-02 22:11:15 +05:30 committed by Kiran Niranjan
parent a4b79ac998
commit d0e37c0ea3

View File

@ -0,0 +1,45 @@
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 quit 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);
});
});
});