Skip to content

Commit 33a0600

Browse files
committed
test: lw-12373 add e2e support for Firefox
1 parent 916b788 commit 33a0600

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+557
-191
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: process-smoke-reports
2+
3+
inputs:
4+
BROWSER:
5+
description: 'browser'
6+
required: true
7+
type: string
8+
default: chrome
9+
SMOKE_TESTS_RESULT:
10+
required: true
11+
type: string
12+
GH_TOKEN:
13+
description: 'Github token'
14+
required: true
15+
E2E_AWS_ACCESS_KEY_ID:
16+
required: true
17+
E2E_AWS_SECRET_ACCESS_KEY:
18+
required: true
19+
E2E_REPORTS_USER:
20+
required: true
21+
E2E_REPORTS_PASSWORD:
22+
required: true
23+
E2E_REPORTS_URL:
24+
required: true
25+
runs:
26+
using: 'composite'
27+
28+
steps:
29+
- name: Download all smoke tests artifacts
30+
uses: actions/download-artifact@v4
31+
with:
32+
path: .
33+
pattern: 'runner-artifacts-*'
34+
merge-multiple: true
35+
36+
- name: Create allure properties
37+
shell: bash
38+
if: always()
39+
working-directory: ./reports/allure/results
40+
run: |
41+
echo "
42+
branch=${{ github.ref_name }}
43+
browser= ${{ inputs.BROWSER }}
44+
tags= '@Smoke'
45+
platform=Linux
46+
" > environment.properties
47+
48+
- name: Publish allure report to S3
49+
uses: andrcuns/[email protected]
50+
if: always()
51+
env:
52+
GITHUB_AUTH_TOKEN: ${{ inputs.GH_TOKEN }}
53+
AWS_ACCESS_KEY_ID: ${{ inputs.E2E_AWS_ACCESS_KEY_ID }}
54+
AWS_SECRET_ACCESS_KEY: ${{ inputs.E2E_AWS_SECRET_ACCESS_KEY }}
55+
with:
56+
storageType: s3
57+
resultsGlob: './reports/allure/results'
58+
bucket: lace-e2e-test-results
59+
prefix: 'smoke/linux/${{ inputs.BROWSER }}/${{ github.run_number }}'
60+
copyLatest: true
61+
ignoreMissingResults: true
62+
updatePr: comment
63+
baseUrl: 'https://${{ inputs.E2E_REPORTS_USER }}:${{ inputs.E2E_REPORTS_PASSWORD }}@${{ inputs.E2E_REPORTS_URL }}'
64+
65+
- name: Publish artifacts (logs, reports, screenshots)
66+
uses: actions/upload-artifact@v4
67+
if: always()
68+
with:
69+
name: test-artifacts
70+
path: |
71+
./packages/e2e-tests/screenshots
72+
./packages/e2e-tests/logs
73+
./packages/e2e-tests/reports
74+
retention-days: 5
75+
76+
- run: |
77+
if [[ "${{ inputs.SMOKE_TESTS_RESULT }}" == "success" ]]; then
78+
exit 0
79+
else
80+
exit 1
81+
fi

.github/actions/test/smoke/action.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: run-smoke-e2e
2+
3+
inputs:
4+
BROWSER:
5+
description: 'browser'
6+
required: true
7+
type: string
8+
default: 'chrome'
9+
BATCH:
10+
description: 'Tests batch'
11+
required: true
12+
type: number
13+
WALLET_PASSWORD:
14+
description: 'Test wallet password'
15+
required: true
16+
GH_TOKEN:
17+
description: 'Github token'
18+
required: true
19+
TEST_DAPP_URL:
20+
description: 'Test DApp Url'
21+
required: true
22+
23+
runs:
24+
using: 'composite'
25+
26+
steps:
27+
- name: Setup Node.js and install dependencies
28+
uses: ./.github/actions/install
29+
with:
30+
WALLET_PASSWORD: ${{ inputs.WALLET_PASSWORD }}
31+
GITHUB_TOKEN: ${{ inputs.GH_TOKEN }}
32+
33+
- name: Download Lace build artifact
34+
uses: actions/download-artifact@v4
35+
with:
36+
name: '${{ env.BUILD_ARTIFACT_NAME }}-${{ inputs.BROWSER }}'
37+
path: ./apps/browser-extension-wallet/dist
38+
39+
- name: Setup Firefox Developer Edition
40+
id: setup-firefox
41+
uses: browser-actions/setup-firefox@v1
42+
with:
43+
firefox-version: 'latest-devedition'
44+
if: inputs.BROWSER == 'firefox'
45+
46+
- name: Verify Firefox Installation
47+
if: inputs.BROWSER == 'firefox'
48+
shell: bash
49+
run: |
50+
echo Installed firefox versions: ${{ steps.setup-firefox.outputs.firefox-version }}
51+
${{ steps.setup-firefox.outputs.firefox-path }} --version
52+
53+
- name: Execute E2E tests for ${{ inputs.BROWSER }}
54+
uses: ./.github/actions/test/e2e
55+
with:
56+
BATCH: ${{ inputs.BATCH }}
57+
SMOKE_ONLY: true
58+
TEST_DAPP_URL: ${{ inputs.TEST_DAPP_URL }}
59+
WALLET_PASSWORD: ${{ inputs.WALLET_PASSWORD }}
60+
SERVICE_WORKER_LOGS: true

