Playwright Inteview Question and Answer
Playwright Inteview Question and Answer
Playwright Inteview Question and Answer
Dot reporter
Line reporter
HTML reporter
JSON reporter
JUnit reporter
Custom reporter
In addition to the above playwright also supports allure reporters
using third-party plugins.
Handling confirm
//Click on Ok
page.on('dialog', dialog => dialog.accept());
//Click on Cancel
page.on('dialog', dialog => dialog.dismiss ());
Handling Prompt
//Type the text, RSAcademy and Accept the pop up
page.on('dialog', dialog => dialog.accept("RSAcademy"));
During the first run, the playwright stores the reference image
of the homepage, and the next run will be compared against
the reference image.
Optionally we can pass the pixel differences if we need to
ignore the minor differences in the image.
test('example test', async ({ page }) => {
await page.goto('https://playwright.dev');
await expect(page).toHaveScreenshot({ maxDiffPixels: 100 });
});