Skip to content

Commit

Permalink
Remove deprecated actions and Playwright API usage (#13491)
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(...)
* Remove xvfb action and use it directly
* Pin the Python version to 3.11.
  • Loading branch information
planger authored Mar 15, 2024
1 parent 401d4b9 commit 2c0c211
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 27 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"

- name: Use Python 3.x
- name: Use Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: '3.11'

- name: Build
shell: bash
Expand All @@ -36,14 +36,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Performance (browser)
uses: GabrielBB/xvfb-action@v1
with:
run: yarn performance:startup:browser
shell: bash
run: yarn performance:startup:browser

- name: Performance (Electron)
uses: GabrielBB/xvfb-action@v1
with:
run: yarn performance:startup:electron
shell: bash
run: xvfb-run yarn performance:startup:electron

- name: Analyze performance results
uses: benchmark-action/github-action-benchmark@v1
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
12 changes: 5 additions & 7 deletions examples/playwright/src/theia-quick-command-palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,11 @@ export class TheiaQuickCommandPalette extends TheiaPageObject {
if (!await this.isOpen()) {
this.open();
}
const input = await this.page.waitForSelector(`${this.selector} .monaco-inputbox .input`);
if (input != null) {
await input.focus();
await input.type(value, { delay: USER_KEY_TYPING_DELAY });
if (confirm) {
await this.page.keyboard.press('Enter');
}
const input = this.page.locator(`${this.selector} .monaco-inputbox .input`);
await input.focus();
await input.pressSequentially(value, { delay: USER_KEY_TYPING_DELAY });
if (confirm) {
await this.page.keyboard.press('Enter');
}
}

Expand Down
9 changes: 4 additions & 5 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 { USER_KEY_TYPING_DELAY } 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);
const inputField = this.page.locator(`${this.blockSelector} .theia-input`);
await inputField.selectText();
await inputField.pressSequentially(newName, { delay: USER_KEY_TYPING_DELAY });
}

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 2c0c211

Please sign in to comment.