Skip to content

Commit

Permalink
Fix EmbeddedData and other tests (#483)
Browse files Browse the repository at this point in the history
Co-authored-by: Vishal <[email protected]>
  • Loading branch information
vishalshrm539 and Vishal authored Jun 12, 2024
1 parent 8f39d7c commit c09749f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
15 changes: 10 additions & 5 deletions tests/e2e/Digv2/ComplexFields/EmbeddedData.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ test.describe('E2E test', () => {
await phone.locator('button').click();
/** Selecting the country code */
await page.locator('text=United States+1 >> nth=0').click();
await phone.locator('input').fill('6175551212');
await phone.locator('input').click();
await phone.locator('input').pressSequentially('6175551212');

/** Creating second row by clicking on `+Add` button */
await page.locator('a:has-text("+ Add")').click();
Expand All @@ -142,7 +143,8 @@ test.describe('E2E test', () => {
await phone.locator('button').click();
/** Selecting the country code */
await page.locator('text=United States+1 >> nth=0').click();
await phone.locator('input').fill('6175451212');
await phone.locator('input').click();
await phone.locator('input').pressSequentially('6175451212');

await page.locator('button:has-text("Next")').click();

Expand Down Expand Up @@ -239,7 +241,8 @@ test.describe('E2E test', () => {
await phone.locator('button').click();
/** Selecting the country code */
await page.locator('text=United States+1 >> nth=0').click();
await phone.locator('input').fill('6175551212');
await phone.locator('input').click();
await phone.locator('input').pressSequentially('6175551212');

const country = modal.locator('div[data-test-id="59716c97497eb9694541f7c3d37b1a4d"]');
await country.click();
Expand Down Expand Up @@ -332,7 +335,8 @@ test.describe('E2E test', () => {
await phone.locator('button').click();
/** Selecting the country code */
await page.locator('text=United States+1 >> nth=0').click();
await phone.locator('input').fill('6175551212');
await phone.locator('input').click();
await phone.locator('input').pressSequentially('6175551212');

let countryName = page.locator('div[data-test-id="59716c97497eb9694541f7c3d37b1a4d"]');
await countryName.click();
Expand All @@ -351,7 +355,8 @@ test.describe('E2E test', () => {
await phone.locator('button').click();
/** Selecting the country code */
await page.locator('text=United States+1 >> nth=0').click();
await phone.locator('input').fill('6175451212');
await phone.locator('input').click();
await phone.locator('input').pressSequentially('6175451212');

countryName = page.locator('div[data-test-id="59716c97497eb9694541f7c3d37b1a4d"] >> nth=1');
await countryName.click();
Expand Down
7 changes: 4 additions & 3 deletions tests/e2e/Digv2/FormFields/Phone.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ test.describe('E2E test', () => {
await page.locator('text=United States+1 >> nth=0').click();
const editablePhoneInput = editablePhone.locator('input');
await editablePhoneInput.click();
await editablePhoneInput.fill('6175551212');
await editablePhoneInput.pressSequentially('6175551212');

/** Validation tests */
const validationMsg = 'Invalid Phone';
Expand All @@ -93,7 +93,7 @@ test.describe('E2E test', () => {
await page.locator('text=United States+1 >> nth=0').click();
await editablePhoneInput.click();
/** Entering an invalid Phone number */
await editablePhoneInput.fill('61');
await editablePhoneInput.pressSequentially('61');
await editablePhoneInput.blur();
/** Expecting an error for Invalid phone number */
await expect(page.locator(`p:has-text("${validationMsg}")`)).toBeVisible();
Expand All @@ -102,7 +102,8 @@ test.describe('E2E test', () => {
await editablePhoneInput.clear();
await countrySelector.click();
await page.locator('text=United States+1 >> nth=0').click();
await editablePhoneInput.fill('6175551212');
await editablePhoneInput.click();
await editablePhoneInput.pressSequentially('6175551212');

await editablePhoneInput.blur();
/** Expecting the invalid Phone number error be no longer present */
Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/Digv2/ViewTemplates/Confirmation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ test.describe('E2E test', () => {
await countrySelector.click();
await page.locator('text=United States+1 >> nth=0').click();
const phoneInput = phone.locator('input');
await phoneInput.fill('6175551212');
await phoneInput.click();
await phoneInput.pressSequentially('6175551212');

await page.locator('button:has-text("submit")').click();

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/MediaCo/embedded.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ test.describe('E2E test', () => {
await page.locator('text=United States+1 >> nth=0').click();
const phoneInput = phone.locator('input');
await phoneInput.click();
await phoneInput.fill('6175551212');
await phoneInput.pressSequentially('6175551212');

await page.locator('button:has-text("next")').click();

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/MediaCo/portal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test.describe('E2E test', () => {
await page.locator('text=United States+1 >> nth=0').click();
const phoneInput = phone.locator('input');
await phoneInput.click();
await phoneInput.fill('6175551212');
await phoneInput.pressSequentially('6175551212');

await page.locator('button:has-text("submit")').click();

Expand Down

0 comments on commit c09749f

Please sign in to comment.