Skip to content

Commit f4c0b27

Browse files
committed
added few tests
1 parent 2fa72e1 commit f4c0b27

6 files changed

Lines changed: 29 additions & 4 deletions

File tree

Notes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,4 +268,7 @@ https://github.com/gauravkhuraana/PlaywrightTypeScriptWithAgenticAI
268268
https://idavidov.eu/my-first-live-session-developing-playwright-framework-for-rest-api-testin
269269

270270
Try this prompt
271-
https://gauravkhurana.in/docs/AI/prompt-library/#playwright-typescript-framework-creation
271+
https://gauravkhurana.in/docs/AI/prompt-library/#playwright-typescript-framework-creation
272+
273+
A must follow:
274+
https://github.com/seontechnologies/playwright-utils

tests/web/example/UIBasics.spec.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { test } from "@playwright/test";
2+
3+
//In general terminology, fixture are global variable which are available across your project.
4+
5+
//What is context
6+
//
7+
test('Browser Context Playwright Test', async ({ browser, page }) => {
8+
// write test step here
9+
10+
//Opens a new & fresh instance of browser
11+
const context = await browser.newContext()
12+
const pageLocal = await context.newPage();
13+
await pageLocal.goto("https://sso.teachable.com/secure/9521/identity/login/otp")
14+
await pageLocal.close()
15+
})
16+
17+
test('Page Playwrigth Test', async function ({ page }) {
18+
//write test step here using page fixtures
19+
await page.goto("https://google.co.in")
20+
await page.close()
21+
})
File renamed without changes.

tests/web/example/launchBrowserUsingConfig.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Import all browser types from the Playwright library
22
import { chromium, firefox, webkit, test } from "@playwright/test";
33

4-
const browserType = 'msedge'; // <-- CHANGE THIS VALUE
4+
let browserType = 'msedge'; // <-- CHANGE THIS VALUE
55

66
test("Launch browser using config", async () => {
77
let browser;
@@ -45,7 +45,7 @@ test("Launch browser using config", async () => {
4545
console.log(`${browserType} launched successfully and navigated to playwright.dev`);
4646

4747
// Add a delay of 5 seconds so you can see the browser before it closes
48-
await page.waitForTimeout(5000);
48+
await page.waitForTimeout(5000);
4949
})
5050

5151

tests/web/example/launchChrome.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ test('Launch Chrome', async () => {
1010
await page.goto('https://www.google.com');
1111
console.log(await page.title());
1212
await browser.close();
13-
})
13+
})
14+
File renamed without changes.

0 commit comments

Comments
 (0)