Skip to content
Prev Previous commit
Next Next commit
Update Electron app E2E tests
  • Loading branch information
fluiddot committed Jun 18, 2024
commit 48dcf22ae54ecd09b76eaf714cd0732b04439df8
18 changes: 11 additions & 7 deletions e2e/app.test.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
import { test, expect } from '@playwright/test';
import packageJson from '../package.json';
import { launchApp } from './e2e-helpers';
import type { ElectronApplication, Page } from 'playwright';
import { E2ESession } from './e2e-helpers';
import Onboarding from './page-objects/onboarding';

test.describe( 'Electron app', () => {
let electronApp: ElectronApplication;
let mainWindow: Page;
const session = new E2ESession();

test.beforeAll( async () => {
[ electronApp, mainWindow ] = await launchApp();
await session.launch();
} );

test.afterAll( async () => {
await electronApp?.close();
await session.cleanup();
} );

test( 'should ensure app title is correct.', async () => {
const title = await mainWindow.title();
const title = await session.mainWindow.title();
expect( title ).toBe( packageJson.productName );
} );

test( 'first screen displayed is onboarding', async () => {
const onboarding = new Onboarding( session.mainWindow );
await expect( onboarding.heading ).toBeVisible();
} );
} );