.github/workflows/ci.yml

Lines changed: 90 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ jobs:
230230
SENTRY_PROJECT: ${{ startsWith(github.ref, 'refs/heads/release') && vars.SENTRY_PROJECT || ''}}
231231
SENTRY_ENVIRONMENT: 'production'
232232
DAPP_RADAR_API_KEY: ${{ startsWith(github.ref, 'refs/heads/release') && secrets.DAPP_RADAR_API_KEY || '' }}
233-
233+
234234
build:
235235
name: Build Lace
236236
runs-on: ubuntu-22.04
@@ -239,9 +239,33 @@ jobs:
239239
- name: Checkout repository
240240
uses: actions/checkout@v4
241241

242-
- name: Build Lace artifact
242+
- name: Build Lace chrome artifact
243+
uses: ./.github/shared/build
244+
with:
245+
BROWSER_TARGET: 'chromium'
246+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
247+
LACE_EXTENSION_KEY: ${{ secrets.MANIFEST_PUBLIC_KEY }}
248+
BLOCKFROST_PROJECT_ID_MAINNET: ${{ secrets.BLOCKFROST_PROJECT_ID_MAINNET }}
249+
BLOCKFROST_PROJECT_ID_PREPROD: ${{ secrets.BLOCKFROST_PROJECT_ID_PREPROD }}
250+
BLOCKFROST_PROJECT_ID_PREVIEW: ${{ secrets.BLOCKFROST_PROJECT_ID_PREVIEW }}
251+
BLOCKFROST_PROJECT_ID_SANCHONET: ${{ secrets.BLOCKFROST_PROJECT_ID_SANCHONET }}
252+
SENTRY_AUTH_TOKEN: ${{ startsWith(github.ref, 'refs/heads/release') && secrets.SENTRY_AUTH_TOKEN || '' }}
253+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
254+
SENTRY_ORG: ${{ startsWith(github.ref, 'refs/heads/release') && vars.SENTRY_ORG || '' }}
255+
SENTRY_PROJECT: ${{ startsWith(github.ref, 'refs/heads/release') && vars.SENTRY_PROJECT || ''}}
256+
SENTRY_ENVIRONMENT: 'smoke-tests'
257+
WALLET_POLLING_INTERVAL_IN_SEC: 5
258+
259+
- name: Upload chrome artifact
260+
uses: actions/upload-artifact@v4
261+
with:
262+
name: '${{ env.BUILD_ARTIFACT_NAME }}-chrome'
263+
path: ./apps/browser-extension-wallet/dist
264+
265+
- name: Build Lace firefox artifact
243266
uses: ./.github/shared/build
244267
with:
268+
BROWSER_TARGET: 'firefox'
245269
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
246270
LACE_EXTENSION_KEY: ${{ secrets.MANIFEST_PUBLIC_KEY }}
247271
BLOCKFROST_PROJECT_ID_MAINNET: ${{ secrets.BLOCKFROST_PROJECT_ID_MAINNET }}
@@ -255,104 +279,97 @@ jobs:
255279
SENTRY_ENVIRONMENT: 'smoke-tests'
256280
WALLET_POLLING_INTERVAL_IN_SEC: 5
257281

