Playwright - Test (React)
Murugan K
.NET Core| C# | Microservices | SQL | ReactJS | Node.js | CosmosDB | AZURE | AWS | CI/CD | Docker | Kubernetes | Grafana | Prometheus | Copilot - Conduct : +91 8056166215 | [email protected]
?
Playwright is an open-source test automation library initially developed by Microsoft contributors. It supports programming languages such as Java, Python, C#, and NodeJS. Playwright comes with Apache 2.0 License and is most popular with NodeJS with Javascript/Typescript. This Playwright tutorial will help set up with NodeJS using Visual Studio Code.
Playwright can enable based on the below configuration steps in React,
1.?????Install the playwright package
?? npm init playwright@latest
?
2.?????Write sample playwright test case
import { test, expect } from '@playwright/test';
?
test('test', async ({ page }) => {
?await page.goto('https://localhost:3000');
?
?await page.locator('href=settings').click();
?await expect(page).toHaveURL('https://localhost:3000/settings');
});
?
3.?????Run the playwright all test cases
npx playwright test
4.?????Check the playwright test cases out reports
?
npx playwright show-report