atomicdata-dev/atomic-data-browser

Playwright issues - unable to run e2e tests locally

Opened this issue · 3 comments

I'm having a bunch of (probably related) issues running playwright on my local device (m1 macbook, node 18.9).

It started by running pnpm test and getting errors about playwright install needed to be run, to install the browsers.

Then I got

 Playwright Test integrity check failed:                                                                ║
║ You have @playwright/test version '1.26.0' and 'playwright' version '1.29.2' installed!                ║
║ You probably added 'playwright' into your package.json by accident, remove it and re-run 'npm install'

Turns out I had multiple playwright versions which conflicted, so I removed the duplicates and updated to "@playwright/test": "^1.29.2".

When I run pnpm test-query folder I get:

Running 0 tests using 0 workers

TypeError: Unknown file extension ".ts" for /Users/joep/dev/github/atomicdata-dev/atomic-data-browser/data-browser/tests/e2e.spec.ts

    at async Promise.all (index 0)

This might have to do with the type: module change?

When I run pnpm test I get a bunch of these:

│   19) e2e.spec.ts:539:3 › data-browser › dialog ====================================================
│     browserType.launch: Browser closed.
│     ==================== Browser output: ====================
│     <launching> /Users/joep/Library/Caches/ms-playwright/chromium-1041/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-
│     <launched> pid=17824
│     [pid=17824][err] dlopen /Users/joep/Library/Caches/ms-playwright/chromium-1041/chrome-mac/Chromium.app/Contents/MacOS/../Fram
│     [pid=17824] <process did exit: exitCode=null, signal=SIGABRT>
│     [pid=17824] starting temporary directories cleanup
│     =========================== logs ===========================
│     <launching> /Users/joep/Library/Caches/ms-playwright/chromium-1041/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-
│     <launched> pid=17824
│     [pid=17824][err] dlopen /Users/joep/Library/Caches/ms-playwright/chromium-1041/chrome-mac/Chromium.app/Contents/MacOS/../Fram
│     [pid=17824] <process did exit: exitCode=null, signal=SIGABRT>
│     [pid=17824] starting temporary directories cleanup
│     ============================================================
│         at Object.playwrightFixtures.browser.scope [as fn] (/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_module
│         at /Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/@playwright+test@1.29.2/node_modu

Things I tried that did not work:

  • removing node_modules
  • removing pnpm cache / local store
  • updating playwright

Fixed it! At least, the pnpm test command

Had to clear playwright's cache

rm -rf ~/Library/Caches/ms-playwright
pnpx playwright install

Now I still have to get pnpm test-query folder working, as it still shows:

TypeError: Unknown file extension ".ts" for /Users/joep/dev/github/atomicdata-dev/atomic-data-browser/data-browser/tests/e2e.spec.ts

    at async Promise.all (index 0)
=================
 no tests found.

Removing type: module from atomic-data-browser fixed it. Not really happy with this fix, but ok.

@Polleps didn't have the Unknown file extension ".ts" issue.