Skip to content

Commit

Permalink
test: update transaction ID field steps to not show error messages wh…
Browse files Browse the repository at this point in the history
…en whitespace is added
  • Loading branch information
KrupaPammi committed Mar 27, 2024
1 parent 7d13c4c commit 84027f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions playwright-staging/tests/update/formValidation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test.describe('Giftaid update form validation @sanity @nightly-sanity', () => {
await page.close();
});

test.only('validate transaction ID field', async ({ page }) => {
test('validate transaction ID field', async ({ page }) => {

const commands = new Commands(page);

Expand All @@ -63,11 +63,16 @@ test.describe('Giftaid update form validation @sanity @nightly-sanity', () => {
await page.waitForSelector('div#field-error--transactionId > span');
await expect(page.locator('div#field-error--transactionId > span')).toContainText('This transaction ID doesn\'t seem to be valid, please check your donation confirmation email or letter');

// transaction ID number with special characters should shows error message
// transaction ID number with space at the end should not show error message
await page.locator('input#field-input--transactionId').fill('');
await page.locator('input#field-input--transactionId').type('a0e9840d-b724-4868-9a68-06a86e0f0150 ', {delay: 100});
await expect(page.locator('div#field-error--transactionId > span')).toBeHidden();

// transaction ID number with space at the beginning should not show error message
await page.locator('input#field-input--transactionId').fill('');
await page.locator('input#field-input--transactionId').type(' a0e9840d-b724-4868-9a68-06a86e0f0150', {delay: 100});
await expect(page.locator('div#field-error--transactionId > span')).toBeHidden();

// clear the transaction ID field and enter valid inputs and submit form
await page.locator('input#field-input--transactionId').fill('');

Expand Down

0 comments on commit 84027f6

Please sign in to comment.