Electron-93 Spectron test for always on top feature

This commit is contained in:
Kiran Niranjan 2017-07-03 16:19:31 +05:30 committed by Kiran Niranjan
parent a4b79ac998
commit 0e46833b32

View File

@ -0,0 +1,54 @@
const Application = require('../app');
const assert = require('assert');
const path = require('path');
describe('Tests for Activity Detection', () => {
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 check window count', () => {
return app.client.windowHandles().then(function (response) {
assert.equal(response.value.length, 1)
});
});
it('should check browser window visibility', () => {
return app.browserWindow.isVisible().then(function (visible) {
assert.equal(visible, true);
});
});
it('should check is always on top', () => {
return app.browserWindow.isAlwaysOnTop().then(function (isAlwaysOnTop) {
assert.equal(isAlwaysOnTop, false);
});
});
it('should change the always on top property', () => {
return app.browserWindow.setAlwaysOnTop(true);
});
it('should check is always on top to be true', () => {
return app.browserWindow.isAlwaysOnTop().then(function (isAlwaysOnTop) {
assert.equal(isAlwaysOnTop, true);
});
});
});