SymphonyElectron/spectron/minimize.spec.ts

35 lines
857 B
TypeScript
Raw Normal View History

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());
});
test.after.always(async () => {
2021-01-29 00:25:40 -06:00
await stopApplication(app);
});
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());
2021-01-29 00:25:40 -06:00
win.restore();
t.true(await win.isVisible());
});
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());
2021-01-29 00:25:40 -06:00
win.restore();
t.true(await win.isVisible());
});