@@ -18,19 +18,15 @@ import { join, relative } from "path"
1818
1919import { test , expect } from "@playwright/test"
2020import { Page , _electron as electron } from "playwright"
21- import { ElectronApplication } from "playwright-core"
2221
2322import { main } from "../../../package.json"
2423
2524import { Tree } from "./Input"
2625
27- let app : ElectronApplication
28-
2926async function startElectron ( ) {
30- // Launch Electron app.
31- if ( ! app ) {
32- app = electron . launch ( { args : [ main ] } )
33- }
27+ // Launch Electron app; "shell" tells Kui to ignore the command line
28+ // and just launch a plain shell
29+ const app = await electron . launch ( { args : [ main , "shell" ] } )
3430
3531 const page = await ( await app ) . firstWindow ( )
3632
@@ -41,7 +37,7 @@ async function startElectron() {
4137
4238 await page . click ( ".repl-block.repl-active .repl-input-element" )
4339
44- return page
40+ return { app , page }
4541}
4642
4743async function checkNode ( page : Page , tree : Tree , containerSelector : string ) {
@@ -89,7 +85,7 @@ async function scanNodes(page: Page, children: Tree[], containerSelector: string
8985
9086export default function doPlan ( markdown : Input ) {
9187 test ( markdown . input , async ( ) => {
92- const page = await startElectron ( )
88+ const { app , page } = await startElectron ( )
9389
9490 // the path.relative is not needed, but we are using it to test
9591 // that relative paths work
@@ -102,6 +98,6 @@ export default function doPlan(markdown: Input) {
10298 await page . isVisible ( treeSelector )
10399 await scanNodes ( page , tree , treeSelector )
104100
105- await page . reload ( )
101+ await app . close ( )
106102 } )
107103}
0 commit comments