-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca5023a
commit de3ac16
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const {test, expect} = require('@playwright/test'); | ||
const exp = require('constants'); | ||
|
||
|
||
test("More Validation test", async ({page}) => { | ||
|
||
await page.goto("https://rahulshettyacademy.com/AutomationPractice/"); | ||
|
||
expect(await page.locator("#displayed-text")).toBeVisible(); | ||
await page.locator("#displayed-text").screenshot({path: 'elementScreenshot.png'});// Taking element screenshot | ||
|
||
await page.locator("#hide-textbox").click(); | ||
await page.screenshot({path: 'screenshot.png'}); // Taking full page screenshot | ||
|
||
expect(await page.locator("#displayed-text")).toBeHidden(); | ||
|
||
page.on('dialog', dialog => dialog.accept()); | ||
await page.locator("#confirmbtn").click(); | ||
|
||
await page.locator('#mousehover').hover(); | ||
|
||
const frameObj = page.frameLocator("#courses-iframe"); | ||
const students =await frameObj.locator(".count-text").first().textContent(); | ||
console.log('Total students are: ' + students); | ||
const courses =await frameObj.locator(".count-text").nth(1).textContent(); | ||
console.log('Total courses are: ' + courses); | ||
const projects =await frameObj.locator(".count-text").nth(3).textContent(); | ||
console.log('Total projects are: ' + projects); | ||
|
||
}) | ||
|
||
test.only("Screenshot comparison", async({page}) => { | ||
|
||
await page.goto("https://www.google.com/"); | ||
expect(await page.screenshot()).toMatchSnapshot('landing.png'); | ||
|
||
}) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.