Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Test IDs and Validate Add Withdrawal Address Button Visibility in Proposal Form #2488

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const formErrors = {
abstract: "abstract-helper-error",
motivation: "motivation-helper-error",
rationale: "rationale-helper-error",
receivingAddress: "receiving-address-text-error",
amount: "amount-text-error",
receivingAddress: "receiving-address-0-text-error",
amount: "amount-0-text-error",
link: "link-0-url-input-error",
};

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

readonly continueBtn = this.page.getByTestId("continue-button");
readonly addLinkBtn = this.page.getByTestId("add-link-button");
readonly addWithdrawalAddressBtn = this.page.getByTestId(
"add-withdrawal-link-button"
);
readonly infoBtn = this.page.getByTestId("info-button");
readonly treasuryBtn = this.page.getByTestId("treasury-button");
readonly editSubmissionButton = this.page.getByTestId(
Expand All @@ -61,9 +64,9 @@ export default class ProposalSubmissionPage {
readonly motivationInput = this.page.getByTestId("motivation-input");
readonly rationaleInput = this.page.getByTestId("rationale-input");
readonly receivingAddressInput = this.page.getByTestId(
"receiving-address-input"
"receiving-address-0-text-input"
);
readonly amountInput = this.page.getByTestId("amount-input");
readonly amountInput = this.page.getByTestId("amount-0-text-input");
readonly closeDraftSuccessModalBtn = this.page.getByTestId("close-button");

constructor(private readonly page: Page) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ test.describe("Proposal created logged state", () => {
await proposalSubmissionPage.validateForm(formFields);
}

if (type === ProposalType.treasury) {
for (let i = 0; i < 9; i++) {
await expect(
proposalSubmissionPage.addWithdrawalAddressBtn
).toBeVisible();
await proposalSubmissionPage.addWithdrawalAddressBtn.click();
}
}

await expect(
proposalSubmissionPage.addWithdrawalAddressBtn
).toBeHidden();

for (let i = 0; i < 6; i++) {
await expect(proposalSubmissionPage.addLinkBtn).toBeVisible();
await proposalSubmissionPage.addLinkBtn.click();
Expand Down
Loading