diff --git a/.github/workflows/test-suite-web-e2e-pw.yml b/.github/workflows/test-suite-web-e2e-pw.yml index c6bd02a73d2..f60f2ee547d 100644 --- a/.github/workflows/test-suite-web-e2e-pw.yml +++ b/.github/workflows/test-suite-web-e2e-pw.yml @@ -93,27 +93,20 @@ jobs: fail-fast: false matrix: include: - # - TEST_GROUP: "@group=suite" - # CONTAINERS: "trezor-user-env-unix" - # CYPRESS_USE_TREZOR_USER_ENV_BRIDGE: "1" - # - TEST_GROUP: "@group=device-management" - # CONTAINERS: "trezor-user-env-unix" - # CYPRESS_USE_TREZOR_USER_ENV_BRIDGE: "1" + - TEST_GROUP: "@group=suite" + CONTAINERS: "trezor-user-env-unix" + - TEST_GROUP: "@group=device-management" + CONTAINERS: "trezor-user-env-unix" - TEST_GROUP: "@group=settings" CONTAINERS: "trezor-user-env-unix" - CYPRESS_USE_TREZOR_USER_ENV_BRIDGE: "1" - # - TEST_GROUP: "@group=metadata" - # CONTAINERS: "trezor-user-env-unix" - # CYPRESS_USE_TREZOR_USER_ENV_BRIDGE: "1" - # - TEST_GROUP: "@group=passphrase" - # CONTAINERS: "trezor-user-env-unix" - # CYPRESS_USE_TREZOR_USER_ENV_BRIDGE: "1" - # - TEST_GROUP: "@group=other" - # CONTAINERS: "trezor-user-env-unix" - # CYPRESS_USE_TREZOR_USER_ENV_BRIDGE: "1" + - TEST_GROUP: "@group=metadata" + CONTAINERS: "trezor-user-env-unix" + - TEST_GROUP: "@group=passphrase" + CONTAINERS: "trezor-user-env-unix" + - TEST_GROUP: "@group=other" + CONTAINERS: "trezor-user-env-unix" - TEST_GROUP: "@group=wallet" CONTAINERS: "trezor-user-env-unix bitcoin-regtest" - CYPRESS_USE_TREZOR_USER_ENV_BRIDGE: "1" steps: - name: Checkout uses: actions/checkout@v4 @@ -153,14 +146,13 @@ jobs: - 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 + ## Leave retries enabled once stabilized 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 }} @@ -174,7 +166,13 @@ jobs: docker compose up -d ${{ matrix.CONTAINERS }} echo "group ${TEST_GROUP}" yarn workspace @trezor/suite-desktop-core test:e2e:web --grep=${TEST_GROUP} + + - name: Check docker name + if: always() + run: docker ps + # - name: Upload logs + # if: ${{ ! cancelled() }} # run: | # docker cp docker_trezor-user-env-unix_1:/trezor-user-env/logs/debugging.log trezor-user-env-debugging.log || true # docker cp docker_trezor-user-env-unix_1:/trezor-user-env/logs/emulator_bridge.log tenv-emulator-bridge-debugging.log || true @@ -187,10 +185,6 @@ jobs: # with: # name: test-artifacts-${{ matrix.TEST_GROUP }} # path: | - # ./packages/suite-web/e2e/snapshots - # ./packages/suite-web/e2e/screenshots - # ./packages/suite-web/e2e/videos - # download-snapshots.sh # trezor-user-env-debugging.log # tenv-emulator-bridge-debugging.log # trezor-user-env-version.txt diff --git a/docker/docker-compose.suite-ci.yml b/docker/docker-compose.suite-ci.yml index 423caeda351..8ee275baad3 100644 --- a/docker/docker-compose.suite-ci.yml +++ b/docker/docker-compose.suite-ci.yml @@ -1,19 +1,13 @@ -version: "4.0" +version: "3.9" services: trezor-user-env-unix: image: ghcr.io/trezor/trezor-user-env:c637c2f58e799284f6019481fa0de30457bd6b60 environment: - SDL_VIDEODRIVER=dummy - XDG_RUNTIME_DIR=/var/tmp - ports: - - "9001:9001" - - "21325:21325" - - "21326:21326" - + network_mode: host 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 diff --git a/packages/suite-desktop-core/e2e/support/fixtures.ts b/packages/suite-desktop-core/e2e/support/fixtures.ts index a49fb9ebb91..0da2a7d971d 100644 --- a/packages/suite-desktop-core/e2e/support/fixtures.ts +++ b/packages/suite-desktop-core/e2e/support/fixtures.ts @@ -72,7 +72,8 @@ const test = base.extend({ const tracePath = `${testInfo.outputDir}/trace.electron.zip`; await window.context().tracing.stop({ path: tracePath }); } else { - await page.goto('/'); + await page.goto(process.env.BASE_URL || 'http://localhost:8000'); + // await page.goto('/'); await use(page); } }, diff --git a/packages/suite-desktop-core/e2e/support/pageActions/onboardingActions.ts b/packages/suite-desktop-core/e2e/support/pageActions/onboardingActions.ts index 8661f2f7e18..dd98b777c45 100644 --- a/packages/suite-desktop-core/e2e/support/pageActions/onboardingActions.ts +++ b/packages/suite-desktop-core/e2e/support/pageActions/onboardingActions.ts @@ -30,6 +30,17 @@ export class OnboardingActions { async completeOnboarding() { await this.optionallyDismissFwHashCheckError(); await this.analyticsContinueButton.click(); + const endpoints = [ + 'http://127.0.0.1:21325/', + 'http://127.0.0.1:9001/', + 'http://127.0.0.1:9002/', + 'http://127.0.0.1:21326/', + ]; + endpoints.forEach(async endpoint => { + const response = await this.window.request.post(endpoint); + // eslint-disable-next-line no-console + console.log(response); + }); await this.onboardingContinueButton.click(); await this.onboardingViewOnlySkipButton.click(); await this.viewOnlyTooltipGotItButton.click(); diff --git a/packages/suite-desktop-core/e2e/tests/general/cardano-discovery.test.ts b/packages/suite-desktop-core/e2e/tests/general/cardano-discovery.test.ts index 16b3d95a5ec..b1a75cd137d 100644 --- a/packages/suite-desktop-core/e2e/tests/general/cardano-discovery.test.ts +++ b/packages/suite-desktop-core/e2e/tests/general/cardano-discovery.test.ts @@ -1,35 +1,41 @@ import { test, expect } from '../../support/fixtures'; -test.use({ - emulatorConf: { - needs_backup: true, - mnemonic: - 'cloth trim improve bag pigeon party wave mechanic beyond clean cake maze protect left assist carry guitar bridge nest faith critic excuse tooth dutch', - }, -}); +test.describe('Cardano discovery', { tag: ['@group=wallet'] }, () => { + test.use({ + emulatorConf: { + needs_backup: true, + mnemonic: + 'cloth trim improve bag pigeon party wave mechanic beyond clean cake maze protect left assist carry guitar bridge nest faith critic excuse tooth dutch', + }, + }); -test.beforeEach(async ({ onboardingPage, dashboardPage }) => { - await onboardingPage.completeOnboarding(); - await dashboardPage.discoveryShouldFinish(); -}); + test.beforeEach(async ({ onboardingPage, dashboardPage }) => { + await onboardingPage.completeOnboarding(); + await dashboardPage.discoveryShouldFinish(); + }); -/** - * Test case: - * 1. Enable cardano and wait for discovery to finish - * 2. Check that all types of Cardano accounts are discovered - * 3. Check that Staking section is available - */ -test('Discover all Cardano account types', async ({ dashboardPage, settingsPage, walletPage }) => { - await settingsPage.navigateTo(); - await settingsPage.coinsTabButton.click(); - await settingsPage.enableCoin('ada'); - await settingsPage.disableCoin('btc'); + /** + * Test case: + * 1. Enable cardano and wait for discovery to finish + * 2. Check that all types of Cardano accounts are discovered + * 3. Check that Staking section is available + */ + test('Discover all Cardano account types', async ({ + dashboardPage, + settingsPage, + walletPage, + }) => { + await settingsPage.navigateTo(); + await settingsPage.coinsTabButton.click(); + await settingsPage.enableCoin('ada'); + await settingsPage.disableCoin('btc'); - await dashboardPage.navigateTo(); - await dashboardPage.discoveryShouldFinish(); + await dashboardPage.navigateTo(); + await dashboardPage.discoveryShouldFinish(); - await walletPage.expandAllAccountsInMenu(); - await walletPage.checkStakesOfCardanoAccounts(); + await walletPage.expandAllAccountsInMenu(); + await walletPage.checkStakesOfCardanoAccounts(); - expect(await walletPage.getAccountsCount('ada')).toEqual(3); + expect(await walletPage.getAccountsCount('ada')).toEqual(3); + }); }); diff --git a/packages/suite-desktop-core/e2e/tests/general/eap-modal.test.ts b/packages/suite-desktop-core/e2e/tests/general/eap-modal.test.ts index ec6ad4012ea..2ea20b7c82e 100644 --- a/packages/suite-desktop-core/e2e/tests/general/eap-modal.test.ts +++ b/packages/suite-desktop-core/e2e/tests/general/eap-modal.test.ts @@ -15,7 +15,7 @@ test.beforeAll(async ({ onboardingPage }) => { await onboardingPage.completeOnboarding(); }); -test('Join early access button', async ({ settingsPage }) => { +test('Join early access button', { tag: '@settings' }, async ({ settingsPage }) => { const buttonText = 'Leave'; await settingsPage.navigateTo(); await settingsPage.applicationTabButton.click(); diff --git a/packages/suite-desktop-core/e2e/tests/general/suite-guide.test.ts b/packages/suite-desktop-core/e2e/tests/general/suite-guide.test.ts index 4d54f5b65a1..a2b3c4e29e7 100644 --- a/packages/suite-desktop-core/e2e/tests/general/suite-guide.test.ts +++ b/packages/suite-desktop-core/e2e/tests/general/suite-guide.test.ts @@ -1,34 +1,36 @@ import { test, expect } from '../../support/fixtures'; -test.use({ startEmulator: false }); -/** - * Test case: - * 1. Go to Bug section in Suite Guide - * 2. Select Dashboard - * 3. Write into feedback field - * 4. Submit bug report (reporttext) - */ -test('Send a bug report', async ({ suiteGuidePage }) => { - await suiteGuidePage.openPanel(); - await suiteGuidePage.supportAndFeedbackButton.click(); - await suiteGuidePage.sendBugReport({ - location: 'account', - report: 'Henlo this is testy test writing hangry test user report', +test.describe('Suite Guide', { tag: '@suite' }, () => { + test.use({ startEmulator: false }); + /** + * Test case: + * 1. Go to Bug section in Suite Guide + * 2. Select Dashboard + * 3. Write into feedback field + * 4. Submit bug report (reporttext) + */ + test('Send a bug report', async ({ suiteGuidePage }) => { + await suiteGuidePage.openPanel(); + await suiteGuidePage.supportAndFeedbackButton.click(); + await suiteGuidePage.sendBugReport({ + location: 'account', + report: 'Henlo this is testy test writing hangry test user report', + }); + await expect(suiteGuidePage.feedbackSuccessToast).toBeVisible(); + await suiteGuidePage.closeGuide(); }); - await expect(suiteGuidePage.feedbackSuccessToast).toBeVisible(); - await suiteGuidePage.closeGuide(); -}); -/** - * Test case: - * 1. Go to Suggestion section in Suite Guide - * 2. Look up an article - * 3. Verify that the article is displayed - */ -test('Look up an article', async ({ suiteGuidePage }) => { - const article = 'Install firmware'; - await suiteGuidePage.openPanel(); - await suiteGuidePage.lookupArticle(article); - await expect(suiteGuidePage.articleHeader).toHaveText(article); - await suiteGuidePage.closeGuide(); + /** + * Test case: + * 1. Go to Suggestion section in Suite Guide + * 2. Look up an article + * 3. Verify that the article is displayed + */ + test('Look up an article', async ({ suiteGuidePage }) => { + const article = 'Install firmware'; + await suiteGuidePage.openPanel(); + await suiteGuidePage.lookupArticle(article); + await expect(suiteGuidePage.articleHeader).toHaveText(article); + await suiteGuidePage.closeGuide(); + }); });