Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore(installation-tests): introduce `npm_i` to install local packages (#12093)

Andrey Lushnikove9ca11d91b03
diff --git a/installation-tests/README.md b/installation-tests/README.md
index bbb4f9af4c..0e3274e4e6 100644
--- a/installation-tests/README.md
+++ b/installation-tests/README.md
@@ -16,3 +16,5 @@ To run all tests:
```bash
./run_all_tests.sh
```
+
+To install local builds of `playwright` packages in tests, do `npm_i playwright`.
diff --git a/installation-tests/bin/npm_i b/installation-tests/bin/npm_i
new file mode 100755
index 0000000000..e32bd25a5a
--- /dev/null
+++ b/installation-tests/bin/npm_i
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+args=""
+for i in "$@"; do
+ if [[ "$i" == "playwright" ]]; then
+ args="${args} ${PLAYWRIGHT_TGZ}"
+ elif [[ $i == "playwright-core" ]]; then
+ args="${args} ${PLAYWRIGHT_CORE_TGZ}"
+ elif [[ $i == "playwright-firefox" ]]; then
+ args="${args} ${PLAYWRIGHT_FIREFOX_TGZ}"
+ elif [[ $i == "playwright-chromium" ]]; then
+ args="${args} ${PLAYWRIGHT_CHROMIUM_TGZ}"
+ elif [[ $i == "playwright-webkit" ]]; then
+ args="${args} ${PLAYWRIGHT_WEBKIT_TGZ}"
+ elif [[ $i == "@playwright/test" ]]; then
+ args="${args} ${PLAYWRIGHT_TEST_TGZ}"
+ elif [[ $i == "-"* ]]; then
+ args="${args} $i"
+ else
+ echo "ERROR: cannot install package $i using npm_i. Use regular npm instead"
+ fi
+done
+npm install $args 2>&1
+
diff --git a/installation-tests/initialize_test.sh b/installation-tests/initialize_test.sh
index d6b05245d5..afcad62e47 100755
--- a/installation-tests/initialize_test.sh
+++ b/installation-tests/initialize_test.sh
@@ -29,8 +29,9 @@ function cecho(){
}
function report_test_result {
+ RV=$?
set +x
- if [[ $? == 0 ]]; then
+ if [[ $RV == 0 ]]; then
echo
cecho "GREEN" "<<<<<<<<<<<<"
cecho "GREEN" " Test '${TEST_FILE}' PASSED"
@@ -50,12 +51,12 @@ function setup_env_variables() {
# Package paths.
NODE_VERSION=$(node -e "console.log(process.version.slice(1).split('.')[0])")
- PLAYWRIGHT_CORE_TGZ="${PWD}/output/playwright-core.tgz"
- PLAYWRIGHT_TGZ="${PWD}/output/playwright.tgz"
- PLAYWRIGHT_CHROMIUM_TGZ="${PWD}/output/playwright-chromium.tgz"
- PLAYWRIGHT_WEBKIT_TGZ="${PWD}/output/playwright-webkit.tgz"
- PLAYWRIGHT_FIREFOX_TGZ="${PWD}/output/playwright-firefox.tgz"
- PLAYWRIGHT_TEST_TGZ="${PWD}/output/playwright-test.tgz"
+ export PLAYWRIGHT_CORE_TGZ="${PWD}/output/playwright-core.tgz"
+ export PLAYWRIGHT_TGZ="${PWD}/output/playwright.tgz"
+ export PLAYWRIGHT_CHROMIUM_TGZ="${PWD}/output/playwright-chromium.tgz"
+ export PLAYWRIGHT_WEBKIT_TGZ="${PWD}/output/playwright-webkit.tgz"
+ export PLAYWRIGHT_FIREFOX_TGZ="${PWD}/output/playwright-firefox.tgz"
+ export PLAYWRIGHT_TEST_TGZ="${PWD}/output/playwright-test.tgz"
PLAYWRIGHT_CHECKOUT="${PWD}/.."
}
@@ -75,6 +76,19 @@ function initialize_test {
local SCRIPTS_PATH="$(pwd -P)"
setup_env_variables
+ TEST_FILE=$(basename $0)
+ TEST_NAME=$(basename ${0%%.sh})
+
+ # Check if test tries to install some playwright-family package
+ # fron NPM registry.
+ if grep 'npm i.*playwright' "$0" 2>&1 >/dev/null; then
+ # If it does, this is an error: we should always install local packages using
+ # the `npm_i` script.
+ cecho "RED" "ERROR: test tries to install playwright-family package from NPM registry!"
+ cecho "RED" " Do not use NPM to install playwright packages!"
+ cecho "RED" " Instead, use 'npm_i' command to install local package"
+ exit 1
+ fi
if [[ "$1" != "--no-build" && "$2" != "--no-build" ]]; then
echo 'Building packages... NOTE: run with `--no-build` to reuse previous builds'
@@ -94,8 +108,6 @@ function initialize_test {
clean_test_root
fi
cd ${TEST_FRAMEWORK_RUN_ROOT}
- TEST_FILE=$(basename $0)
- TEST_NAME=$(basename ${0%%.sh})
cecho "YELLOW" ">>>>>>>>>>>>"
cecho "YELLOW" " Running test - '${TEST_FILE}'"
@@ -103,6 +115,7 @@ function initialize_test {
mkdir ${TEST_NAME} && cd ${TEST_NAME} && npm init -y 1>/dev/null 2>/dev/null
cp "${SCRIPTS_PATH}/fixture-scripts/"* .
+ export PATH="${SCRIPTS_PATH}/bin:${PATH}"
# Enable bash lines logging.
set -x
diff --git a/installation-tests/test_android_types.sh b/installation-tests/test_android_types.sh
index 028c89f496..7443fcb2f8 100755
--- a/installation-tests/test_android_types.sh
+++ b/installation-tests/test_android_types.sh
@@ -1,10 +1,10 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_TGZ}
-npm install -D [email protected]
-npm install -D @types/node@14
+npm_i playwright-core
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright
+npm i -D @types/node@14
echo "import { AndroidDevice, _android, AndroidWebView, Page } from 'playwright';" > "test.ts"
echo "Running tsc"
diff --git a/installation-tests/test_connect_to_selenium.sh b/installation-tests/test_connect_to_selenium.sh
index f8b5176440..943050bc54 100755
--- a/installation-tests/test_connect_to_selenium.sh
+++ b/installation-tests/test_connect_to_selenium.sh
@@ -1,7 +1,7 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
+npm_i playwright-core
node "./download-chromedriver.js" "${PWD}"
export PWTEST_CHROMEDRIVER="${PWD}/chromedriver"
cd "${PLAYWRIGHT_CHECKOUT}"
diff --git a/installation-tests/test_electron_types.sh b/installation-tests/test_electron_types.sh
index ea9eec0b3d..9224f73bdb 100755
--- a/installation-tests/test_electron_types.sh
+++ b/installation-tests/test_electron_types.sh
@@ -1,11 +1,11 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_TGZ}
-npm install electron@12
-npm install -D [email protected]
-npm install -D @types/node@14
+npm_i playwright-core
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright
+npm i electron@12
+npm i -D @types/node@14
echo "import { Page, _electron, ElectronApplication, Electron } from 'playwright';" > "test.ts"
echo "Running tsc"
diff --git a/installation-tests/test_npm_i_installs_local_package.sh b/installation-tests/test_npm_i_installs_local_package.sh
new file mode 100755
index 0000000000..d4b00f6bd2
--- /dev/null
+++ b/installation-tests/test_npm_i_installs_local_package.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+source ./initialize_test.sh && initialize_test "$@"
+
+
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright{,-core,-webkit,-firefox,-chromium}
+# test subshell installation
+OUTPUT=$(npm_i --foreground-script @playwright/test)
+
+SCRIPT=$(cat <<EOF
+ const packageJSON = require('./package.json');
+ for (const [entry, value] of Object.entries(packageJSON.dependencies)) {
+ if (!value.startsWith('file:')) {
+ console.log('ERROR: entry ' + entry + ' installed from NPM registry!');
+ process.exit(1);
+ }
+ }
+EOF
+)
+# make sure all dependencies are locally installed.
+node -e "${SCRIPT}"
+
diff --git a/installation-tests/test_playwright_chromium_should_work.sh b/installation-tests/test_playwright_chromium_should_work.sh
index 39ef92dcf3..2197127850 100755
--- a/installation-tests/test_playwright_chromium_should_work.sh
+++ b/installation-tests/test_playwright_chromium_should_work.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-OUTPUT=$(npm install --foreground-script ${PLAYWRIGHT_CHROMIUM_TGZ})
+npm_i playwright-core
+OUTPUT=$(npm_i --foreground-script playwright-chromium)
if [[ "${OUTPUT}" != *"chromium"* ]]; then
echo "ERROR: should download chromium"
exit 1
diff --git a/installation-tests/test_playwright_cli_codegen_should_work.sh b/installation-tests/test_playwright_cli_codegen_should_work.sh
index 735cf2b35f..6613c5e233 100755
--- a/installation-tests/test_playwright_cli_codegen_should_work.sh
+++ b/installation-tests/test_playwright_cli_codegen_should_work.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-npm install ${PLAYWRIGHT_TGZ}
+npm_i playwright-core
+npm_i playwright
echo "Running playwright codegen"
OUTPUT=$(PWTEST_CLI_EXIT=1 npx playwright codegen)
diff --git a/installation-tests/test_playwright_cli_install_should_work.sh b/installation-tests/test_playwright_cli_install_should_work.sh
index 4397306af5..81723eb8a7 100755
--- a/installation-tests/test_playwright_cli_install_should_work.sh
+++ b/installation-tests/test_playwright_cli_install_should_work.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_TGZ}
+npm_i playwright-core
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright
BROWSERS="$(pwd -P)/browsers"
diff --git a/installation-tests/test_playwright_cli_screenshot_should_work.sh b/installation-tests/test_playwright_cli_screenshot_should_work.sh
index 4f0beaf3ad..9a7fe4badd 100755
--- a/installation-tests/test_playwright_cli_screenshot_should_work.sh
+++ b/installation-tests/test_playwright_cli_screenshot_should_work.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-npm install ${PLAYWRIGHT_TGZ}
+npm_i playwright-core
+npm_i playwright
echo "Running playwright screenshot"
diff --git a/installation-tests/test_playwright_driver_should_work.sh b/installation-tests/test_playwright_driver_should_work.sh
index e465b24db8..ab60b88c56 100755
--- a/installation-tests/test_playwright_driver_should_work.sh
+++ b/installation-tests/test_playwright_driver_should_work.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_TGZ}
+npm_i playwright-core
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright
echo "Running playwright install"
PLAYWRIGHT_BROWSERS_PATH="0" npx playwright install
diff --git a/installation-tests/test_playwright_electron_should_work.sh b/installation-tests/test_playwright_electron_should_work.sh
index da3a0874aa..b2d2667e28 100755
--- a/installation-tests/test_playwright_electron_should_work.sh
+++ b/installation-tests/test_playwright_electron_should_work.sh
@@ -1,9 +1,9 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_TGZ}
-npm install [email protected]
+npm_i playwright-core
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright
echo "Running sanity-electron.js"
node sanity-electron.js
diff --git a/installation-tests/test_playwright_firefox_should_work.sh b/installation-tests/test_playwright_firefox_should_work.sh
index 1d540287e9..ca51fe2fcd 100755
--- a/installation-tests/test_playwright_firefox_should_work.sh
+++ b/installation-tests/test_playwright_firefox_should_work.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-OUTPUT=$(npm install --foreground-script ${PLAYWRIGHT_FIREFOX_TGZ})
+npm_i playwright-core
+OUTPUT=$(npm_i --foreground-script playwright-firefox)
if [[ "${OUTPUT}" == *"chromium"* ]]; then
echo "ERROR: should not download chromium"
exit 1
diff --git a/installation-tests/test_playwright_global_installation.sh b/installation-tests/test_playwright_global_installation.sh
index 84abe152b0..88a83e0443 100755
--- a/installation-tests/test_playwright_global_installation.sh
+++ b/installation-tests/test_playwright_global_installation.sh
@@ -2,8 +2,8 @@
source ./initialize_test.sh && initialize_test "$@"
BROWSERS="$(pwd -P)/browsers"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm install ${PLAYWRIGHT_TGZ}
+npm_i playwright-core
+PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm_i playwright
if [[ ! -d "${BROWSERS}" ]]; then
echo "Directory for shared browsers was not created!"
exit 1
diff --git a/installation-tests/test_playwright_global_installation_cross_package.sh b/installation-tests/test_playwright_global_installation_cross_package.sh
index 80e063ece3..c752c3ee6d 100755
--- a/installation-tests/test_playwright_global_installation_cross_package.sh
+++ b/installation-tests/test_playwright_global_installation_cross_package.sh
@@ -1,13 +1,13 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_FIREFOX_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_WEBKIT_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_CHROMIUM_TGZ}
+npm_i playwright-core
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright-firefox
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright-webkit
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright-chromium
BROWSERS="$(pwd -P)/browsers"
-PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm install ${PLAYWRIGHT_TGZ}
+PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm_i playwright
if [[ ! -d "${BROWSERS}" ]]; then
echo "Directory for shared browsers was not created!"
exit 1
diff --git a/installation-tests/test_playwright_global_installation_subsequent_installs.sh b/installation-tests/test_playwright_global_installation_subsequent_installs.sh
index b98c45c6d7..f04b122ce7 100755
--- a/installation-tests/test_playwright_global_installation_subsequent_installs.sh
+++ b/installation-tests/test_playwright_global_installation_subsequent_installs.sh
@@ -6,8 +6,8 @@ source ./initialize_test.sh && initialize_test "$@"
BROWSERS="$(pwd -P)/browsers"
mkdir install-1 && pushd install-1 && npm init -y
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm install ${PLAYWRIGHT_TGZ}
+npm_i playwright-core
+PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm_i playwright
# Note: the `npm install` would not actually crash, the error
# is merely logged to the console. To reproduce the error, we should make
# sure that script's install.js can be run subsequently without unhandled promise rejections.
diff --git a/installation-tests/test_playwright_should_work.sh b/installation-tests/test_playwright_should_work.sh
index 4653ad4931..a79f433f8e 100755
--- a/installation-tests/test_playwright_should_work.sh
+++ b/installation-tests/test_playwright_should_work.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-OUTPUT=$(npm install --foreground-script ${PLAYWRIGHT_TGZ})
+npm_i playwright-core
+OUTPUT=$(npm_i --foreground-script playwright)
if [[ "${OUTPUT}" != *"chromium"* ]]; then
echo "ERROR: should download chromium"
exit 1
diff --git a/installation-tests/test_playwright_should_work_with_relative_browsers_path.sh b/installation-tests/test_playwright_should_work_with_relative_browsers_path.sh
index 3c39680f76..422f851e69 100755
--- a/installation-tests/test_playwright_should_work_with_relative_browsers_path.sh
+++ b/installation-tests/test_playwright_should_work_with_relative_browsers_path.sh
@@ -4,8 +4,8 @@ source ./initialize_test.sh && initialize_test "$@"
# Make sure that browsers path is resolved relative to the `npm install` call location.
mkdir foo
cd foo
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_BROWSERS_PATH="../relative" npm install ${PLAYWRIGHT_TGZ}
+npm_i playwright-core
+PLAYWRIGHT_BROWSERS_PATH="../relative" npm_i playwright
cd ..
echo "Running sanity.js"
diff --git a/installation-tests/test_playwright_should_work_with_relative_home_path.sh b/installation-tests/test_playwright_should_work_with_relative_home_path.sh
index c8a6dc0ef8..b1c0036048 100755
--- a/installation-tests/test_playwright_should_work_with_relative_home_path.sh
+++ b/installation-tests/test_playwright_should_work_with_relative_home_path.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_BROWSERS_PATH="" HOME=. npm install ${PLAYWRIGHT_TGZ}
+npm_i playwright-core
+PLAYWRIGHT_BROWSERS_PATH="" HOME=. npm_i playwright
echo "Running sanity.js"
# Firefox does not work with relative HOME.
PLAYWRIGHT_BROWSERS_PATH="" HOME=. node sanity.js playwright chromium webkit
diff --git a/installation-tests/test_playwright_test_should_work.sh b/installation-tests/test_playwright_test_should_work.sh
index ad8eb74635..ab381addf7 100755
--- a/installation-tests/test_playwright_test_should_work.sh
+++ b/installation-tests/test_playwright_test_should_work.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-npm install ${PLAYWRIGHT_TEST_TGZ}
+npm_i playwright-core
+npm_i @playwright/test
echo "Running playwright test without install"
if npx playwright test -c .; then
diff --git a/installation-tests/test_playwright_test_stacks_should_work.sh b/installation-tests/test_playwright_test_stacks_should_work.sh
index 691c7c7302..bf9dddca7e 100755
--- a/installation-tests/test_playwright_test_stacks_should_work.sh
+++ b/installation-tests/test_playwright_test_stacks_should_work.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-npm install ${PLAYWRIGHT_TEST_TGZ}
+npm_i playwright-core
+npm_i @playwright/test
PLAYWRIGHT_BROWSERS_PATH="0" npx playwright install chromium
echo "Running playwright test"
diff --git a/installation-tests/test_playwright_validate_dependencies.sh b/installation-tests/test_playwright_validate_dependencies.sh
index 5d4be4125d..5df45e83e8 100755
--- a/installation-tests/test_playwright_validate_dependencies.sh
+++ b/installation-tests/test_playwright_validate_dependencies.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-npm install ${PLAYWRIGHT_TGZ}
+npm_i playwright-core
+npm_i playwright
OUTPUT="$(node validate-dependencies.js)"
if [[ "${OUTPUT}" != *"PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS"* ]]; then
diff --git a/installation-tests/test_playwright_validate_dependencies_skip_executable_path.sh b/installation-tests/test_playwright_validate_dependencies_skip_executable_path.sh
index cecc0b9b60..e896dea6b0 100755
--- a/installation-tests/test_playwright_validate_dependencies_skip_executable_path.sh
+++ b/installation-tests/test_playwright_validate_dependencies_skip_executable_path.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-npm install ${PLAYWRIGHT_TGZ}
+npm_i playwright-core
+npm_i playwright
OUTPUT="$(node validate-dependencies-skip-executable-path.js)"
if [[ "${OUTPUT}" == *"PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS"* ]]; then
diff --git a/installation-tests/test_playwright_webkit_should_work.sh b/installation-tests/test_playwright_webkit_should_work.sh
index 1365de127e..a9ca5ee47c 100755
--- a/installation-tests/test_playwright_webkit_should_work.sh
+++ b/installation-tests/test_playwright_webkit_should_work.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-OUTPUT=$(npm install --foreground-script ${PLAYWRIGHT_WEBKIT_TGZ})
+npm_i playwright-core
+OUTPUT=$(npm_i --foreground-script playwright-webkit)
if [[ "${OUTPUT}" == *"chromium"* ]]; then
echo "ERROR: should not download chromium"
exit 1
diff --git a/installation-tests/test_screencast.sh b/installation-tests/test_screencast.sh
index 49bdddf164..752743d801 100755
--- a/installation-tests/test_screencast.sh
+++ b/installation-tests/test_screencast.sh
@@ -2,11 +2,11 @@
source ./initialize_test.sh && initialize_test "$@"
BROWSERS="$(pwd -P)/browsers"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm install ${PLAYWRIGHT_TGZ}
-PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm install ${PLAYWRIGHT_FIREFOX_TGZ}
-PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm install ${PLAYWRIGHT_WEBKIT_TGZ}
-PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm install ${PLAYWRIGHT_CHROMIUM_TGZ}
+npm_i playwright-core
+PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm_i playwright
+PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm_i playwright-firefox
+PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm_i playwright-webkit
+PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" npm_i playwright-chromium
echo "Running screencast.js"
PLAYWRIGHT_BROWSERS_PATH="${BROWSERS}" node screencast.js playwright
diff --git a/installation-tests/test_skip_browser_download.sh b/installation-tests/test_skip_browser_download.sh
index 57f247ab0d..e20bc7578c 100755
--- a/installation-tests/test_skip_browser_download.sh
+++ b/installation-tests/test_skip_browser_download.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-OUTPUT=$(PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install --foreground-script ${PLAYWRIGHT_TGZ})
+npm_i playwright-core
+OUTPUT=$(PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i --foreground-script playwright)
if [[ "${OUTPUT}" != *"Skipping browsers download because"* ]]; then
echo "missing log message that browsers download is skipped"
exit 1
diff --git a/installation-tests/test_skip_browser_download_inspect_with_custom_executable.sh b/installation-tests/test_skip_browser_download_inspect_with_custom_executable.sh
index 6cc81ffb14..580a380fd4 100755
--- a/installation-tests/test_skip_browser_download_inspect_with_custom_executable.sh
+++ b/installation-tests/test_skip_browser_download_inspect_with_custom_executable.sh
@@ -1,8 +1,8 @@
#!/bin/bash
source ./initialize_test.sh && initialize_test "$@"
-npm install ${PLAYWRIGHT_CORE_TGZ}
-OUTPUT=$(PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install --foreground-script ${PLAYWRIGHT_TGZ})
+npm_i playwright-core
+OUTPUT=$(PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i --foreground-script playwright)
if [[ "${OUTPUT}" != *"Skipping browsers download because"* ]]; then
echo "missing log message that browsers download is skipped"
exit 1
diff --git a/installation-tests/test_typescript_types.sh b/installation-tests/test_typescript_types.sh
index b14ba6cbae..56e3fa76de 100755
--- a/installation-tests/test_typescript_types.sh
+++ b/installation-tests/test_typescript_types.sh
@@ -4,15 +4,15 @@ source ./initialize_test.sh && initialize_test "$@"
# @types/[email protected] is the last version which is compatibel with [email protected].
# After @types/[email protected] URLSearchParams from @types/node conflicts with typescript's
# shipped types and it results in a type error / build failure.
-npm install -D @types/[email protected]
+npm i -D @types/[email protected]
# install all packages.
-npm install ${PLAYWRIGHT_CORE_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_FIREFOX_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_WEBKIT_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_CHROMIUM_TGZ}
-PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install ${PLAYWRIGHT_TEST_TGZ}
+npm_i playwright-core
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright-firefox
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright-webkit
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i playwright-chromium
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm_i @playwright/test
# typecheck all packages.
for PKG_NAME in "playwright" \