Skip to content

Commit 6abb2ac

Browse files
Manage script Formatting
1 parent abbeba8 commit 6abb2ac

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

tests/Iframes/Iframes.spec.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ const { test, expect } = require('@playwright/test');
33
test('Verify functionality inside the iframe', async ({ page }) => {
44

55
// Define for selectors
6-
const targetURL = 'https://qa-practice.netlify.app/iframe';
7-
const iframeSelector = '#iframe-checkboxes';
8-
const learnMoreBtn = '#learn-more';
9-
const showTextMessage = '#show-text';
10-
const expectedText = `This text appears when you click the "Learn more" button`;
6+
const targetURL = 'https://qa-practice.netlify.app/iframe';
7+
const iframeSelector = '#iframe-checkboxes';
8+
const learnMoreBtn = '#learn-more';
9+
const showTextMessage = '#show-text';
10+
const expectedText = `This text appears when you click the "Learn more" button`;
1111

12-
// Navigate to the target URL
13-
await page.goto(targetURL);
12+
// Navigate to the target URL
13+
await page.goto(targetURL);
1414

15-
// Wait for iframe and switch context
16-
const frame = page.frameLocator(iframeSelector);
15+
// Wait for iframe and switch context
16+
const frame = page.frameLocator(iframeSelector);
1717

18-
// Ensure the 'Learn More' button is visible and click it
19-
const learnMoreButton = frame.locator(learnMoreBtn);
20-
await learnMoreButton.waitFor({ state: 'visible' });
21-
await learnMoreButton.click();
18+
// Ensure the 'Learn More' button is visible and click it
19+
const learnMoreButton = frame.locator(learnMoreBtn);
20+
await learnMoreButton.waitFor({ state: 'visible' });
21+
await learnMoreButton.click();
2222

23-
// Verify the success message
24-
const successMessage = frame.locator(showTextMessage);
25-
await expect(successMessage).toBeVisible();
26-
await expect(successMessage).toHaveText(expectedText);
23+
// Verify the success message
24+
const successMessage = frame.locator(showTextMessage);
25+
await expect(successMessage).toBeVisible();
26+
await expect(successMessage).toHaveText(expectedText);
2727

2828
});

0 commit comments

Comments
 (0)