258-
- name: Upload build artifact
282+
- name: Upload firefox artifact
259283
uses: actions/upload-artifact@v4
260284
with:
261-
name: '${{ env.BUILD_ARTIFACT_NAME }}'
285+
name: '${{ env.BUILD_ARTIFACT_NAME }}-firefox'
262286
path: ./apps/browser-extension-wallet/dist
263287

264-
smokeTests:
265-
name: Smoke e2e tests
288+
smokeTests-chrome:
289+
name: Smoke e2e tests - Chrome
266290
runs-on: ubuntu-22.04
267291
needs: build
268292
strategy:
269293
fail-fast: false
270294
matrix:
271295
batch: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
296+
272297
steps:
273298
- name: Checkout repository
274299
uses: actions/checkout@v4
275300

276-
- name: Setup Node.js and install dependencies
277-
uses: ./.github/actions/install
301+
- name: Execute E2E tests - Chrome
302+
uses: ./.github/actions/test/smoke
278303
with:
304+
BROWSER: "chrome"
305+
BATCH: ${{ matrix.batch }}
306+
TEST_DAPP_URL: ${{ secrets.TEST_DAPP_URL }}
279307
WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }}
280-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
308+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
281309

282-
- name: Download Lace build artifact
283-
uses: actions/download-artifact@v4
284-
with:
285-
name: '${{ env.BUILD_ARTIFACT_NAME }}'
286-
path: ./apps/browser-extension-wallet/dist
310+
processReports-chrome:
311+
name: Process smoke e2e test reports - Chrome
312+
runs-on: ubuntu-22.04
313+
needs: smokeTests-chrome
314+
if: always()
315+
steps:
316+
- name: Checkout repository
317+
- uses: actions/checkout@v4
318+
319+
- name: Run reports processing - Chrome
320+
uses: ./.github/actions/test/reports
321+
with:
322+
BROWSER: 'chrome'
323+
SMOKE_TESTS_RESULT: ${{ needs.smokeTests-chrome.result }}
324+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
325+
E2E_AWS_ACCESS_KEY_ID: ${{ secrets.E2E_AWS_ACCESS_KEY_ID }}
326+
E2E_AWS_SECRET_ACCESS_KEY: ${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }}
327+
E2E_REPORTS_USER: ${{ secrets.E2E_REPORTS_USER }}
328+
E2E_REPORTS_PASSWORD: ${{ secrets.E2E_REPORTS_PASSWORD }}
329+
E2E_REPORTS_URL: ${{ secrets.E2E_REPORTS_URL }}
330+
331+
smokeTests-firefox:
332+
name: Smoke e2e tests - Firefox
333+
runs-on: ubuntu-22.04
334+
needs: smokeTests-chrome
335+
strategy:
336+
fail-fast: false
337+
matrix:
338+
batch: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ]
339+
340+
steps:
341+
- name: Checkout repository
342+
uses: actions/checkout@v4
287343

288-
- name: Execute E2E tests
289-
uses: ./.github/actions/test/e2e
344+
- name: Execute E2E tests - Firefox
345+
uses: ./.github/actions/test/smoke
290346
with:
347+
BROWSER: 'firefox'
291348
BATCH: ${{ matrix.batch }}
292-
SMOKE_ONLY: true
293349
TEST_DAPP_URL: ${{ secrets.TEST_DAPP_URL }}
294350
WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }}
295-
SERVICE_WORKER_LOGS: true
351+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
296352

297-
processReports:
298-
name: Process smoke e2e test reports
353+
processReports-firefox:
354+
name: Process smoke e2e test reports - Firefox
299355
runs-on: ubuntu-22.04
300-
needs: smokeTests
356+
needs: smokeTests-firefox
301357
if: always()
302358
steps:
303-
- name: Download all smoke tests artifacts
304-
uses: actions/download-artifact@v4
305-
with:
306-
path: .
307-
pattern: 'runner-artifacts-*'
308-
merge-multiple: true
359+
- name: Checkout repository
360+
uses: actions/checkout@v4
309361

