Skip to content

Commit

Permalink
test(cat-voices): refactoring playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
emiride committed Nov 5, 2024
1 parent 599d10a commit 8a57fa6
Show file tree
Hide file tree
Showing 24 changed files with 932 additions and 499 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,5 @@ test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
extensions/
extensions/
catalyst_voices_packages/catalyst_cardano/catalyst_cardano/wallet-automation/.env

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ deps:

src:
FROM +deps
COPY keys.txt .
COPY --dir pages ./pages
COPY --dir tests ./tests
COPY --dir utils ./utils
COPY playwright.config.ts .
COPY global-setup.ts .
COPY wallet-tests.spec.ts .
COPY utils.ts .
COPY test-fixtures.ts .

package-test:
FROM +src
ENV APP_URL http://app:80
ENV APP_URL http://test-app:80
RUN mkdir /results
VOLUME /results
ENTRYPOINT ["/bin/sh", "-c", "/usr/bin/xvfb-run --auto-servernum npm test", ""]
Expand Down Expand Up @@ -51,13 +51,13 @@ nightly-test:
WITH DOCKER \
--compose compose.yml \
--load test-app:latest=(+package-app) \
--load test:latest=(+package-test) \
--service app \
--allow-privileged
--load test:latest=(+package-test)

RUN docker run --network=default_default --name=test test:latest && \
docker cp test:/results/cardano-wallet.junit-report.xml cardano-wallet.junit-report.xml
RUN docker run --network=default_default --name=test test:latest ; \
docker cp test:/results/cardano-wallet.junit-report.xml cardano-wallet.junit-report.xml ; \
docker cp test:/results/ /playwright-report
END
WAIT
SAVE ARTIFACT cardano-wallet.junit-report.xml AS LOCAL cardano-wallet.junit-report.xml
SAVE ARTIFACT ./playwright-report/* AS LOCAL ./playwright-report/
END
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Introduction

Wallet automation is a testing package in Playwright that automates the wallet creation process for the Catalyst project. It is a part of the Catalyst Voices ecosystem.
Wallet automation is a testing package in Playwright that automates the wallet creation process for the Catalyst project.
It is a part of the Catalyst Voices ecosystem.

## Getting Started

Expand Down Expand Up @@ -32,8 +33,12 @@ earthly +package-app
5. Use docker compose to run the app:

```sh
docker-compose up
docker compose up
```
The app should be running on `localhost:8000`.

6. You can now
6. You can now run tests with the following command:

```sh
npx playwright test
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "3"
services:
app:
test-app:
image: test-app:latest
ports:
- 8000:80
- "8000:80"

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@
},
"homepage": "https://github.com/input-output-hk/catalyst-voices#readme",
"devDependencies": {
"@playwright/test": "^1.45.3",
"@playwright/test": "^1.48.0",
"@types/node": "^20.14.12"
},
"dependencies": {
"@tomjs/unzip-crx": "^1.1.3",
"@types/node-fetch": "^2.6.11",
"dotenv": "^16.3.1",
"fs-extra": "^11.2.0",
"install": "^0.13.0",
"node-fetch": "^2.6.7",
"playwright": "^1.45.3",
"playwright": "^1.48.0",
"unzip-crx-3": "^0.2.0"
}
}
Loading

0 comments on commit 8a57fa6

Please sign in to comment.