Skip to content

Commit

Permalink
feat(e2e): Debuging PW web tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Vere-Grey committed Dec 3, 2024
1 parent 2377817 commit eb86a7d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test-suite-web-e2e-pw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,19 @@ jobs:
- name: Install Playwright browsers
run: npx playwright install

## MOVE PULL HERE

- name: Run Playwright e2e tests
env:
COMPOSE_FILE: ./docker/docker-compose.suite-ci.yml
BASE_URL: https://dev.suite.sldev.cz/suite-web/feat-parametrize-pw-suite/web/

BASE_URL: https://dev.suite.sldev.cz/suite-web/convert-cy-pw-settings/web/
## reporter url
TRACK_SUITE_URL: https://track-suite-ff9ad9f5b4f6.herokuapp.com
## when debugging or developing tests it does not make sense to have retries,
## in other cases retries are useful to avoid occasional failures due to flaky tests
ALLOW_RETRY: false
TEST_GROUP: ${{ matrix.TEST_GROUP }}
GITHUB_ACTION: true
CI_JOB_ID: ${{ github.run_id }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
Expand Down
7 changes: 1 addition & 6 deletions docker/docker-compose.suite-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@ services:
environment:
- SDL_VIDEODRIVER=dummy
- XDG_RUNTIME_DIR=/var/tmp
ports:
- "9001:9001"
- "21325:21325"
- "21326:21326"
network_mode: bridge # this makes docker reuse existing networks

bitcoin-regtest:
image: ghcr.io/trezor/trezor-user-env-regtest # this is a special image that runs regtest and blockbook
depends_on:
- trezor-user-env-unix
ports:
- "50001:50001"
network_mode: service:trezor-user-env-unix
10 changes: 8 additions & 2 deletions packages/suite-desktop-core/e2e/support/fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react-hooks/rules-of-hooks */

import { test as base, ElectronApplication, Page } from '@playwright/test';
import { test as base, ElectronApplication, Page, expect } from '@playwright/test';

import { TrezorUserEnvLink, TrezorUserEnvLinkClass } from '@trezor/trezor-user-env-link';

Expand Down Expand Up @@ -72,7 +72,13 @@ const test = base.extend<Fixtures>({
const tracePath = `${testInfo.outputDir}/trace.electron.zip`;
await window.context().tracing.stop({ path: tracePath });
} else {
await page.goto('/');
// eslint-disable-next-line no-console
console.log('Config:', process.env.BASE_URL || 'http://localhost:8000');
// eslint-disable-next-line no-console
console.log('Fixture BASE_URL:', process.env.BASE_URL);
await page.goto(process.env.BASE_URL!);
// await page.goto('/');
await expect(page).toHaveURL(process.env.BASE_URL!);
await use(page);
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export class OnboardingActions {
}

async optionallyDismissFwHashCheckError() {
// eslint-disable-next-line no-console
console.log('Onboarding BASE_URL:', process.env.BASE_URL);
await expect(this.welcomeTitle).toBeVisible();
// dismisses the error modal only if it appears (handle it async in parallel, not necessary to block the rest of the flow)
this.window
Expand All @@ -28,6 +30,8 @@ export class OnboardingActions {
}

async completeOnboarding() {
// eslint-disable-next-line no-console
console.log('Onboarding BASE_URL:', process.env.BASE_URL);
await this.optionallyDismissFwHashCheckError();
await this.analyticsContinueButton.click();
await this.onboardingContinueButton.click();
Expand Down

0 comments on commit eb86a7d

Please sign in to comment.