-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignmen1.spec.js
More file actions
61 lines (34 loc) · 1.64 KB
/
Assignmen1.spec.js
File metadata and controls
61 lines (34 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// @ts-check
const { test, expect, chromium } = require('@playwright/test');
test('fill the form',async({page})=>{
// const browser = await chromium.launch({headless:false})
// const context = await browser.newContext()
// const page = await context.newPage()
// Resolve , Reject
await page.goto("https://demoqa.com/")
// attribute [attributename = value]
await page.locator("[class=card-body]").filter({hasText:"Elements"}).click()
await page.getByText("Forms").click()
await page.getByText("Practice Form").click()
await page.getByPlaceholder("First Name").fill("Anbunithi")
await page.getByPlaceholder("Last Name").fill("Rajendran")
await page.getByPlaceholder("name@example.com").fill("anbu@gmail.com")
await page.getByText("Male",{exact:true}).click()
await page.getByRole("textbox",{name:"Mobile Number"}).fill("1234567890")
//await page.locator('#subjectsContainer').click()
const subject = page.locator('#subjectsInput')
await subject.fill("English")
await subject.press('Enter')
await page.getByText("Sports").click()
await page.getByRole('textbox',{name:"Current"}).fill("Chennai 600 0028")
await page.getByText("English").click()
const dateOfBirth = page.locator('#dateOfBirthInput')
await dateOfBirth.fill("11 jan 2023")
const filePath = 'C:\\Users\\rajen\\Pictures\\honey-bees-337695_1280.jpg';
await page.locator('#uploadPicture').setInputFiles(filePath)
await page.getByText("Select State").click()
await page.getByText("Rajasthan").click()
await page.getByText("Select City").click()
await page.getByText("Jaipur",{ exact: true }).click()
await page.waitForTimeout(4000)
})