Skip to content

Commit

Permalink
test: fix the thank you message step
Browse files Browse the repository at this point in the history
  • Loading branch information
KrupaPammi committed May 17, 2024
1 parent ed6c47a commit cf3c7d4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
4 changes: 3 additions & 1 deletion playwright-local/tests/submit/formValidation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ test.describe('Address validation', () => {
await page.locator('#field-input--lastname').fill('');
await commands.populateFormFields(page);
await page.locator('button[type=submit]').click();
await expect(page.locator('div > h1')).toHaveText('Thank you, test!');
await expect(page.locator('div > h1')).toContainText('Thank you,\n' +
'test!');
await page.close();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ test.describe('International addresses validation', () => {
// Submit the form and ensure no errors are shown for international address
await commands.selectMarketingPrefs(page); // Assuming this handles checkbox interactions
await page.click('button[type=submit]');
await expect(page.locator('div > h1')).toContainText('Thank you, test!');
await expect(page.locator('div > h1')).toContainText('Thank you,\n' +
'test!');
await page.close();

await page.close();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ test.describe('Marketing preferences validation', () => {
// Re-enter valid phone number and submit
await page.fill('input#field-input--phone', phone);
await page.click('button[type=submit]');
await expect(page.locator('div > h1')).toHaveText('Thank you, test!');
await expect(page.locator('div > h1')).toContainText('Thank you,\n' +
'test!');
await page.close();
});
});
5 changes: 3 additions & 2 deletions playwright-local/tests/submit/validFormSubmission.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ test('Valid giftaid submission', async ({ page }) => {
]);

// Check for the thank you message to confirm successful submission
await expect(page.locator('div > h1')).toHaveText('Thank you, test!');

await expect(page.locator('div > h1')).toContainText('Thank you,\n' +
'test!');

await page.close();
});
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ test.describe('International addresses validation on update form', () => {
await page.locator('button[type=submit]').click();

// Thank you message on success page
await expect(page.locator('div > h1')).toContainText('Thank you, test!');

await expect(page.locator('div > h1')).toContainText('Thank you,\n' +
'test!');
await page.close();
});
});
5 changes: 3 additions & 2 deletions playwright-local/tests/update/validFormSubmission.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ test('Valid Giftaid Update submission', async ({ page }) => {

// Submit the form and validate the thank you message
await page.locator('button[type=submit]').click();
await expect(page.locator('div > h1')).toContainText('Thank you, test!');

await expect(page.locator('div > h1')).toContainText('Thank you,\n' +
'test!');

await page.close();
});

0 comments on commit cf3c7d4

Please sign in to comment.