How to Generate Different Test Reports in Playwright?
Bakkappa N
YouTuber @ Testers Talk | Content Creator | Playwright Cypress Selenium SDET Rest Assured API Postman | Automation Testing | QA Test Lead
Playwright offers a flexible reporting system that allows you to generate various types of reports to suit your needs. Here's a breakdown of the available options:
Built-in Reporters
Playwright comes with several built-in reporters that can be easily configured:
Step1; Let's generate most commonly used test reports, Create a spec file with test
// Include playwright module
const { test, expect } = require('@playwright/test');
// Write a test
test('Validate Youtube title', async ({ page }) => {
// Go to URL
await page.goto('https://www.youtube.com/')
// Search with keywords
await page.getByPlaceholder('Search').click();
await page.getByPlaceholder('Search').fill('cypress by testers talk');
await expect(page.getByRole('button', { name: 'Search', exact: true })).toBeEnabled();
await page.getByRole('button', { name: 'Search', exact: true }).click();
await page.waitForTimeout(2000);
// Click on playlist
await page.getByRole('link', { name: 'Cypress by Testers Talk' }).click();
// Validate title
await expect(page).toHaveTitle('Cypress Tutorial Full Course 2023 | Learn Cypress in 5 Hrs - YouTube');
})
Step2: Open playwright.config.js file, add html, allure-report, list, junit, json, list etc.
Step3: Run the test using below command
'npx playwright test
Step4: html report generated
Step5: Allure report generated - To get html report you need to run additional commands
Step6: Junit & JSON report generated
Step7: list report is generated.
Reference: https://playwright.dev/docs
TO RECEIVE DAILY UPDATES, SUBSCRIBE CHANNEL - https://www.youtube.com/c/BakkappaN_SoftwareTesting_Videos?sub_confirmation=1
===== Playwright Automation Full Courses =====
-> Playwright Full Course - https://youtube.com/playlist?list=PLUeDIlio4THEgPRVJRqZRS8uw8hhVNQCM&si=65JRAAG-SkkfphDm
-> Playwright API Testing Crash Course - https://youtube.com/playlist?list=PLUeDIlio4THF3rnYZ63qkbHwMTXiG67vz&si=hNd_ji_kXVmIAr_R
领英推荐
-> Playwright with Azure DeveOps Pipeline - https://youtube.com/playlist?list=PLUeDIlio4THG8irTXJn-Z02nYzmi6dUOF&si=3b4G5tvemlPy0--j
-> Playwright with CRM application testing - https://youtu.be/WwovRRp0f4o?si=w0rzJlUI9BhfP4KS
===== Playwright GitHub Repositories =====
-> Playwright Full Course - https://github.com/BakkappaN/PlaywrightTutorialFullCourse
-> Playwright API Testing Crash Course - https://github.com/BakkappaN/PlaywrightAPITestingTutorial
-> Playwright with Azure DeveOps Pipeline - https://github.com/BakkappaN/PlaywrightAzureDevopsPipeline
-> Playwright with CRM application testing -https://github.com/BakkappaN/MicrosoftD365CRMPlaywrightFramework
-> Playwright with JavaScript Framework [UI + API] - https://github.com/BakkappaN/PlaywrightBaseAutomationFramework
-> Playwright with TypeScript Framework [UI + API]- https://github.com/BakkappaN/Playwright-TypeScript-Framework
Learn more about Playwright:
-> Playwright API Testing Crash Course
-> Playwright with Azure DevOps Complete guide
-> Testing Microsoft CRM application using Playwright
#playwright #apitesting #qa #softwaretesting #crm #javascript #typescript #ado #azuredeveops #framework #fullcourse #codegen #test #e2e #testing #automation #testerstalk #bakkappan #git #github #testautomation #selenium #cypress #microsoftplaywright #microsoft #opensource
SUBSCRIBE CHANNEL TO GET LATEST SOFTWARE TESTING UPDATES - https://www.youtube.com/c/BakkappaN_SoftwareTesting_Videos?sub_confirmation=1