storybookjs / test-runner

šŸš• Turn stories into executable tests
https://storybook.js.org/docs/writing-tests/interaction-testing
MIT License
233 stars 72 forks source link

CLI tests don't run using chromium browser with error message "invalid version" #416

Closed laszlo-zaptic closed 11 months ago

laszlo-zaptic commented 11 months ago

Describe the bug just updated playwright, storybook and test-runner to latest verisons, installed playwright dependency chromium-1091 and still get the following error message when running tests for every story:

 FAIL   browser: chromium  stories/CenteredMessage.stories.tsx
  ā— Test suite failed to run

    Invalid version: "118.5"

      at Object.fixVersionField (node_modules/normalize-package-data/lib/fixer.js:191:13)
      at node_modules/normalize-package-data/lib/normalize.js:32:38
          at Array.forEach (<anonymous>)
      at normalize (node_modules/normalize-package-data/lib/normalize.js:31:15)
      at module.exports (node_modules/read-pkg/index.js:20:36)
      at module.exports (node_modules/read-pkg-up/index.js:14:16)
      at setupPage (node_modules/@storybook/test-runner/dist/setup-page.js:63:27)
      at CustomEnvironment.setup (node_modules/@storybook/test-runner/playwright/custom-environment.js:8:5)

the latest version run storybook yarn http-server storybook-static --port 6006 --silent in another terminal run yarn test-storybook

Expected behavior test should run, or there should be a documented way to use a specific browser version

System

Storybook Environment Info:

  System:
    OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 9 5900HX with Radeon Graphics
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 16.20.2 - ~/.nvm/versions/node/v16.20.2/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.20.2/bin/yarn <----- active
    npm: 8.19.4 - ~/.nvm/versions/node/v16.20.2/bin/npm
  Browsers:
    Chrome: 120.0.6099.62
  npmPackages:
    @storybook/addon-docs: ^7.6.4 => 7.6.4 
    @storybook/addon-essentials: ^7.6.4 => 7.6.4 
    @storybook/addon-interactions: ^7.6.4 => 7.6.4 
    @storybook/addons: ^7.6.4 => 7.6.4 
    @storybook/client-api: ^7.6.4 => 7.6.4 
    @storybook/jest: ^0.2.3 => 0.2.3 
    @storybook/react: ^7.6.4 => 7.6.4 
    @storybook/react-webpack5: ^7.6.4 => 7.6.4 
    @storybook/test-runner: ^0.16.0 => 0.16.0 
    @storybook/testing-library: ^0.2.2 => 0.2.2 
    @storybook/testing-react: ^2.0.1 => 2.0.1 
    chromatic: ^7.3.0 => 7.6.0 
    eslint-plugin-storybook: ^0.6.15 => 0.6.15 
    storybook: ^7.6.4 => 7.6.4 
    storybook-addon-react-docgen: ^1.2.44 => 1.2.44 

Additional context before updating playwright it complained that the chromium dir is missing, but that should be fixed now.

laszlo-zaptic commented 11 months ago

nvm my bad invalid version in package.json