Skip to content

Commit

Permalink
test(cat-voices): refactoring playwright tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emiride committed Dec 4, 2024
1 parent 34de044 commit 13968b4
Show file tree
Hide file tree
Showing 22 changed files with 1,015 additions and 428 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.12.2
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ 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://test-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 All @@ -30,12 +31,12 @@ package-test:

builder:
DO flutter-ci+SETUP
COPY ../../../../../+repo-catalyst-voices/repo .
COPY ../../../../+repo-catalyst-voices-all/repo .
DO flutter-ci+BOOTSTRAP

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

Expand All @@ -51,13 +52,13 @@ nightly-test:
WITH DOCKER \
--compose compose.yml \
--load test-app:latest=(+package-app) \
--load test:latest=(+package-test) \
--service test-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
@@ -0,0 +1,44 @@
## 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.

## Getting Started

1. Clone this repository:

```sh
git clone
cd catalyst-voices
```

2. Install Flutter and Dart:

```sh
brew install flutter
```

3. Bootstrap the project:

```sh
melos bootstrap
```

4. Execute earthly command from this directory:

```sh
earthly +package-app
```

5. Use docker compose to run the app:

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

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

```sh
npx playwright test
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ services:
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 @@ -25,6 +25,7 @@
"@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",
Expand Down
Loading

0 comments on commit 13968b4

Please sign in to comment.