Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated actions and Playwright API usage #13491

Merged
merged 3 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

@planger planger Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xai Do you think omitting xvfb will be a problem for Electron? If yes, we'd need to switch to setup-xvfb as gabrielbb-xvfb-action is deprecated. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need xvfb because we cannot run Electron headless. So yes, we should switch to the maintained action.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, no problem! I updated this PR. Can you please test if this works now? Thank you!

Copy link
Contributor

@xai xai Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to test by running the workflow, right?
Edit: I am of course testing the code change ;)

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
Loading