Skip to content

[BUG] Getting "Please install @playwright/test package..." after upgrading from 1.34.0 to 1.34.1 #23228

@mauricesnip

Description

@mauricesnip

System info

  • Playwright Version: v1.34.1
  • Operating System: macOS 13.2.1
  • Browser: N/A
  • Other info: Terminal, CLI, Node 18.16.0 LTS

Source code

Config file

// playwright.config.js
const { defineConfig } = require('@playwright/test');

module.exports = defineConfig({
    preserveOutput: 'failures-only',
    snapshotPathTemplate: '{testDir}/__snapshots__/{testFilePath}/{arg}{ext}',
    testDir: './assets',
    use: {
        viewport: {
            width: 1440,
            height: 900,
        },
    },
});

Test file (self-contained)

Simple tests like:

test('builds CSS correctly', () => {
    expect(fs.readFileSync(`${PUBLIC_PATH}${MANIFEST['build/app/app.css']}`, 'utf-8')).toMatchSnapshot();
});

test('renders homepage correctly', async ({ page }) => {
    await page.goto('<REMOVED_URL>');
    await expect(page).toHaveScreenshot({ fullPage: true });
});

// Etc...

Steps

  • Run npx playwright test (executed by yarn test)

Expected

To start running tests by executing npx playwright test, like it did in previous versions (1.34.0 and down).

Actual

Getting the following message:

➜ yarn test
Please install @playwright/test package to use Playwright Test.
  npm install -D @playwright/test

Already rules out a few things

  1. Reinstalling @playwright/test
  2. Completely removing node_modules and reinstalling with yarn
  3. Works with yarn add @playwright/[email protected] -D
  4. Package playwright is not installed

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions