2017-07-20 06:57:48 -05:00
|
|
|
const Application = require('./spectronSetup');
|
2018-09-07 03:11:20 -05:00
|
|
|
const WindowsActions = require('./spectronWindowsActions');
|
|
|
|
const constants = require('./spectronConstants.js');
|
|
|
|
const {isMac} = require('../../js/utils/misc');
|
|
|
|
let app, windowsActions;
|
|
|
|
|
|
|
|
describe('Tests for fullscreen', () => {
|
|
|
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = constants.TIMEOUT_TEST_SUITE;
|
|
|
|
|
|
|
|
beforeAll(async (done) => {
|
|
|
|
try {
|
|
|
|
app = await new Application({}).startApplication({ testedHost: constants.TESTED_HOST, alwaysOnTop: true });
|
|
|
|
windowsActions = await new WindowsActions(app);
|
2017-07-06 08:53:09 -05:00
|
|
|
done();
|
2018-09-07 03:11:20 -05:00
|
|
|
} catch (err) {
|
|
|
|
await windowsActions.stopApp();
|
|
|
|
done.fail(new Error(`Unable to start application error: ${err}`));
|
|
|
|
};
|
2017-07-06 08:53:09 -05:00
|
|
|
});
|
|
|
|
|
2018-09-07 03:11:20 -05:00
|
|
|
afterAll(async (done) => {
|
|
|
|
try {
|
|
|
|
await windowsActions.stopApp();
|
2018-03-13 05:20:32 -05:00
|
|
|
done();
|
2018-09-07 03:11:20 -05:00
|
|
|
} catch (err) {
|
|
|
|
done.fail(new Error(`Failed at post-condition: ${err}`));
|
|
|
|
};
|
2017-07-06 08:53:09 -05:00
|
|
|
});
|
|
|
|
|
2018-09-07 03:11:20 -05:00
|
|
|
it('Should set the app full screen and check whether it is in full screen', async (done) => {
|
|
|
|
try {
|
|
|
|
if (await windowsActions.isAppRunning()) {
|
|
|
|
if (isMac) {
|
|
|
|
await windowsActions.fullScreenOnMac();
|
|
|
|
} else {
|
|
|
|
await windowsActions.openMenu(["View", "Toggle Full Screen"]);
|
|
|
|
}
|
|
|
|
await windowsActions.verifyAppFullScreen();
|
2017-07-11 09:13:17 -05:00
|
|
|
}
|
2018-09-07 03:11:20 -05:00
|
|
|
done();
|
|
|
|
} catch (err) {
|
|
|
|
done.fail(new Error(`Fail to verify app full screen: ${err}`));
|
|
|
|
};
|
2017-07-06 08:53:09 -05:00
|
|
|
});
|
2018-09-07 03:11:20 -05:00
|
|
|
});
|