test: normalize node versions for installation tests (#14610)

We should cover node 14 on all platforms (similarly to
other types of tests), and node 16/18 on linux.
This commit is contained in:
Dmitry Gozman 2022-06-07 18:11:58 -07:00 committed by GitHub
parent fdcdd58d7f
commit a5506a80ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View file

@ -167,7 +167,7 @@ jobs:
- macos-latest
- windows-latest
node_version:
- "^18.0.0"
- "^14.1.0" # pre 14.1, zip extraction was broken (https://github.com/microsoft/playwright/issues/1988)
timeout-minutes: 30
steps:
- uses: actions/checkout@v2

View file

@ -109,7 +109,7 @@ jobs:
name: ${{ matrix.browser }}-win-test-results
path: test-results
test-package-installations-older-node-versions:
test-package-installations-other-node-versions:
name: "Installation Test ${{ matrix.os }} (${{ matrix.node_version }})"
runs-on: ${{ matrix.os }}
strategy:
@ -117,7 +117,7 @@ jobs:
matrix:
include:
- os: ubuntu-latest
node_version: "^14.1.0" # pre 14.1, zip extraction was broken (https://github.com/microsoft/playwright/issues/1988)
node_version: "^18.0.0"
- os: ubuntu-latest
node_version: "^16.0.0"
timeout-minutes: 30

View file

@ -14,7 +14,9 @@
* limitations under the License.
*/
const { start } = require('./node_modules/playwright-core/lib/outofprocess');
const pw = require.resolve('playwright');
const oop = require.resolve('playwright-core/lib/outofprocess', { paths: [pw] });
const { start } = require(oop);
(async () => {
const { playwright, stop } = await start();

View file

@ -16,6 +16,7 @@
import { test, expect } from './npmTest';
test('npx playwright install global', async ({ exec, installedSoftwareOnDisk }) => {
test.skip(process.platform === 'win32', 'isLikelyNpxGlobal() does not work in this setup on our bots');
const result = await exec('npx playwright install');
expect(result).toHaveLoggedSoftwareDownload(['chromium', 'ffmpeg', 'firefox', 'webkit']);
expect(await installedSoftwareOnDisk()).toEqual(['chromium', 'ffmpeg', 'firefox', 'webkit']);