Skip to content

Commit

Permalink
Remove deprecated actions and Playwright API usage
Browse files Browse the repository at this point in the history
* Replace usage of deprecated GabrielBB/xvfb-action@v1
* Replace usage of deprecated <obj>.type(...)
  • Loading branch information
planger committed Mar 14, 2024
1 parent 5be216c commit 19b2abc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 2 additions & 3 deletions .github/workflows/production-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions examples/playwright/src/theia-quick-command-palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
5 changes: 2 additions & 3 deletions examples/playwright/src/theia-rename-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
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<void> {
Expand Down
2 changes: 1 addition & 1 deletion examples/playwright/src/theia-terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class TheiaTerminal extends TheiaView {
async write(text: string): Promise<void> {
await this.activate();
const input = await this.waitForInputArea();
await input.type(text);
await input.fill(text);
}

async contents(): Promise<string> {
Expand Down

0 comments on commit 19b2abc

Please sign in to comment.