310-
- name: Create allure properties
311-
shell: bash
312-
if: always()
313-
working-directory: ./reports/allure/results
314-
run: |
315-
echo "
316-
branch=${{ github.ref_name }}
317-
browser= 'Chrome'
318-
tags= '@Smoke'
319-
platform=Linux
320-
" > environment.properties
321-
322-
- name: Publish allure report to S3
323-
uses: andrcuns/[email protected]
324-
if: always()
325-
env:
326-
GITHUB_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}
327-
AWS_ACCESS_KEY_ID: ${{ secrets.E2E_AWS_ACCESS_KEY_ID }}
328-
AWS_SECRET_ACCESS_KEY: ${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }}
329-
with:
330-
storageType: s3
331-
resultsGlob: './reports/allure/results'
332-
bucket: lace-e2e-test-results
333-
prefix: 'smoke/linux/chrome/${{ github.run_number }}'
334-
copyLatest: true
335-
ignoreMissingResults: true
336-
updatePr: comment
337-
baseUrl: 'https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}'
338-
339-
- name: Publish artifacts (logs, reports, screenshots)
340-
uses: actions/upload-artifact@v4
341-
if: always()
342-
with:
343-
name: test-artifacts
344-
path: |
345-
./packages/e2e-tests/screenshots
346-
./packages/e2e-tests/logs
347-
./packages/e2e-tests/reports
348-
retention-days: 5
349-
350-
- run: |
351-
if [[ ${{ needs.smokeTests.result }} == "success" ]]; then
352-
exit 0
353-
else
354-
exit 1
355-
fi
362+
- name: Run reports processing - Firefox
363+
uses: ./.github/actions/test/reports
364+
with:
365+
BROWSER: 'firefox'
366+
SMOKE_TESTS_RESULT: ${{ needs.smokeTests-firefox.result }}
367+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
368+
E2E_AWS_ACCESS_KEY_ID: ${{ secrets.E2E_AWS_ACCESS_KEY_ID }}
369+
E2E_AWS_SECRET_ACCESS_KEY: ${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }}
370+
E2E_REPORTS_USER: ${{ secrets.E2E_REPORTS_USER }}
371+
E2E_REPORTS_PASSWORD: ${{ secrets.E2E_REPORTS_PASSWORD }}
372+
E2E_REPORTS_URL: ${{ secrets.E2E_REPORTS_URL }}
356373

357374
if-core-changed:
358375
name: When core changed

packages/e2e-tests/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ UI-mapped gherkin tests for the Lace browser extension
99
with [selenium-standalone](https://github.com/webdriverio/selenium-standalone/blob/main/docs/java-versions.md)
1010
- On macOS, you can install it easily with homebrew: `brew install openjdk`
1111
- gpg
12+
- Firefox Developer Edition (for running tests on Firefox)
1213

1314
## Running tests locally
1415

@@ -32,6 +33,7 @@ UI-mapped gherkin tests for the Lace browser extension
3233
- Run tests (from the `packages/e2e-tests` directory)
3334
- `yarn test:local:chrome`
3435
- `yarn test:local:edge`
36+
- `yarn test:local:firefox`
3537

3638
## Selective gherkin scenario runs by tag matching
3739

@@ -43,11 +45,15 @@ UI-mapped gherkin tests for the Lace browser extension
4345

4446
- chrome
4547
- edge
48+
- firefox
49+
- does not support network interception or console log collection, so some tests/features are disabled (using the @SkipFirefox tag)
50+
- works only with Firefox Developer Edition, as the regular version does not allow the use of extensions
51+
- does not support device emulation, so popup mode is simulated by simply resizing the window, which is not an ideal method of simulation
4652

4753
## Supported params
4854

4955
- `STANDALONE_DRIVER=true|false` default = false (optional)
50-
- true = use already running chromedriver on port 4444
56+
- true = use already running chromedriver/geckodriver on port 4444
5157
- false = use webdriver manager
5258
- `ENV=(mainnet|preprod|preview)`default = preprod (optional)
5359
- determines default network used for tests
@@ -58,6 +64,7 @@ UI-mapped gherkin tests for the Lace browser extension
5864
- url for test DApp (only for DApp Connector tests)
5965
- `SERVICE_WORKER_LOGS=true|false` default=false (optional)
6066
- enables service worker logs collection
67+
- not supported for Firefox
6168

6269
## Run single feature file with params
6370

0 commit comments

Comments
 (0)