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

fix(e2e): Finetune local timeout #17397

Merged
merged 2 commits into from
Mar 5, 2025
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
6 changes: 2 additions & 4 deletions docs/tests/e2e-playwright-suite.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ Steps:

1. **To enable Electron verbose logging** add env variable LOGLEVEL=debug or any other level

1. **To increase test timeouts** when your local run exceed 1m limit, you can specify test timeout override in `packages/suite-desktop-core/.env`. (UI runner --ui needs to be restarted to reflect the change in `.env`)

## Contribution

Please follow our general [Playwright contribution guide](e2e-playwright-contribution-guide.md)
Expand Down Expand Up @@ -137,7 +139,3 @@ To open last HTML report run:
### Currents.dev

Test reports are uploaded to [currents.dev](https://app.currents.dev/)

### Artifacts on CI

Every Playwright test run contains attached artifact of both Playwright report and docker logs. Download, unpack and show with `yarn playwright show-report ./path/to/report`
7 changes: 5 additions & 2 deletions packages/suite-desktop-core/.example.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

# Secret wallet passphrase dedicated for automated Trading tests
PASSPHRASE=
# Secret wallet passphrase dedicated for automated Trading tests (mandatory)
PASSPHRASE=

# Custom Test timeout override, for convenient test development (optional)
TEST_TIMEOUT_OVERRIDE=
16 changes: 13 additions & 3 deletions packages/suite-desktop-core/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@ export enum PlaywrightProjects {
Web = 'web',
Desktop = 'desktop',
}
const timeoutCIRun = 1000 * 180;
const timeoutLocalRun = 1000 * 60;

const CI_TIMEOUT = 1000 * 180;
const LOCAL_TIMEOUT = 1000 * 90;

function getTimeout(): number {
if (process.env.TEST_TIMEOUT_OVERRIDE) {
return Number(process.env.TEST_TIMEOUT_OVERRIDE);
}

return process.env.GITHUB_ACTION ? CI_TIMEOUT : LOCAL_TIMEOUT;
}

const config: PlaywrightTestConfig = {
projects: [
Expand All @@ -37,12 +46,13 @@ const config: PlaywrightTestConfig = {
video: 'on',
screenshot: 'on',
testIdAttribute: 'data-testid',
actionTimeout: 1000 * 15,
},
reportSlowTests: null,
reporter: process.env.GITHUB_ACTION
? [['list'], ['@currents/playwright']]
: [['list'], ['html', { open: 'never' }]],
timeout: process.env.GITHUB_ACTION ? timeoutCIRun : timeoutLocalRun,
timeout: getTimeout(),
outputDir: path.join(__dirname, 'test-results'),
snapshotPathTemplate: 'snapshots/{projectName}/{testFilePath}/{arg}{ext}',
};
Expand Down