Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
758f4e0
feat: add helper function to check walletBalance and skip if walletBa…
kneerose Apr 29, 2025
7b83cb7
feat: add faucetWalletBalance.json to .gitignore
kneerose Apr 29, 2025
0d77e23
chore: check skipIfBalanceInsufficient for all faucet dependent test
kneerose Apr 29, 2025
54d8fb4
chore: remove generated/proposal faucet wallet and use wallet from co…
kneerose May 1, 2025
844f59a
chore: balance checks in setup and teardown before setup/teardown
kneerose May 1, 2025
a9ae9b5
chore: skip temporary wallet dependent tests if it is not available
kneerose May 1, 2025
2833b92
fix: correct calculation of total required balance for temporary DRep…
kneerose May 1, 2025
3ba4d5a
docs: update README to clarify ADA requirements for faucet address in…
kneerose May 1, 2025
8979278
chore: update env variables on integration test workflow
kneerose May 1, 2025
62b10ef
chore: update .gitignore to remove leading dot from lock_logs.txt entry
kneerose May 1, 2025
0ccbd48
fix: divide dRepDeposit and govActionDeposite to calculate the requir…
kneerose May 1, 2025
10a7a0d
chore: remove unnecessary "/" from host urls
kneerose May 1, 2025
9e2ba7f
refactor: remove unused transaction test configuration from Playwrigh…
kneerose May 2, 2025
3476fc4
chore: check balance from kuber directly
kneerose May 2, 2025
5b086b9
feat: add delete file/folder helper function
kneerose May 2, 2025
effa140
chore: check copy temporary wallets instead of used temporary wallets
kneerose May 2, 2025
7fd7e67
feat: add cleanup artifacts functionality to Playwright tests
kneerose May 2, 2025
fa2c6bf
chore: update default deployment option in Playwright integration tests
kneerose May 2, 2025
bce9288
refactor: rename proposal budget config to budget proposal
kneerose May 2, 2025
a89daed
chore: add playwright project configuration architecture on developer…
kneerose May 2, 2025
f2e6d3f
refactor: dRep registration tests to use generated valid and invalid …
kneerose May 2, 2025
3d5060d
fix: update delegation pillars image reference and replace outdated file
kneerose May 5, 2025
8f3b803
refactor: remove unused skipIfBalanceIsInsufficient import
kneerose May 5, 2025
18710f8
refactor: consolidate outcome ID and title fetching into a single method
kneerose May 5, 2025
6163f89
chore: revert default test trigger host url to govtool.cardanoapi.io
kneerose May 5, 2025
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
11 changes: 3 additions & 8 deletions .github/workflows/test_integration_playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- "sanchogov.tools"
- "staging.govtool.byron.network"
- "govtool.cardanoapi.io"
- "p80-z6b8d2f7a-ze34e4cb2-gtw.z937eb260.rustrocks.fr"
- "preview.gov.tools"
- "gov.tools"
- "p80-z78acf3c2-zded6a792-gtw.z937eb260.rustrocks.fr"
Expand Down Expand Up @@ -93,16 +94,12 @@ jobs:

# Set API keys based on the network
if [[ "${{ env.NETWORK }}" == "preprod" ]]; then
export FAUCET_API_KEY="${{ secrets.FAUCET_API_KEY_PREPROD }}"
export BLOCKFROST_API_KEY="${{ secrets.BLOCKFROST_API_KEY_PREPROD }}"
elif [[ "${{ env.NETWORK }}" == "sanchonet" ]]; then
export FAUCET_API_KEY="${{ secrets.FAUCET_API_KEY_SANCHONET }}"
export BLOCKFROST_API_KEY="${{ secrets.BLOCKFROST_API_KEY_SANCHONET }}"
elif [[ "${{ env.NETWORK }}" == "preview" ]]; then
export FAUCET_API_KEY="${{ secrets.FAUCET_API_KEY_PREVIEW }}"
export BLOCKFROST_API_KEY="${{ secrets.BLOCKFROST_API_KEY_PREVIEW }}"
else
export FAUCET_API_KEY="${{ secrets.FAUCET_API_KEY_PREVIEW }}"
export BLOCKFROST_API_KEY="${{ secrets.BLOCKFROST_API_KEY_MAINNET }}"
fi

Expand All @@ -123,17 +120,15 @@ jobs:
path: tests/govtool-frontend/playwright/lock_logs.txt

