Skip to content

Commit ad36fc2

Browse files
committed
test(cat-voices): refactoring playwright tests
1 parent f9b60fa commit ad36fc2

22 files changed

+1015
-428
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.12.2

catalyst_voices/packages/libs/catalyst_cardano/catalyst_cardano/wallet-automation/Earthfile

+12-11
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ deps:
1313

1414
src:
1515
FROM +deps
16-
COPY keys.txt .
16+
COPY --dir pages ./pages
17+
COPY --dir tests ./tests
18+
COPY --dir utils ./utils
1719
COPY playwright.config.ts .
18-
COPY global-setup.ts .
19-
COPY wallet-tests.spec.ts .
20-
COPY utils.ts .
20+
COPY test-fixtures.ts .
2121

2222
package-test:
2323
FROM +src
2424
ENV APP_URL http://test-app:80
25+
ENV APP_URL http://test-app:80
2526
RUN mkdir /results
2627
VOLUME /results
2728
ENTRYPOINT ["/bin/sh", "-c", "/usr/bin/xvfb-run --auto-servernum npm test", ""]
@@ -30,12 +31,12 @@ package-test:
3031

3132
builder:
3233
DO flutter-ci+SETUP
33-
COPY ../../../../../+repo-catalyst-voices/repo .
34+
COPY ../../../../+repo-catalyst-voices-all/repo .
3435
DO flutter-ci+BOOTSTRAP
3536

3637
build-web:
3738
FROM +builder
38-
ARG WORKDIR=/frontend/packages/libs/catalyst_cardano/catalyst_cardano/example
39+
ARG WORKDIR=/frontend/catalyst_voices_packages/catalyst_cardano/catalyst_cardano/example
3940
DO flutter-ci+BUILD_WEB --TARGET=lib/main.dart --WORKDIR=$WORKDIR
4041
SAVE ARTIFACT web
4142

@@ -51,13 +52,13 @@ nightly-test:
5152
WITH DOCKER \
5253
--compose compose.yml \
5354
--load test-app:latest=(+package-app) \
54-
--load test:latest=(+package-test) \
55-
--service test-app \
56-
--allow-privileged
55+
--load test:latest=(+package-test)
5756

58-
RUN docker run --network=default_default --name=test test:latest && \
59-
docker cp test:/results/cardano-wallet.junit-report.xml cardano-wallet.junit-report.xml
57+
RUN docker run --network=default_default --name=test test:latest ; \
58+
docker cp test:/results/cardano-wallet.junit-report.xml cardano-wallet.junit-report.xml ; \
59+
docker cp test:/results/ /playwright-report
6060
END
6161
WAIT
6262
SAVE ARTIFACT cardano-wallet.junit-report.xml AS LOCAL cardano-wallet.junit-report.xml
63+
SAVE ARTIFACT ./playwright-report/* AS LOCAL ./playwright-report/
6364
END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Introduction
2+
3+
Wallet automation is a testing package in Playwright that automates the wallet creation process for the Catalyst project.
4+
It is a part of the Catalyst Voices ecosystem.
5+
6+
## Getting Started
7+
8+
1. Clone this repository:
9+
10+
```sh
11+
git clone
12+
cd catalyst-voices
13+
```
14+
15+
2. Install Flutter and Dart:
16+
17+
```sh
18+
brew install flutter
19+
```
20+
21+
3. Bootstrap the project:
22+
23+
```sh
24+
melos bootstrap
25+
```
26+
27+
4. Execute earthly command from this directory:
28+
29+
```sh
30+
earthly +package-app
31+
```
32+
33+
5. Use docker compose to run the app:
34+
35+
```sh
36+
docker compose up
37+
```
38+
The app should be running on `localhost:8000`.
39+
40+
6. You can now run tests with the following command:
41+
42+
```sh
43+
npx playwright test
44+
```

catalyst_voices/packages/libs/catalyst_cardano/catalyst_cardano/wallet-automation/compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ services:
33
test-app:
44
image: test-app:latest
55
ports:
6-
- 8000:80
6+
- "8000:80"

catalyst_voices/packages/libs/catalyst_cardano/catalyst_cardano/wallet-automation/global-setup.ts

-13
This file was deleted.

catalyst_voices/packages/libs/catalyst_cardano/catalyst_cardano/wallet-automation/keys.txt

-5
This file was deleted.

catalyst_voices/packages/libs/catalyst_cardano/catalyst_cardano/wallet-automation/package-lock.json

+42-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

catalyst_voices/packages/libs/catalyst_cardano/catalyst_cardano/wallet-automation/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@types/node": "^20.14.12"
2626
},
2727
"dependencies": {
28+
"@tomjs/unzip-crx": "^1.1.3",
2829
"@types/node-fetch": "^2.6.11",
2930
"dotenv": "^16.3.1",
3031
"fs-extra": "^11.2.0",

0 commit comments

Comments
 (0)