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 Oct 31, 2024
1 parent 0bbeb68 commit 28f4677
Show file tree
Hide file tree
Showing 22 changed files with 1,102 additions and 268 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
@@ -1,6 +1,6 @@
VERSION 0.8
IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.18 AS flutter-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/playwright:v3.2.18 AS playwright-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.20 AS flutter-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/playwright:v3.2.20 AS playwright-ci

deps:
DO playwright-ci+SETUP --workdir=/wallet-automation
Expand All @@ -13,11 +13,11 @@ 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
Expand Down Expand Up @@ -48,16 +48,20 @@ package-app:
nightly-test:
FROM earthly/dind:alpine-3.20-docker-26.1.5-r0
COPY compose.yml .
RUN mkdir -p results
WITH DOCKER \
--compose compose.yml \
--load test-app:latest=(+package-app) \
--load test:latest=(+package-test) \
--service app \
--allow-privileged

RUN docker run --network=default_default --name=test test:latest && \
docker cp test:/results/cardano-wallet.junit-report.xml cardano-wallet.junit-report.xml
# Start the services
RUN docker-compose up --abort-on-container-exit test

END
WAIT
SAVE ARTIFACT cardano-wallet.junit-report.xml AS LOCAL cardano-wallet.junit-report.xml
END

# Copy the result file from /output to the current directory
COPY /output/results/cardano-wallet.junit-report.xml .

# Save the result file as an artifact
SAVE ARTIFACT cardano-wallet.junit-report.xml AS LOCAL cardano-wallet.junit-report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ 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,29 @@
version: "3"
services:
app:
image: test-app:latest
ports:
- 8000:80
- "8000:80"
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:80"]
interval: 5s
timeout: 2s
retries: 12
networks:
- test_network

test:
image: test:latest
depends_on:
app:
condition: service_healthy
# environment:
# - APP_URL=http://app:80
volumes:
- /output/results:/results
networks:
- test_network

networks:
test_network:
name: test_network
driver: bridge

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 28f4677

Please sign in to comment.