Getting started with Playwright
As explained in Chapter 3, Top Web Test Automation Frameworks, to get started with the Playwright (https://playwright.dev/) framework, you need to install the node package through the following command lines:
npm install -D @playwright/test npx playwright install
Once the preceding package has been installed, together with its dependencies, you are ready to start writing and running your first test locally in either Headed or Headless mode, as explained in Chapter 1, Cross-Browser Testing Methodologies.
To get right down to the code, simply use the JavaScript test code depicted below that performs a login scenario on the GitHub website:
const { test, expect } = require('@playwright/test'); test('basic test', async ({ page }) => { await page.goto('https://github.com/login'); await page.fill('input[name="login"]', 'USER NAME'); await...