Skip to content
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
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@
"run-system-tests:ios-login": "yarn playwright test --project system-ios-login --config tests/playwright.system.config.ts",
"run-system-tests:ios-onboarding": "yarn playwright test --project system-ios-onboarding --config tests/playwright.system.config.ts",
"run-system-tests:all": "yarn playwright test --config tests/playwright.system.config.ts",
"run-system-tests:android-login-emu": "yarn playwright test --project system-android-login-emu --config tests/playwright.system-emulator.config.ts",
"run-system-tests:android-onboarding-emu": "yarn playwright test --project system-android-onboarding-emu --config tests/playwright.system-emulator.config.ts",
"run-system-tests:ios-login-sim": "yarn playwright test --project system-ios-login-sim --config tests/playwright.system-emulator.config.ts",
"run-system-tests:ios-onboarding-sim": "yarn playwright test --project system-ios-onboarding-sim --config tests/playwright.system-emulator.config.ts",
"test:depcheck": "yarn depcheck",
"test:tgz-check": "./scripts/tgz-check.sh",
"test:attribution-check": "./scripts/attributions-check.sh",
Expand Down
58 changes: 48 additions & 10 deletions tests/performance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,22 @@ npx playwright test --grep "@PerformanceLogin.*@PerformanceLaunch" --project and

## Test Tags

Tests are tagged with area-specific tags defined in `tests/tags.performance.js`. These tags allow for selective test execution based on which areas of the app are affected by code changes.
Tags are defined in `tests/tags.performance.js` and embedded in `test.describe()` names. They are runner-agnostic — any runner with `--grep` support can filter by them.

### Test Type Tags

These tags control which Playwright config picks up a test:

| Tag | Description | Config that filters for it |
| -------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `@Performance` | Test measures performance (uses `TimerHelper`, quality gates enforced) | `playwright.config.ts` (`grep: /@Performance/`) |
| `@System` | Test verifies functionality (no quality gates or metrics) | `playwright.system.config.ts` / `playwright.system-emulator.config.ts` (`grep: /@System/`) |

Most existing tests are tagged with **both** `@Performance @System` — they measure perf and also serve as system smoke tests. A test can use just one tag if it should only run in one suite.

### Area Tags

These tags categorize tests by feature area and can be used with `--grep` for ad-hoc filtering:

| Tag | Description |
| -------------------------- | ------------------------------------------------------------- |
Expand All @@ -232,18 +247,41 @@ Tests are tagged with area-specific tags defined in `tests/tags.performance.js`.
| `@PerformancePredict` | Predict market performance (market list, details, deposits) |
| `@PerformancePreps` | Perpetuals trading performance (positions, add funds, orders) |

Tags are imported into test files from `tests/tags.performance.js`:
### Tagging Convention

Import type tags and area tags from `tests/tags.performance.js`:

```typescript
import { PerformanceLogin, PerformanceSwaps } from '../../tags.performance.js';
import {
Performance,
System,
PerformanceLogin,
PerformanceSwaps,
} from '../../tags.performance.js';

perfTest.describe(`${PerformanceLogin} ${PerformanceSwaps}`, () => {
perfTest(
'Swap flow performance',
async ({ currentDeviceDetails, driver, performanceTracker }, testInfo) => {
// test implementation
},
);
// Both perf and system test (most common):
perfTest.describe(
`${Performance} ${System} ${PerformanceLogin} ${PerformanceSwaps}`,
() => {
perfTest(
'Swap flow performance',
async (
{ currentDeviceDetails, driver, performanceTracker },
testInfo,
) => {
// test implementation with TimerHelper and thresholds
},
);
},
);

// System-only test (functional verification, no perf measurement):
test.describe(`${System} ${PerformanceLogin}`, () => {
test('Verify wallet loads after login', async ({ driver }) => {
// No TimerHelper — pure functional check
await loginToAppPlaywright();
await WalletView.waitForAccountName('Account 1');
});
});
```

Expand Down
4 changes: 3 additions & 1 deletion tests/performance/login/asset-balances.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import WalletView from '../../page-objects/wallet/WalletView';
import { loginToAppPlaywright } from '../../flows/wallet.flow';

import {
Performance,
System,
PerformanceLogin,
PerformanceAssetLoading,
} from '../../tags.performance.js';

