How to Update Playwright Version

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

  1. Update Playwright to Latest Version
  2. Update Playwright to Specific Version
  3. Update Playwright using package.json
  4. 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.

Thu, 10/20/2022 - 20:14
Tarun Goswami is a highly experienced professional, currently serving as Technical Lead at a well-established IT services company. With over 12 years of experience across multiple domains, he demonstrates his expertise and passion for the industry through his engaging and informative blog writing in his spare time.

Video Tutorial: How to Update Playwright

Tags

Comments