{ await page.goto("https://localhost:3000/") await expect(page).toHaveUrl("https://localhost:3000/") const pageUrl = PageTransitionEvent.url(); //get the current page url await page.close() //close })"> { await page.goto("https://localhost:3000/") await expect(page).toHaveUrl("https://localhost:3000/") const pageUrl = PageTransitionEvent.url(); //get the current page url await page.close() //close })"> { await page.goto("https://localhost:3000/") await expect(page).toHaveUrl("https://localhost:3000/") const pageUrl = PageTransitionEvent.url(); //get the current page url await page.close() //close })">
//sample test case:
test("it can check whether this page url as specfied url or not ", async({page})=>{
await page.goto("<https://localhost:3000/>")
await expect(page).toHaveUrl("<https://localhost:3000/>")
const pageUrl = PageTransitionEvent.url(); //get the current page url
await page.close() //close
})
page fixture:
test("test case ", async({page})=>{
await page.goto("<https://localhost:3000/>")
await expect(page).toHaveUrl("<https://localhost:3000/>")
})
test("test case ", async()=>{
const browser = await chromium.launch()
const context =await browser.newContext()
const page= await context.newPage()
await page.goto("<https://localhost:3000/>")
await expect(page).toHaveUrl("<https://localhost:3000/>")
})