Skip to content

Commit 60a7bb1

Browse files
authored
Merge pull request #2488 from IntersectMBO/bugfix/proposal-test
Update Test IDs and Validate Add Withdrawal Address Button Visibility in Proposal Form
2 parents e6e91d4 + 6b5c09c commit 60a7bb1

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

tests/govtool-frontend/playwright/lib/pages/proposalSubmissionPage.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const formErrors = {
1616
abstract: "abstract-helper-error",
1717
motivation: "motivation-helper-error",
1818
rationale: "rationale-helper-error",
19-
receivingAddress: "receiving-address-text-error",
20-
amount: "amount-text-error",
19+
receivingAddress: "receiving-address-0-text-error",
20+
amount: "amount-0-text-error",
2121
link: "link-0-url-input-error",
2222
};
2323

@@ -39,6 +39,9 @@ export default class ProposalSubmissionPage {
3939

4040
readonly continueBtn = this.page.getByTestId("continue-button");
4141
readonly addLinkBtn = this.page.getByTestId("add-link-button");
42+
readonly addWithdrawalAddressBtn = this.page.getByTestId(
43+
"add-withdrawal-link-button"
44+
);
4245
readonly infoBtn = this.page.getByTestId("info-button");
4346
readonly treasuryBtn = this.page.getByTestId("treasury-button");
4447
readonly editSubmissionButton = this.page.getByTestId(
@@ -61,9 +64,9 @@ export default class ProposalSubmissionPage {
6164
readonly motivationInput = this.page.getByTestId("motivation-input");
6265
readonly rationaleInput = this.page.getByTestId("rationale-input");
6366
readonly receivingAddressInput = this.page.getByTestId(
64-
"receiving-address-input"
67+
"receiving-address-0-text-input"
6568
);
66-
readonly amountInput = this.page.getByTestId("amount-input");
69+
readonly amountInput = this.page.getByTestId("amount-0-text-input");
6770
readonly closeDraftSuccessModalBtn = this.page.getByTestId("close-button");
6871

6972
constructor(private readonly page: Page) {}

tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.loggedin.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ test.describe("Proposal created logged state", () => {
6565
await proposalSubmissionPage.validateForm(formFields);
6666
}
6767

68+
if (type === ProposalType.treasury) {
69+
for (let i = 0; i < 9; i++) {
70+
await expect(
71+
proposalSubmissionPage.addWithdrawalAddressBtn
72+
).toBeVisible();
73+
await proposalSubmissionPage.addWithdrawalAddressBtn.click();
74+
}
75+
}
76+
77+
await expect(
78+
proposalSubmissionPage.addWithdrawalAddressBtn
79+
).toBeHidden();
80+
6881
for (let i = 0; i < 6; i++) {
6982
await expect(proposalSubmissionPage.addLinkBtn).toBeVisible();
7083
await proposalSubmissionPage.addLinkBtn.click();

0 commit comments

Comments
 (0)