Skip to content

Commit

Permalink
test: update tests removing radio buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
KrupaPammi committed Jun 25, 2024
1 parent 6397f19 commit 139c872
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion playwright-staging/tests/submit/successRedirect.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const { test } = require('../../browserstack');

test('Accessing success page should redirect to giftaid homepage @sanity @nightly-sanity', async ({ page }) => {
// Navigate directly to the success page and expect a redirect
await page.goto(`${process.env.BASE_URL}success`, { waitUntil: 'networkidle' });
await page.goto(`${process.env.BASE_URL}success`, { timeout: 30000 });
await page.waitForLoadState('domcontentloaded');

// Check if the expected header title is present, which indicates a successful redirect
const headerTitle = page.locator('h1.giftaid-title');
Expand Down
3 changes: 2 additions & 1 deletion playwright-staging/tests/submit/validFormSubmission.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ test('Valid giftaid submission @sanity @nightly-sanity', async ({ page }) => {
const commands = new Commands(page);

// Navigate to the giftaid page
await page.goto(`${process.env.BASE_URL}`, { waitUntil: 'networkidle' });
await page.goto(process.env.BASE_URL, { timeout: 30000 });
await page.waitForLoadState('domcontentloaded');

// Click the Giftaid checkbox
await page.click('#field-label--giftaid');
Expand Down
3 changes: 0 additions & 3 deletions playwright-staging/tests/update/formValidation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ test.describe('Giftaid Update form validation @sanity @nightly-sanity', () => {

// Test for a valid first name
await page.fill('#field-input--firstname', ''); // clear firstname field
await page.locator('.form__radio input[type="radio"][value="online"]').click();
await commands.populateUpdateFormFields(page, { firstName: 'John' });
await page.click('#giftAidClaimChoice>div:nth-child(2)>label'); // Select yes for declaration
await page.click('button[type=submit]'); // Submit the form
Expand Down Expand Up @@ -86,7 +85,6 @@ test.describe('Giftaid Update form validation @sanity @nightly-sanity', () => {
// Test for a valid email
const validEmail = '[email protected]';
await page.fill('input#field-input--email', ''); // clear email field
await page.locator('.form__radio input[type="radio"][value="sms"]').click();
await commands.populateUpdateFormFields(page, { email: validEmail });
await page.click('#giftAidClaimChoice>div:nth-child(3)>label'); // Select no for declaration
await page.click('button[type=submit]'); // Submit the form
Expand Down Expand Up @@ -121,7 +119,6 @@ test.describe('Giftaid Update form validation @sanity @nightly-sanity', () => {

// Validate correct mobile number
await page.locator('#field-input--mobile').fill(''); // Ensure the field is cleared and filled with valid data
await page.locator('.form__radio input[type="radio"][value="call centre"]').click();
await commands.populateUpdateFormFields(page, { mobile: mobile });
await page.click('#giftAidClaimChoice>div:nth-child(2)>label'); // Select yes for declaration
await page.click('button[type=submit]'); // Submit the form
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ test.describe('International addresses validation on update form @sanity @nightl

await page.goto(process.env.BASE_URL + 'update', { timeout: 30000 });
await page.waitForLoadState('domcontentloaded');
await page.locator('.form__radio input[type="radio"][value="call centre"]').click();

// fill in all input fields
// await page.locator('input#field-input--transactionId').fill(transactionId);
Expand Down

0 comments on commit 139c872

Please sign in to comment.