Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test_integration_playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
export BLOCKFROST_API_KEY="${{ secrets.BLOCKFROST_API_KEY_MAINNET }}"
fi

npm test
npm run test:headless

- name: Upload report
uses: actions/upload-artifact@v4
Expand Down
8 changes: 2 additions & 6 deletions tests/govtool-frontend/playwright/.env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
HOST_URL=http://localhost:3000
API_URL=http://localhost:3000/api

DOCS_URL=https://docs.gov.tools


PDF_URL=https://dev.api.pdf.gov.tools

// Faucet API key to load fund from faucet
# Faucet
FAUCET_API_KEY=

Expand All @@ -23,10 +20,9 @@ METADATA_BUCKET_URL=https://metadata-govtool.cardanoapi.io

FAUCET_ADDRESS=addr_test1vqeux7xwusdju9dvsj8h7mca9aup2k439kfmwy773xxc2hcu7zy99


PROPOSAL_FAUCET_PAYMENT_PRIVATE=**********************************************
PROPOSAL_FAUCET_STAKE_PRIVATE=**********************************************
PROPOSAL_FAUCET_DREP_PRIVATE=**********************************************

CI=true
TEST_WORKERS=6
TEST_WORKERS=6 // Number of workers to run in parallel
143 changes: 143 additions & 0 deletions tests/govtool-frontend/playwright/DEVELOPERS_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# **Developer's Guide**

This document serves as a guide for new developers participating in the project. It provides an overview of the project’s directory structure and describes the purpose of each component.

---

## **Directory Structure**

### `lib/`

Contains the utility logic, helpers, mock datas and shared services, including:

- \_mock (mock data)
- constants
- datafactory
- fixtures
- forms
- Pages
- helpers
- Services

---

## **Test Directory: `tests/`**

This directory contains all automated test cases, organized by feature area:

### Feature-Based Test Suites

1. **`1-wallet-connect/`**
Wallet connection test cases.

2. **`2-delegation/`**
Delegation functionality and visibility tests for delegated wallets.

3. **`3-drep-registration/`**
dRep registration, editing functionality, validation, and visibility test cases.

4. **`4-proposal-visibility/`**
Voting visibility tests for voting pillars.

5. **`5-proposal-functionality/`**
Voting functionality tests and validation of voting metadata.

6. **`6-miscellaneous/`**
Miscellaneous tests, such as documentation URL checks.

7. **`7-proposal-submission/`**
Proposal submission form validation, visibility, draft handling, and submission tests.

8. **`8-proposal-discussion/`**
Tests related to proposal discussions adjacent to the submission form.

9. **`9-outcomes/`**
Tests related to proposal outcome visibility and validations.

10. **`10-user-snap/`**
Usersnap-related test cases.

11. **`11-proposal-budget/`**
Tests for proposal budget functionality and associated forms.

12. **`12-proposal-budget-submission/`**
Proposal budget submission form validation, draft, visibility, and submission tests.

---

### Authentication & Setup Scripts

13. **`auth.setup.ts`**
Sets up authentication for users and adaHolder wallets.

14. **`proposal-budget.auth.setup.ts`**
Authentication setup for proposal budget wallets.

15. **`proposal-discussion.auth.setup.ts`**
Authentication setup for proposal discussion wallets.

16. **`dRep.auth.setup.ts`**
Authentication setup for dRep wallets.

17. **`dRep.setup.ts`**
Setup for temporary and static dRep wallet registration.

18. **`proposal-budget.dRep.setup.ts`**
dRep wallet registration setup for proposal budget tests.

19. **`proposal.setup.ts`**
Setup for proposal submission wallets.

20. **`wallet.bootstrap.ts`**
Initializes adaHolder and dRep wallets with test funds for spendable ADA functionality.

---

### Teardown Scripts

21. **`delegation.teardown.ts`**
Resets delegation status (abstains delegation from delegated wallets).

22. **`faucet.setup.ts`**
Funds the test faucet wallet.

23. **`faucet.teardown.ts`**
Refunds all unspendable ADA from test wallets back to the proposal faucet.

24. **`dRep.teardown.ts`**
Handles deregistration of dRep wallets registered during tests or setup.

---

Sure! Here's a refined and clearer version of your note:

---

## 🖥️ Tip for VS Code Users: Running Individual Tests

- Use the terminal to run specific test suites using the commands provided in the **README.md**.
- Ensure all test files are recognized in the **Test Explorer**.

![Test Runner Screenshot](/docs/image.png)

- Use the **Play** ▶️ icon to run individual tests directly from the UI.

---

### 🎯 Running Individual Tests Without Wallet Dependency

- Add **Playwright Test for VSCode** extension

![Playwright Test Screenshot](/docs/image-1.png)

1. **Remove** the `CI` environment variable.
2. **Navigate** to the specific directory where your test is located to run it directly.

![Directory Navigation Screenshot](/docs/image-2.png)

> **Note:**
>
> - To run tests _without wallet dependency_, make sure the required wallet/auth setup has already been completed beforehand.
> - To run tests _with wallet dependency_ and generate **Allure reports**, **do not** remove the `CI` environment variable.

---
Loading