Skip to content

Commit 54f1891

Browse files
author
manasa
committed
fixed the playwrights
1 parent b1fc5c4 commit 54f1891

File tree

4 files changed

+52
-45
lines changed

4 files changed

+52
-45
lines changed

packages/react-sdk-components/src/components/field/RadioButtons/RadioButtons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default function RadioButtons(props: RadioButtonsProps) {
108108
return (
109109
<div>
110110
<h4 style={{ marginTop: 0, marginBottom: 0 }}>{label}</h4>
111-
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(min(200px, 100%), 1fr))', gap: '1rem' }}>
111+
<div id='selectable-card' style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(min(200px, 100%), 1fr))', gap: '1rem' }}>
112112
<SelectableCard
113113
hideFieldLabels={hideFieldLabels}
114114
additionalProps={additionalProps}

packages/react-sdk-components/tests/e2e/Digv2/FormFields/Location.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test.describe('E2E test for Location component', () => {
4040
/** Required field test */
4141
const requiredLocationField = page.locator('input[data-test-id="5d234240d150ee2ad896ca0be0e01fd3"]');
4242
await requiredLocationField.type('Hitech City, Hyderabad');
43-
await page.waitForSelector('.pac-container .pac-item', { timeout: 5000 });
43+
await page.waitForSelector('.pac-container .pac-item', { timeout: 50000 });
4444
await page.locator('.pac-container .pac-item').nth(1).click();
4545

4646
await expect(requiredLocationField).not.toHaveValue('');

packages/react-sdk-components/tests/e2e/MediaCo/embedded.spec.js

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,87 @@
1-
const { test } = require('@playwright/test');
1+
const { test, expect } = require('@playwright/test');
22

33
const common = require('../../common');
44

55
test.beforeEach(common.launchEmbedded);
66

77
test.describe('E2E test', () => {
8-
test('Embedded: should launch, select a service plan and fill details', async ({ page }) => {
9-
const silverPlan = page.locator('button:has-text("shop now") >> nth=1');
10-
await silverPlan.click();
8+
test('Embedded: should launch, select a phone and purchase the phone', async ({ page }) => {
9+
const selectPhone = page.locator('button:has-text("Buy now") >> nth=1');
10+
await selectPhone.click();
11+
12+
const storageSelectableCard = await page.locator('div[id="selectable-card"] >> nth=1');
13+
await storageSelectableCard.locator('label >> span >> input >> nth=1').click();
14+
15+
const colorSelectableCard = await page.locator('div[id="selectable-card"] >> nth=2');
16+
await colorSelectableCard.locator('label >> span >> input >> nth=1').click();
17+
18+
await page.locator('button:has-text("next")').click();
19+
20+
const phonenumber = page.locator('div[role="radiogroup"] >> nth=0');
21+
const requiredInput = phonenumber.locator('label >> span >> input >> nth=1');
22+
await requiredInput.click();
23+
24+
const tradeIn = page.locator('div[role="radiogroup"] >> nth=1');
25+
const tradeInInput = tradeIn.locator('label >> span >> input >> nth=1');
26+
await tradeInInput.click();
27+
28+
const paymentOptionsSelectableCard = await page.locator('div[id="selectable-card"] >> nth=0');
29+
await paymentOptionsSelectableCard.locator('label >> span >> input >> nth=1').click();
30+
31+
await page.locator('button:has-text("next")').click();
1132

1233
const firstNameInput = page.locator('input[data-test-id="BC910F8BDF70F29374F496F05BE0330C"]');
1334
await firstNameInput.click();
1435
await firstNameInput.fill('John');
1536

16-
const middleNameInput = page.locator('input[data-test-id="D3691D297D95C48EF1A2B7D6523EF3F0"]');
17-
await middleNameInput.click();
18-
await middleNameInput.fill('');
19-
2037
const lastNameInput = page.locator('input[data-test-id="77587239BF4C54EA493C7033E1DBF636"]');
2138
await lastNameInput.click();
2239
await lastNameInput.fill('Doe');
2340

24-
const suffix = page.locator('div[data-test-id="56E6DDD1CB6CEC596B433440DFB21C17"]');
25-
await suffix.locator('button[title="Open"]').click();
26-
await page.locator('li:has-text("Jr")').click();
27-
28-
const emailInput = page.locator('input[data-test-id="CE8AE9DA5B7CD6C3DF2929543A9AF92D"]');
41+
const emailInput = page.locator('input[data-test-id="643a860f992333b8600ea264aca7c4fc"]');
2942
await emailInput.click();
3043
await emailInput.fill('[email protected]');
3144

45+
const phone = page.locator('div[data-test-id="1e4dbc7eaa78468a3bc1448a3d68d906"]');
46+
const countrySelector = phone.locator('button');
47+
await countrySelector.click();
48+
await page.locator('text=United States+1 >> nth=0').click();
49+
await common.enterPhoneNumber(phone, '6175551212');
50+
51+
await page.locator('button:has-text("next")').click();
52+
53+
const nameOnCard = page.locator('input[data-test-id="c2b63e85bd5e4dc9b6cf5a4693847e06"]');
54+
await nameOnCard.click();
55+
await nameOnCard.fill('John Doe');
56+
3257
await page.locator('button:has-text("next")').click();
3358

3459
const streetInput = page.locator('input[data-test-id="D61EBDD8A0C0CD57C22455E9F0918C65"]');
3560
await streetInput.click();
3661
await streetInput.fill('Main St');
3762

38-
await page.locator('button:has-text("previous")').click();
39-
40-
await page.locator('h6:has-text("Customer Info")').click();
41-
42-
await page.locator('button:has-text("next")').click();
43-
44-
await page.locator('h6:has-text("Customer Address")').click();
63+
const apartmentInput = page.locator('input[data-test-id="73786cb2bc433cfb06603ab61f15e04e"]');
64+
await apartmentInput.click();
65+
await apartmentInput.fill('Glenalmond Avenue');
4566

4667
const cityInput = page.locator('input[data-test-id="57D056ED0984166336B7879C2AF3657F"]');
4768
await cityInput.click();
4869
await cityInput.fill('Cambridge');
4970

50-
const state = page.locator('div[data-test-id="46A2A41CC6E552044816A2D04634545D"]');
51-
const stateSelector = state.locator('div[role="combobox"]');
52-
await stateSelector.click();
53-
await page.locator('li[data-value="MA"]').click();
71+
const stateInput = page.locator('input[data-test-id="46A2A41CC6E552044816A2D04634545D"]');
72+
await stateInput.click();
73+
await stateInput.fill('Indiana');
5474

5575
const postalCodeInput = page.locator('input[data-test-id="572ED696F21038E6CC6C86BB272A3222"]');
5676
await postalCodeInput.click();
5777
await postalCodeInput.fill('02142');
5878

59-
const phone = page.locator('div[data-test-id="1F8261D17452A959E013666C5DF45E07"]');
60-
const countrySelector = phone.locator('button');
61-
await countrySelector.click();
62-
await page.locator('text=United States+1 >> nth=0').click();
63-
await common.enterPhoneNumber(phone, '6175551212');
64-
65-
await page.locator('button:has-text("next")').click();
66-
67-
const dataServiceBeginDate = page.locator('div[data-test-id="1321FA74451B96BC02663B0EF96CCBB9"]');
68-
const dataServiceBeginDateInput = dataServiceBeginDate.locator('input');
69-
await dataServiceBeginDateInput.click();
70-
const futureDate = common.getFutureDate();
71-
await dataServiceBeginDateInput.pressSequentially(futureDate);
72-
73-
await page.locator('button:has-text("next")').click();
74-
7579
await page.locator('button:has-text("submit")').click();
7680

77-
await page.locator('text=Thanks for selecting a package with us. ').click();
81+
await expect(page.locator('p:has-text("Oceonix 25 Max")')).toBeVisible();
82+
await expect(page.locator('p:has-text("[email protected]")')).toBeVisible();
83+
84+
await page.locator('a:has-text("Done")').click();
7885
}, 10000);
7986
});
8087

packages/react-sdk-components/tests/e2e/MediaCo/portal.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ test.describe('E2E test', () => {
5656
firstNameInput = caseSummary.locator('input').first();
5757
await expect(firstNameInput).toHaveValue('John');
5858

59-
lastNameInput = caseSummary.locator('input').nth(2);
59+
lastNameInput = caseSummary.locator('input').nth(1);
6060
await expect(lastNameInput).toHaveValue('Doe');
6161

62-
emailInput = caseSummary.locator('input').nth(3);
62+
emailInput = caseSummary.locator('input').nth(2);
6363
await expect(emailInput).toHaveValue('[email protected]');
6464

6565
const streetInput = page.locator('input[data-test-id="D61EBDD8A0C0CD57C22455E9F0918C65"]');

0 commit comments

Comments
 (0)