Since Playwright is an npm package, you update the Playwright to the latest or specific version using the npm update or install command. There are several variations of updating the npm package. Let's discuss a few of them in this article. You can check the different versions of the Playwright in the release notes.
Table of Contents
- Update Playwright to Latest Version
- Update Playwright to Specific Version
- Update Playwright using package.json
- Video Tutorial
Update Playwright to Latest Version
To update Playwright to the latest version, follow the below steps.
Step 1: Check Current Version
npx @playwright/test --version
Step 2: Update To Latest Version
npm install @playwright/test@latest
Step 3: Check Updated Version
npx @playwright/test --version
Step 4: Download New Browsers
npx playwright install
Update Playwright to Specific Version
Step 1: Check Current Version
npx @playwright/test --version
Step 2: Update To Specific Version
Replace 1.26 with version of your choice
npm install @playwright/test@1.26
Step 3: Check Updated Version
npx @playwright/test --version
Step 4: Download New Browsers
npx playwright install
Update Playwright using package.json
Step 1: Check Current Version
npx @playwright/test --version
Step 2: Update Cypress Version value in package.json
Replace 1.24 with your version.
"devDependencies": {
"@playwright/test": "1.24"
}
Step 3: Install playwright using npm install
npm install
Step 4: Check Updated Version
npx @playwright/test --version
Step 5: Download New Browsers
npx playwright install
You must have seen the *, ^, or ~, >, =, - symbols along with the package version, and people use npm install or npm update commands to install or update packages. These symbols have special meanings, and npm install and npm update commands install the packages differently. To understand symbol logic refer to npm dependencies docs and understand the difference between npm install and update refer this link.
Comments