Skip to content

Commit 0e9662a

Browse files
committed
test: iterate on travis yaml
1 parent f4bb5c1 commit 0e9662a

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
language: node_js
22
node_js: 16
33

4-
before_script:
5-
- export DISPLAY=:1; Xvfb $DISPLAY -screen 0 ${WINDOW_WIDTH}x${WINDOW_HEIGHT}x24 $DISPLAY -ac > /dev/null &
4+
services:
5+
- xvfb
66

7-
# default install script
87
install:
98
- npm ci
10-
- RUNNING_KUI_TEST=true npm run watch
9+
10+
before_script:
11+
- RUNNING_KUI_TEST=true npm run watch:electron
1112

1213
script:
1314
- npm test

tests/plugin-madwizard/plan/plan.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,15 @@ import { join, relative } from "path"
1818

1919
import { test, expect } from "@playwright/test"
2020
import { Page, _electron as electron } from "playwright"
21-
import { ElectronApplication } from "playwright-core"
2221

2322
import { main } from "../../../package.json"
2423

2524
import { Tree } from "./Input"
2625

27-
let app: ElectronApplication
28-
2926
async 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

4743
async function checkNode(page: Page, tree: Tree, containerSelector: string) {
@@ -89,7 +85,7 @@ async function scanNodes(page: Page, children: Tree[], containerSelector: string
8985

9086
export 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

Comments
 (0)