atomicdata-dev / atomic-data-browser

This repo is no longer used! Code is moved to Atomic-Server
https://github.com/atomicdata-dev/atomic-server/issues
MIT License
56 stars 9 forks source link

Playwright issues - unable to run e2e tests locally #284

Open joepio opened 1 year ago

joepio commented 1 year ago

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:

joepio commented 1 year ago

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.
joepio commented 1 year ago

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

joepio commented 1 year ago

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