Skip to content

Commit

Permalink
test: update mobile numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
KrupaPammi committed Jun 24, 2024
1 parent 828a3fb commit 9506ebf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions playwright-local/tests/update/formValidation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion playwright-local/tests/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion playwright-staging/tests/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 9506ebf

Please sign in to comment.