File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments