diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index f55151b..f0d1da8 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -52,9 +52,9 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] node-version: [14.x, 16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - exclude: - - {os: windows-latest, node: 16.x} - - {os: macOS-latest, node: 16.x} + exclude: + - {os: windows-latest, node: 16.x} + - {os: macOS-latest, node: 16.x} steps: - uses: actions/checkout@v2 diff --git a/src/platform-browser.ts b/src/platform-browser.ts index 56eca5b..5cb57cb 100644 --- a/src/platform-browser.ts +++ b/src/platform-browser.ts @@ -50,8 +50,7 @@ export default class PlatformBrowser implements Platform { this.silent = silent; } - async run(ctx: Context, file: string): Promise { - const {child, port} = await start(this.driver, this.silent); + async interact(ctx: Context, file: string, port: number): Promise { const client = await WebDriver.newSession({ logLevel: 'warn', port, @@ -75,7 +74,17 @@ export default class PlatformBrowser implements Platform { )) as Result; await client.deleteSession(); - await stop(child); return result; } + + async run(ctx: Context, file: string): Promise { + const {child, port} = await start(this.driver, this.silent); + try { + const result = await this.interact(ctx, file, port); + await stop(child); + return result; + } finally { + await stop(child); + } + } }