mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-16 07:33:35 +03:00
2c59985bcd
This patch refactors installation tests. With this refactoring: - each test is a separate file - to run a single test, just run the bash file * tests support optional `--no-build` flag to re-use previously built packages. * tests support optional `--debug` flag to see line-by-line test output * failed tests print a line that can be copied-and-pasted locally to debug the test - run all tests with `//installation-tests/run_all_tests.sh` * test output is hidden for successful runs when run locally and is shown when test fails * runs all tests, and reports failed tests in the end * command output is split into groups when viewed on Github.
33 lines
759 B
Bash
33 lines
759 B
Bash
#!/bin/bash
|
|
source ./initialize_test.sh && initialize_test "$@"
|
|
|
|
npm install ${PLAYWRIGHT_CORE_TGZ}
|
|
OUTPUT=$(npm install --foreground-script ${PLAYWRIGHT_TGZ})
|
|
if [[ "${OUTPUT}" != *"chromium"* ]]; then
|
|
echo "ERROR: should download chromium"
|
|
exit 1
|
|
fi
|
|
if [[ "${OUTPUT}" != *"firefox"* ]]; then
|
|
echo "ERROR: should download firefox"
|
|
exit 1
|
|
fi
|
|
if [[ "${OUTPUT}" != *"webkit"* ]]; then
|
|
echo "ERROR: should download webkit"
|
|
exit 1
|
|
fi
|
|
copy_test_scripts
|
|
|
|
echo "Running sanity.js"
|
|
node sanity.js playwright
|
|
if [[ ${NODE_VERSION} -ge 14 ]]; then
|
|
echo "Running esm.js"
|
|
node esm-playwright.mjs
|
|
fi
|
|
|
|
echo "Running playwright test"
|
|
if npx playwright test -c .; then
|
|
echo "ERROR: should not be able to run tests with just playwright package"
|
|
exit 1
|
|
fi
|
|
|