env:
API_URL: https://${{inputs.deployment || 'govtool.cardanoapi.io' }}/api
DOCS_URL: ${{ vars.DOCS_URL }}
KUBER_API_KEY: ${{secrets.KUBER_API_KEY}}
NETWORK: ${{ inputs.network || vars.NETWORK }}
TEST_WORKERS: ${{vars.TEST_WORKERS}}
CI: ${{vars.CI}}
FAUCET_ADDRESS: ${{vars.FAUCET_ADDRESS}}
CARDANOAPI_METADATA_URL: ${{vars.CARDANOAPI_METADATA_URL}}
PROPOSAL_FAUCET_PAYMENT_PRIVATE: ${{secrets.PROPOSAL_FAUCET_PAYMENT_PRIVATE}}
PROPOSAL_FAUCET_STAKE_PRIVATE: ${{secrets.PROPOSAL_FAUCET_STAKE_PRIVATE}}
PROPOSAL_FAUCET_DREP_PRIVATE: ${{secrets.PROPOSAL_FAUCET_DREP_PRIVATE}}
FAUCET_PAYMENT_PRIVATE: ${{secrets.FAUCET_PAYMENT_PRIVATE}}
FAUCET_STAKE_PKH: ${{secrets.FAUCET_STAKE_PKH}}

publish-report:
runs-on: ubuntu-latest
Expand Down
12 changes: 3 additions & 9 deletions tests/govtool-frontend/playwright/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ HOST_URL=http://localhost:3000

DOCS_URL=https://docs.gov.tools

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

#Blockfrost
BLOCKFROST_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXX

Expand All @@ -18,11 +14,9 @@ TX_TIMEOUT=240000 # milliseconds
# Metadata Bucket
METADATA_BUCKET_URL=https://metadata-govtool.cardanoapi.io

FAUCET_ADDRESS=addr_test1vqeux7xwusdju9dvsj8h7mca9aup2k439kfmwy773xxc2hcu7zy99

PROPOSAL_FAUCET_PAYMENT_PRIVATE=**********************************************
PROPOSAL_FAUCET_STAKE_PRIVATE=**********************************************
PROPOSAL_FAUCET_DREP_PRIVATE=**********************************************
FAUCET_ADDRESS=
FAUCET_PAYMENT_PRIVATE=
FAUCET_STAKE_PKH=

CI=true
TEST_WORKERS=6 // Number of workers to run in parallel
3 changes: 2 additions & 1 deletion tests/govtool-frontend/playwright/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ lib/_mock/registeredDRepCopyWallets.json
lib/_mock/wallets.json
lib/_mock/proposals.json
lib/_mock/protocolParameter.json
./lock_logs.txt
lib/_mock/faucetWalletBalance.json
lock_logs.txt
95 changes: 77 additions & 18 deletions tests/govtool-frontend/playwright/DEVELOPERS_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,31 @@ This directory contains all automated test cases, organized by feature area:

### Authentication & Setup Scripts

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

14. **`proposal-budget.auth.setup.ts`**
14. **`user.auth.setup.ts`**
Sets up authentication for user wallets.

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

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

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

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

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

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

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

---
Expand All @@ -98,18 +101,14 @@ This directory contains all automated test cases, organized by feature area:
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.
22. **`faucet.teardown.ts`**
Refunds all unspendable ADA from test wallets back to the faucet wallet.

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

---

Sure! Here's a refined and clearer version of your note:
24. **`generated-artifacts.teardown.ts`**
Remove all artifacts generated during test execution

---

Expand Down Expand Up @@ -141,3 +140,63 @@ Sure! Here's a refined and clearer version of your note:
> - To run tests _with wallet dependency_ and generate **Allure reports**, **do not** remove the `CI` environment variable.

---

## Govtool Playwright Configuration – Project Behaviors

This section outlines the core behavioral areas of the Govtool application as captured and tested using Playwright. Visual representations are provided to guide developers in understanding the UI states and interaction flows.

### 1. Delegation Pillars

This set of tests covers all key UI and interaction flows related to delegation functionality.

![Delegation Pillars](/docs/delegation-pillars.png)

---

### 2. Voting Pillars

Covers user voting mechanisms, including interface states and validation of voting logic.

![Voting Pillars](/docs/voting-pillars.png)

---

### 3. Proposal Pillars

Proposal functionality is split into two sub-categories, each with distinct test coverage:

#### i. Proposal Discussion

Tracks creation, display, and participation in proposal discussions.

![Proposal Discussion](/docs/proposal-discussion.png)

#### ii. Budget Proposal

Tracks creation, display, and participation in budget-related proposals.

![Budget Proposal](/docs/budget-proposal.png)

---

### 4. Outcomes Pillars

Tests centered around outcomes from various actions.

![Outcomes Pillars](/docs/outcomes-pillars.png)

---

### 5. Logged-In State

Covers all test cases that require the user to be authenticated, and are not included in the delegation, voting, proposal, or outcomes pillars

![Logged-In State](/docs/loggedin.png)

---

### Overall Architecture

For a comprehensive view of the project's Playwright architecture, refer to the Excalidraw diagram:

[Govtool Project Architecture](/docs/govtool-playwright-project.excalidraw)
Loading