From 19b2abc7820452301a6b1ca4786cb8d67ca98504 Mon Sep 17 00:00:00 2001 From: Philip Langer Date: Thu, 14 Mar 2024 10:16:50 +0100 Subject: [PATCH] Remove deprecated actions and Playwright API usage * Replace usage of deprecated GabrielBB/xvfb-action@v1 * Replace usage of deprecated .type(...) --- .github/workflows/performance-tests.yml | 4 ++-- .github/workflows/playwright.yml | 5 ++--- .github/workflows/production-smoke-test.yml | 5 ++--- examples/playwright/src/theia-quick-command-palette.ts | 4 ++-- examples/playwright/src/theia-rename-dialog.ts | 5 ++--- examples/playwright/src/theia-terminal.ts | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/performance-tests.yml b/.github/workflows/performance-tests.yml index 065de46991490..964d146850f5d 100644 --- a/.github/workflows/performance-tests.yml +++ b/.github/workflows/performance-tests.yml @@ -36,12 +36,12 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9 - name: Performance (browser) - uses: GabrielBB/xvfb-action@v1 + uses: coactions/setup-xvfb@v1 with: run: yarn performance:startup:browser - name: Performance (Electron) - uses: GabrielBB/xvfb-action@v1 + uses: coactions/setup-xvfb@v1 with: run: yarn performance:startup:electron diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 953096017ee3d..03c73cdeb4922 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -49,6 +49,5 @@ jobs: yarn --cwd examples/playwright build - name: Test (playwright) - uses: GabrielBB/xvfb-action@v1 - with: - run: yarn --cwd examples/playwright ui-tests-ci + shell: bash + run: yarn --cwd examples/playwright ui-tests-ci diff --git a/.github/workflows/production-smoke-test.yml b/.github/workflows/production-smoke-test.yml index 216d39f841422..51a5267eb67c0 100644 --- a/.github/workflows/production-smoke-test.yml +++ b/.github/workflows/production-smoke-test.yml @@ -47,6 +47,5 @@ jobs: yarn --cwd examples/playwright build - name: Run Smoke Test (examples/playwright/src/tests/theia-app) - uses: GabrielBB/xvfb-action@v1 - with: - run: yarn test:playwright theia-app + shell: bash + run: yarn test:playwright theia-app diff --git a/examples/playwright/src/theia-quick-command-palette.ts b/examples/playwright/src/theia-quick-command-palette.ts index 2728bb0b00d21..a56e4c113ade5 100644 --- a/examples/playwright/src/theia-quick-command-palette.ts +++ b/examples/playwright/src/theia-quick-command-palette.ts @@ -63,10 +63,10 @@ export class TheiaQuickCommandPalette extends TheiaPageObject { if (!await this.isOpen()) { this.open(); } - const input = await this.page.waitForSelector(`${this.selector} .monaco-inputbox .input`); + const input = this.page.locator(`${this.selector} .monaco-inputbox .input`); if (input != null) { await input.focus(); - await input.type(value, { delay: USER_KEY_TYPING_DELAY }); + await input.pressSequentially(value, { delay: USER_KEY_TYPING_DELAY }); if (confirm) { await this.page.keyboard.press('Enter'); } diff --git a/examples/playwright/src/theia-rename-dialog.ts b/examples/playwright/src/theia-rename-dialog.ts index 22114444342b5..b90a82368cdcc 100644 --- a/examples/playwright/src/theia-rename-dialog.ts +++ b/examples/playwright/src/theia-rename-dialog.ts @@ -15,15 +15,14 @@ // ***************************************************************************** import { TheiaDialog } from './theia-dialog'; -import { OSUtil, USER_KEY_TYPING_DELAY } from './util'; +import { OSUtil } from './util'; export class TheiaRenameDialog extends TheiaDialog { async enterNewName(newName: string): Promise { const inputField = await this.page.waitForSelector(`${this.blockSelector} .theia-input`); await inputField.press(OSUtil.isMacOS ? 'Meta+a' : 'Control+a'); - await inputField.type(newName, { delay: USER_KEY_TYPING_DELAY }); - await this.page.waitForTimeout(USER_KEY_TYPING_DELAY); + await inputField.fill(newName); } async confirm(): Promise { diff --git a/examples/playwright/src/theia-terminal.ts b/examples/playwright/src/theia-terminal.ts index 053cc63a46524..72fd695e06fe9 100644 --- a/examples/playwright/src/theia-terminal.ts +++ b/examples/playwright/src/theia-terminal.ts @@ -38,7 +38,7 @@ export class TheiaTerminal extends TheiaView { async write(text: string): Promise { await this.activate(); const input = await this.waitForInputArea(); - await input.type(text); + await input.fill(text); } async contents(): Promise {