/* Scenario: Aggregated Balance Loading Time, SRP 1 + SRP 2 + SRP 3 */
test.describe(`${PerformanceLogin} ${PerformanceAssetLoading}`, () => {
test.describe(`${Performance} ${System} ${PerformanceLogin} ${PerformanceAssetLoading}`, () => {
test(
'Aggregated Balance Loading Time, SRP 1 + SRP 2 + SRP 3',
{ tag: '@assets-dev-team' },
Expand Down
73 changes: 40 additions & 33 deletions tests/performance/login/asset-view.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,52 @@ import { asPlaywrightElement, PlaywrightAssertions } from '../../framework';
import WalletView from '../../page-objects/wallet/WalletView';
import TokenOverview from '../../page-objects/wallet/TokenOverview';
import {
Performance,
PerformanceLogin,
PerformanceAssetLoading,
} from '../../tags.performance.js';

/* Scenario 8: Asset View, SRP 1 + SRP 2 + SRP 3 */
perfTest.describe(`${PerformanceLogin} ${PerformanceAssetLoading}`, () => {
perfTest(
'Asset View, SRP 1 + SRP 2 + SRP 3',
{ tag: '@assets-dev-team' },
async ({ currentDeviceDetails, driver, performanceTracker }, testInfo) => {
await loginToAppPlaywright();
perfTest.describe(
`${Performance} ${PerformanceLogin} ${PerformanceAssetLoading}`,
() => {
perfTest(
'Asset View, SRP 1 + SRP 2 + SRP 3',
{ tag: '@assets-dev-team' },
async (
{ currentDeviceDetails, driver, performanceTracker },
testInfo,
) => {
await loginToAppPlaywright();

const assetViewScreen = new TimerHelper(
'Time since the user clicks on the asset view button until the user sees the token overview screen',
{ ios: 600, android: 4500 },
currentDeviceDetails.platform,
);
const assetViewScreen = new TimerHelper(
'Time since the user clicks on the asset view button until the user sees the token overview screen',
{ ios: 600, android: 4500 },
currentDeviceDetails.platform,
);

await WalletView.tapOnTokensSection();
await WalletView.tapOnToken('USDC');
await WalletView.tapOnTokensSection();
await WalletView.tapOnToken('USDC');

await assetViewScreen.measure(async () => {
await PlaywrightAssertions.expectElementToBeVisible(
asPlaywrightElement(TokenOverview.container),
);
await PlaywrightAssertions.expectElementToBeVisible(
asPlaywrightElement(TokenOverview.sendButton),
);
// Replicating the logic of the old spec to wait for the todays change to be visible isTodaysChangeVisible method in the TokenOverview wdio screen object
await PlaywrightAssertions.expectElementToBeVisibleWithSettle(
asPlaywrightElement(TokenOverview.todaysChange),
{
timeout: 10000,
settleMs: 500,
},
);
});
await assetViewScreen.measure(async () => {
await PlaywrightAssertions.expectElementToBeVisible(
asPlaywrightElement(TokenOverview.container),
);
await PlaywrightAssertions.expectElementToBeVisible(
asPlaywrightElement(TokenOverview.sendButton),
);
// Replicating the logic of the old spec to wait for the todays change to be visible isTodaysChangeVisible method in the TokenOverview wdio screen object
await PlaywrightAssertions.expectElementToBeVisibleWithSettle(
asPlaywrightElement(TokenOverview.todaysChange),
{
timeout: 10000,
settleMs: 500,
},
);
});

performanceTracker.addTimer(assetViewScreen);
},
);
});
performanceTracker.addTimer(assetViewScreen);
},
);
},
);
9 changes: 7 additions & 2 deletions tests/performance/login/cross-chain-swap-flow.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { test } from '../../framework/fixture';
import TimerHelper from '../../framework/TimerHelper.js';
import { PerformanceLogin, PerformanceSwaps } from '../../tags.performance.js';
import {
Performance,
System,
PerformanceLogin,
PerformanceSwaps,
} from '../../tags.performance.js';
import { loginToAppPlaywright } from '../../flows/wallet.flow.js';
import WalletView from '../../page-objects/wallet/WalletView.js';
import QuoteView from '../../page-objects/swaps/QuoteView.js';

/* Scenario 7: Cross-chain swap flow - ETH to SOL - 50+ accounts, SRP 1 + SRP 2 + SRP 3 */
test.describe(`${PerformanceLogin} ${PerformanceSwaps}`, () => {
test.describe(`${Performance} ${System} ${PerformanceLogin} ${PerformanceSwaps}`, () => {
test(
'Cross-chain swap flow - ETH to SOL - 50+ accounts, SRP 1 + SRP 2 + SRP 3',
{ tag: '@swap-bridge-dev-team' },
Expand Down
9 changes: 7 additions & 2 deletions tests/performance/login/eth-swap-flow.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { test } from '../../framework/fixture';
import TimerHelper from '../../framework/TimerHelper';
import { PerformanceLogin, PerformanceSwaps } from '../../tags.performance.js';
import {
Performance,
System,
PerformanceLogin,
PerformanceSwaps,
} from '../../tags.performance.js';
import { loginToAppPlaywright } from '../../flows/wallet.flow';
import WalletView from '../../page-objects/wallet/WalletView';
import QuoteView from '../../page-objects/swaps/QuoteView';

/* Scenario 6: Swap flow - ETH to LINK, SRP 1 + SRP 2 + SRP 3 */
test.describe(`${PerformanceLogin} ${PerformanceSwaps}`, () => {
test.describe(`${Performance} ${System} ${PerformanceLogin} ${PerformanceSwaps}`, () => {
test(
'Swap flow - ETH to LINK, SRP 1 + SRP 2 + SRP 3',
{ tag: '@swap-bridge-dev-team' },
Expand Down
Loading
Loading