From 9506ebfb59f889298e53e01d88bc493513b05953 Mon Sep 17 00:00:00 2001 From: Krupa Pammi Date: Mon, 24 Jun 2024 16:36:26 +0100 Subject: [PATCH] test: update mobile numbers --- playwright-local/tests/update/formValidation.spec.js | 4 ++-- playwright-local/tests/utils/commands.js | 2 +- playwright-staging/tests/utils/commands.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/playwright-local/tests/update/formValidation.spec.js b/playwright-local/tests/update/formValidation.spec.js index 14fae25f..cc0219ef 100644 --- a/playwright-local/tests/update/formValidation.spec.js +++ b/playwright-local/tests/update/formValidation.spec.js @@ -197,14 +197,14 @@ test.describe('Giftaid update form validation', () => { for (let testCase of mobileTestCases) { await page.locator('#field-input--mobile').fill(''); // Clear the field before each test - await page.locator('#field-input--mobile').type(mobile); + await page.locator('#field-input--mobile').type(testCase.input, { delay: 100 }); await expect(page.locator('div#field-error--mobile > span')).toHaveText(testCase.error); } // Validate correct mobile number await page.locator('#field-input--mobile').fill(''); // Ensure the field is cleared before filling with valid data - await commands.populateUpdateFormFields(page); + await commands.populateUpdateFormFields(page, { mobile: mobile }); // Select yes for giftaid declaration to complete the form await page.locator('#giftAidClaimChoice>div:nth-child(2)>label').click(); diff --git a/playwright-local/tests/utils/commands.js b/playwright-local/tests/utils/commands.js index 516111e3..bd570c92 100644 --- a/playwright-local/tests/utils/commands.js +++ b/playwright-local/tests/utils/commands.js @@ -62,7 +62,7 @@ class Commands { address2 = chance.street(), address3 = 'test address 3', town = chance.city(), - mobile = chance.phone({ country: 'uk', mobile: true }).replace(/\s/g, ''), // Remove spaces from the phone number + mobile = '07516144519' } = {}) { await page.locator('input#field-input--firstname').fill(firstName); await page.locator('input#field-input--lastname').fill(lastName); diff --git a/playwright-staging/tests/utils/commands.js b/playwright-staging/tests/utils/commands.js index 08ef6bf7..49fd8043 100644 --- a/playwright-staging/tests/utils/commands.js +++ b/playwright-staging/tests/utils/commands.js @@ -57,7 +57,7 @@ class Commands { firstName = 'test', lastName = chance.last(), email = `giftaid-update-staging-${chance.email()}`, - mobile = '07123456789', + mobile = '07516144519', postcode = chance.postcode(), address1 = chance.address(), address2 = chance.street(),