2

I'm trying to run the following pipeline in bitbucket

image: node:14-stretch

pipelines:
  default:
        - step:
            name: Install Depndencies
            caches:
              - node
            script:
                - apt update && apt install -y curl sudo git wget unzip xvfb libnss3 libgtk-3-0 libasound2 fonts-liberation
        - step:
            name: Install package.json
            script:
                - npm i
            caches:
              - node
        - step:
            name: Execute test
            caches:
              - node
            script:
                - npm run execute:test

the pipeline is failing in the last step in the script npm run execute:test, I think its caching issue but I'm not quite sure how this can be managed,down below is the error log

+ npm run execute:test
> playwright-fw@1.0.0 execute:test /opt/atlassian/pipelines/agent/build
> mocha
  Dashboard Test Suite
       browserType.launch: Failed to launch chromium because executable doesn't exist at /root/.cache/ms-playwright/chromium-888113/chrome-linux/chrome

Try re-installing playwright with "npm install playwright"

1 Answers1

1

NPM does unfortunately not run the install scripts again when you are having cached node_modules available. Playwright uses NPM postinstall scripts for installing the browser afterwards. So you can either disable your cache there or run an additional npx playwright install which is probably the better solution for that problem.

Also instead of installing the system dependencies manually, you can use npx playwright install-deps, see here for reference.

Max Schmitt
  • 2,529
  • 1
  • 12
  • 26
  • 1
    this command npx playwright install-deps throws Cannot install dependencies for this linux distribution! –  Jun 25 '21 at 11:36
  • 1
    Then Playwright is not officially supported on your platform. See here for the supported platforms: https://playwright.dev/docs/intro#system-requirements – Max Schmitt Jun 25 '21 at 13:36