Skip to content

Commit

Permalink
test: fix form validation local test
Browse files Browse the repository at this point in the history
  • Loading branch information
KrupaPammi committed May 17, 2024
1 parent 74fe36c commit 6dfab0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions playwright-local/tests/update/formValidation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ test.describe('Giftaid update form validation', () => {
// Enter a valid transaction ID and submit the form to validate successful submission
await page.fill('input#field-input--transactionId', ''); // clear the transaction field
await commands.populateUpdateFormFields(page); // populate giftaid update form
await page.locator('#giftAidClaimChoice>div:nth-child(2)>label').click(); // select giftaid declaration
await page.click('button[type=submit]'); // submit giftaid update form
await expect(page.locator('div > h1')).toHaveText('Thank you, test!');
await page.click('#giftAidClaimChoice>div:nth-child(2)>label'); // Select yes for declaration
await page.click('button[type=submit]'); // Submit the form
await expect(page.locator('div > h1')).toHaveText('Thank you, test!');
await page.close();
});

Expand Down Expand Up @@ -114,7 +114,7 @@ test.describe('Giftaid update form validation', () => {
const validEmail = '[email protected]';
await page.fill('input#field-input--email', ''); // clear email field
await commands.populateUpdateFormFields(page, { email: validEmail });
await page.click('#giftAidClaimChoice>div:nth-child(3)>label'); // Select no for declaration
await page.click('#giftAidClaimChoice>div:nth-child(3)>label'); // Select 'no' for declaration
await page.click('button[type=submit]'); // Submit the form

await expect(page.locator('div > h1')).toHaveText('Thanks for letting us know');
Expand Down

0 comments on commit 6dfab0c

Please sign in to comment.