2020-03-18 00:45:00 -05:00
|
|
|
import test from 'ava';
|
|
|
|
import { Application } from 'spectron';
|
|
|
|
import { robotActions } from './fixtures/robot-actions';
|
|
|
|
|
|
|
|
import { startApplication, stopApplication } from './fixtures/spectron-setup';
|
|
|
|
|
|
|
|
let app;
|
|
|
|
|
|
|
|
test.before(async (t) => {
|
2021-01-29 00:25:40 -06:00
|
|
|
app = (await startApplication()) as Application;
|
|
|
|
t.true(app.isRunning());
|
2020-03-18 00:45:00 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
test.after.always(async () => {
|
2021-01-29 00:25:40 -06:00
|
|
|
await stopApplication(app);
|
2020-03-18 00:45:00 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
test('minimize: verify application minimize / maximize feature', async (t) => {
|
2021-01-29 00:25:40 -06:00
|
|
|
const win = app.browserWindow;
|
|
|
|
win.minimize();
|
|
|
|
t.true(await win.isMinimized());
|
2020-03-18 00:45:00 -05:00
|
|
|
|
2021-01-29 00:25:40 -06:00
|
|
|
win.restore();
|
|
|
|
t.true(await win.isVisible());
|
2020-03-18 00:45:00 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
test('minimize: verify application to be minimized with keyboard accelerator', async (t) => {
|
2021-01-29 00:25:40 -06:00
|
|
|
const win = app.browserWindow;
|
|
|
|
robotActions.closeWindow();
|
|
|
|
t.false(await win.isVisible());
|
2020-03-18 00:45:00 -05:00
|
|
|
|
2021-01-29 00:25:40 -06:00
|
|
|
win.restore();
|
|
|
|
t.true(await win.isVisible());
|
2020-03-18 00:45:00 -05:00
|
|
|
});
|