Skip to content

Commit ad8eb42

Browse files
Added Loader.spe.js Script
1 parent 6a9f2a6 commit ad8eb42

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/Loader/Loader.spec.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const { test, expect } = require('@playwright/test');
2+
3+
test('Verify Loader', async ({ page }) => {
4+
// Define target URL
5+
const targetURL = 'https://qa-practice.netlify.app/loader';
6+
7+
// Navigate to the target URL
8+
await page.goto(targetURL);
9+
10+
// Wait for the page to fully load
11+
await page.waitForLoadState('load');
12+
13+
// Validate the presence of specific text on the newly loaded page
14+
const expectedText = 'Some text in my newly loaded page..';
15+
const textLocator = page.locator(`text=${expectedText}`);
16+
17+
// Wait for the text to appear
18+
await textLocator.waitFor({ state: 'visible' });
19+
20+
// Assert that the text is present on the page
21+
await expect(textLocator).toBeVisible();
22+
});

0 commit comments

Comments
 (0)