-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
10 changed files
with
89 additions
and
5 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,14 @@ | ||
import { test } from "@playwright/test"; | ||
|
||
|
||
test.only("Test case to check device emulation with config file change", async ({page}) => { | ||
|
||
page.on('console',message=>{ | ||
|
||
console.log(`Received message >>> ${message.type()} and ${message.text()} `) | ||
|
||
}) | ||
|
||
await page.goto("https://testleaf.com"); | ||
|
||
}) |
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,9 @@ | ||
import { test } from "@playwright/test"; | ||
|
||
|
||
test.only("Test case to check device emulation with config file change", async ({page}) => { | ||
|
||
|
||
await page.goto("https://leafground.com/alert.xhtml"); | ||
|
||
}) |
13 changes: 13 additions & 0 deletions
13
tests/w7d2_PWFeatues/DeviceemulationAtTestcaseLevel.spec.ts
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,13 @@ | ||
import { chromium, devices, firefox, test } from "@playwright/test"; | ||
|
||
|
||
test.only("Test case to check device emulation with config file change", async () => { | ||
|
||
const mydevice=devices['Galaxy Note 3'] | ||
const browser= await firefox.launch(); | ||
const context=await browser.newContext({...mydevice,viewport:{width:596,height:123}}); | ||
const page=await context.newPage(); | ||
await page.goto("https://www.google.com") | ||
|
||
|
||
}) |
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,10 @@ | ||
import {test} from "@playwright/test"; | ||
|
||
|
||
test('Printing all console messages', async({page})=> { | ||
page.on('console', message=> { | ||
console.log(`Messages >> ${message.type()} and ${message.text()}`) | ||
}) | ||
await page.goto("https://www.redbus.in/"); | ||
await page.waitForTimeout(10000); | ||
}) |
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,33 @@ | ||
import { chromium, test } from "@playwright/test"; | ||
|
||
|
||
test(`Persistent Context`, async () => { | ||
|
||
|
||
const userDataDir = "./myUserDataDir"; | ||
|
||
|
||
//Launch a persistent context | ||
const context = await chromium.launchPersistentContext(userDataDir, { | ||
headless:false, | ||
httpCredentials:{ | ||
username: "admin", | ||
password: "testleaf", | ||
origin: "http://leafground.com:8090" | ||
} | ||
}); | ||
|
||
|
||
const page = await context.newPage(); | ||
await page.goto("https://leafground.com/auth.xhtml"); | ||
|
||
|
||
await page.getByRole('button', {name:'Basic Auth'}).click(); | ||
|
||
|
||
await page.waitForTimeout(5000); | ||
|
||
|
||
|
||
|
||
}) |