Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add instructions for bun/bunx #26454

Closed
wants to merge 5 commits into from

Conversation

colinhacks
Copy link

No description provided.

@colinhacks
Copy link
Author

colinhacks commented Aug 14, 2023

@microsoft-github-policy-service agree company="Bun"

@github-actions
Copy link
Contributor

Test results for "tests 1"

5 failed
❌ [playwright-test] › expect-poll.spec.ts:222:5 › should show intermediate result for poll that spills over test time
❌ [playwright-test] › expect-to-pass.spec.ts:208:5 › should show intermediate result for toPass that spills over test time
❌ [playwright-test] › loader.spec.ts:755:5 › should resolve .js import to .tsx file in non-ESM mode for components
❌ [playwright-test] › reporter-html.spec.ts:1452:7 › merged › labels › filter should update stats
❌ [playwright-test] › ui-mode-trace.spec.ts:53:5 › should merge web assertion events

9 flaky
⚠️ [chromium] › page/page-event-request.spec.ts:101:3 › should report navigation requests and responses handled by service worker
⚠️ [chromium] › library/tracing.spec.ts:239:5 › should not include trace resources from the previous chunks
⚠️ [firefox] › library/fetch-proxy.spec.ts:30:3 › context request should pick up proxy credentials
⚠️ [playwright-test] › ui-mode-trace.spec.ts:53:5 › should merge web assertion events
⚠️ [chromium] › library/capabilities.spec.ts:139:3 › should not crash on showDirectoryPicker
⚠️ [chromium] › library/tracing.spec.ts:239:5 › should not include trace resources from the previous chunks
⚠️ [webkit] › library/browsercontext-fetch.spec.ts:1039:3 › should abort requests when browser context closes
⚠️ [playwright-test] › ui-mode-test-progress.spec.ts:167:5 › should update tracing network live
⚠️ [playwright-test] › ui-mode-trace.spec.ts:126:5 › should show snapshots for sync assertions

25025 passed, 583 skipped
✔️✔️✔️

[playwright-test] › expect-poll.spec.ts:222:5 › should show intermediate result for poll that spills over test time

Error: expect(received).toContain(expected) // indexOf

Expected substring: "Expected: 2"
Received string:    "
Running 1 test using 1 worker·
  ✘  1 a.spec.ts:3:11 › should fail (2.0s)··
  1) a.spec.ts:3:11 › should fail ──────────────────────────────────────────────────────────────────·
    Test timeout of 2000ms exceeded.·
  1 failed
    a.spec.ts:3:11 › should fail ───────────────────────────────────────────────────────────────────
"

  230 |   }, { timeout: 2000 });
  231 |   expect(result.exitCode).toBe(1);
> 232 |   expect(result.output).toContain('Expected: 2');
      |                         ^
  233 |   expect(result.output).toContain('Received: 3');
  234 | });
  235 |

    at /Users/runner/work/playwright/playwright/tests/playwright-test/expect-poll.spec.ts:232:25

[playwright-test] › expect-to-pass.spec.ts:208:5 › should show intermediate result for toPass that spills over test time

Error: expect(received).toContain(expected) // indexOf

Expected substring: "Expected: 2"
Received string:    "
Running 1 test using 1 worker·
  ✘  1 a.spec.ts:3:11 › should fail (1.0s)··
  1) a.spec.ts:3:11 › should fail ──────────────────────────────────────────────────────────────────·
    Test timeout of 1000ms exceeded.·
  1 failed
    a.spec.ts:3:11 › should fail ───────────────────────────────────────────────────────────────────
"

  218 |   }, { timeout: 1000 });
  219 |   expect(result.exitCode).toBe(1);
> 220 |   expect(result.output).toContain('Expected: 2');
      |                         ^
  221 |   expect(result.output).toContain('Received: 3');
  222 | });
  223 |

    at /Users/runner/work/playwright/playwright/tests/playwright-test/expect-to-pass.spec.ts:220:25

[playwright-test] › loader.spec.ts:755:5 › should resolve .js import to .tsx file in non-ESM mode for components

Test timeout of 30000ms exceeded.

[playwright-test] › reporter-html.spec.ts:1452:7 › merged › labels › filter should update stats

Error: expect(received).toBe(expected) // Object.is equality

Expected: "Total time: 1070ms"
Received: "Total time: 1.1s"

  1774 |         await expect(page.locator('.chip', { hasText: 'c.test.js' })).toHaveCount(1);
  1775 |
> 1776 |         await flakyButton.click();
       |                                 ^
  1777 |
  1778 |         await expect(searchInput).toHaveValue('@regression @flaky');
  1779 |         await expect(page).toHaveURL(/@regression%20@flaky/);

    at checkTotalDuration (D:\a\playwright\playwright\tests\playwright-test\reporter-html.spec.ts:1776:33)
    at D:\a\playwright\playwright\tests\playwright-test\reporter-html.spec.ts:1792:9

[playwright-test] › ui-mode-trace.spec.ts:53:5 › should merge web assertion events

Error: action list

- Expected  -  6
+ Received  + 10

  Array [
-   /Before Hooks[\d.]+m?s/,
-   /page.setContent[\d.]+m?s/,
-   /expect.toBeVisiblelocator\('button'\)[\d.]+m?s/,
-   /After Hooks[\d.]+m?s/,
-   /fixture: page[\d.]+m?s/,
-   /fixture: context[\d.]+m?s/,
+   "Before Hooks1.8s",
+   "fixture: browser1.4s",
+   "fixture: context41ms",
+   "fixture: page383ms",
+   "browserContext.newPage372ms",
+   "page.setContent170ms",
+   "expect.toBeVisiblelocator('button')55ms",
+   "After Hooks2ms",
+   "fixture: page0ms",
+   "fixture: context0ms",
  ]
Call log:
  - locator._expect with timeout 75000ms
  - waiting for getByTestId('action-list').getByRole('listitem')
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 1 element
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements


  68 |       listItem,
  69 |       'action list'
> 70 |   ).toHaveText([
     |     ^
  71 |     /Before Hooks[\d.]+m?s/,
  72 |     /page.setContent[\d.]+m?s/,
  73 |     /expect.toBeVisiblelocator\('button'\)[\d.]+m?s/,

    at D:\a\playwright\playwright\tests\playwright-test\ui-mode-trace.spec.ts:70:5

Retry 1:

Error: action list

- Expected  -  6
+ Received  + 10

  Array [
-   /Before Hooks[\d.]+m?s/,
-   /page.setContent[\d.]+m?s/,
-   /expect.toBeVisiblelocator\('button'\)[\d.]+m?s/,
-   /After Hooks[\d.]+m?s/,
-   /fixture: page[\d.]+m?s/,
-   /fixture: context[\d.]+m?s/,
+   "Before Hooks1.1s",
+   "fixture: browser735ms",
+   "fixture: context44ms",
+   "fixture: page276ms",
+   "browserContext.newPage266ms",
+   "page.setContent115ms",
+   "expect.toBeVisiblelocator('button')40ms",
+   "After Hooks2ms",
+   "fixture: page0ms",
+   "fixture: context0ms",
  ]
Call log:
  - locator._expect with timeout 75000ms
  - waiting for getByTestId('action-list').getByRole('listitem')
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 1 element
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements


  68 |       listItem,
  69 |       'action list'
> 70 |   ).toHaveText([
     |     ^
  71 |     /Before Hooks[\d.]+m?s/,
  72 |     /page.setContent[\d.]+m?s/,
  73 |     /expect.toBeVisiblelocator\('button'\)[\d.]+m?s/,

    at D:\a\playwright\playwright\tests\playwright-test\ui-mode-trace.spec.ts:70:5

Retry 2:

Error: action list

- Expected  -  6
+ Received  + 10

  Array [
-   /Before Hooks[\d.]+m?s/,
-   /page.setContent[\d.]+m?s/,
-   /expect.toBeVisiblelocator\('button'\)[\d.]+m?s/,
-   /After Hooks[\d.]+m?s/,
-   /fixture: page[\d.]+m?s/,
-   /fixture: context[\d.]+m?s/,
+   "Before Hooks1.4s",
+   "fixture: browser899ms",
+   "fixture: context50ms",
+   "fixture: page410ms",
+   "browserContext.newPage400ms",
+   "page.setContent154ms",
+   "expect.toBeVisiblelocator('button')68ms",
+   "After Hooks2ms",
+   "fixture: page0ms",
+   "fixture: context0ms",
  ]
Call log:
  - locator._expect with timeout 75000ms
  - waiting for getByTestId('action-list').getByRole('listitem')
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 1 element
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements


  68 |       listItem,
  69 |       'action list'
> 70 |   ).toHaveText([
     |     ^
  71 |     /Before Hooks[\d.]+m?s/,
  72 |     /page.setContent[\d.]+m?s/,
  73 |     /expect.toBeVisiblelocator\('button'\)[\d.]+m?s/,

    at D:\a\playwright\playwright\tests\playwright-test\ui-mode-trace.spec.ts:70:5

Retry 3:

Error: action list

- Expected  -  6
+ Received  + 10

  Array [
-   /Before Hooks[\d.]+m?s/,
-   /page.setContent[\d.]+m?s/,
-   /expect.toBeVisiblelocator\('button'\)[\d.]+m?s/,
-   /After Hooks[\d.]+m?s/,
-   /fixture: page[\d.]+m?s/,
-   /fixture: context[\d.]+m?s/,
+   "Before Hooks1.9s",
+   "fixture: browser1.3s",
+   "fixture: context38ms",
+   "fixture: page433ms",
+   "browserContext.newPage425ms",
+   "page.setContent81ms",
+   "expect.toBeVisiblelocator('button')54ms",
+   "After Hooks3ms",
+   "fixture: page0ms",
+   "fixture: context0ms",
  ]
Call log:
  - locator._expect with timeout 75000ms
  - waiting for getByTestId('action-list').getByRole('listitem')
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 0 elements
  -   locator resolved to 1 element
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements
  -   locator resolved to 10 elements


  68 |       listItem,
  69 |       'action list'
> 70 |   ).toHaveText([
     |     ^
  71 |     /Before Hooks[\d.]+m?s/,
  72 |     /page.setContent[\d.]+m?s/,
  73 |     /expect.toBeVisiblelocator\('button'\)[\d.]+m?s/,

    at D:\a\playwright\playwright\tests\playwright-test\ui-mode-trace.spec.ts:70:5

Merge workflow run.

@github-actions
Copy link
Contributor

Test results for "tests 1"

1 failed
❌ [playwright-test] › reporter-html.spec.ts:1452:7 › created › labels › filter should update stats

13 flaky
⚠️ [chromium] › library/tracing.spec.ts:239:5 › should not include trace resources from the previous chunks
⚠️ [chromium] › library/capabilities.spec.ts:139:3 › should not crash on showDirectoryPicker
⚠️ [chromium] › library/tracing.spec.ts:239:5 › should not include trace resources from the previous chunks
⚠️ [firefox] › page/page-event-request.spec.ts:162:3 › should return response body when Cross-Origin-Opener-Policy is set
⚠️ [firefox] › page/page-goto.spec.ts:81:3 › should work with Cross-Origin-Opener-Policy
⚠️ [playwright-test] › ui-mode-trace.spec.ts:53:5 › should merge web assertion events
⚠️ [chromium] › library/tracing.spec.ts:239:5 › should not include trace resources from the previous chunks
⚠️ [chromium] › page/page-event-request.spec.ts:101:3 › should report navigation requests and responses handled by service worker
⚠️ [webkit] › library/browsercontext-fetch.spec.ts:1039:3 › should abort requests when browser context closes
⚠️ [webkit] › library/browsercontext-reuse.spec.ts:50:1 › should reset serviceworker
⚠️ [playwright-test] › ui-mode-test-progress.spec.ts:218:5 › should show trace w/ multiple contexts
⚠️ [playwright-test] › ui-mode-trace.spec.ts:22:5 › should merge trace events
⚠️ [playwright-test] › ui-mode-trace.spec.ts:53:5 › should merge web assertion events

25025 passed, 583 skipped
✔️✔️✔️

[playwright-test] › reporter-html.spec.ts:1452:7 › created › labels › filter should update stats

Error: expect(received).toBe(expected) // Object.is equality

Expected: "Total time: 1153ms"
Received: "Total time: 1.2s"

  1774 |         await expect(page.locator('.chip', { hasText: 'c.test.js' })).toHaveCount(1);
  1775 |
> 1776 |         await flakyButton.click();
       |                                 ^
  1777 |
  1778 |         await expect(searchInput).toHaveValue('@regression @flaky');
  1779 |         await expect(page).toHaveURL(/@regression%20@flaky/);

    at checkTotalDuration (/Users/runner/work/playwright/playwright/tests/playwright-test/reporter-html.spec.ts:1776:33)
    at /Users/runner/work/playwright/playwright/tests/playwright-test/reporter-html.spec.ts:1792:9

Merge workflow run.

<TabItem value="bun">

```bash
bunx create-playwright
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bunx was not available, so I tried with bun x which wasn't working for me:

image

Copy link
Author

@colinhacks colinhacks Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, how are you running this? Are you on a recent version of Bun? If bunx isn't available it's possibly quite old.

I see a different error (which I can also replicate with npx).

Note that bunx respects the shebang line in create-playwright so it should behave identically to npx.

$ bunx create-playwright
Getting started with writing end-to-end tests with Playwright:
Initializing project in '.'
✔ Where to put your end-to-end tests? · playwright
✔ Add a GitHub Actions workflow? (y/N) · false
✔ Install Playwright browsers (can be done manually via 'npx playwright install')? (Y/n) · true
Installing Playwright Test (npm install --save-dev @playwright/test)…
npm ERR! Invalid Version: 

npm ERR! A complete log of this run can be found in: /Users/colinmcd94/.npm/_logs/2023-08-15T00_10_16_493Z-debug-0.log
Error: Command failed: npm install --save-dev @playwright/test
    at checkExecSyncError (node:child_process:887:11)
    at execSync (node:child_process:959:15)
    at executeCommands (/private/tmp/create-playwright@latest--bunx/node_modules/create-playwright/lib/index.js:4519:39)
    at Generator.run (/private/tmp/create-playwright@latest--bunx/node_modules/create-playwright/lib/index.js:4679:5)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /private/tmp/create-playwright@latest--bunx/node_modules/create-playwright/lib/index.js:4952:3 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 12934,
  stdout: null,
  stderr: null
}
error: "create-playwright" exited with code 1 (SIGHUP)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the latest bun available on bun.sh 0.7.3

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm able to replicate your error when I do bunx --bun create-playwright which runs the create-playwright CLI with the Bun runtime. Opened an issue here: oven-sh/bun#4153

Though without the --bun flag this command should respect the shebang line and run the CLI with Node.js. Maybe you have a global bunfig.toml that changes this behavior?

I'm able to run bunx create-playwright successfully on my machine now...I think that "Invalid Version" error was a transient npm registry issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a fresh installation from bun.sh on GitHub Codespaces, so no global bunfig.toml was present.

Generally speaking we should try to run our testsuite "npm run ctest" with bun and see how many tests pass/are failing.

@github-actions
Copy link
Contributor

Test results for "tests 1"

1 failed
❌ [playwright-test] › reporter-html.spec.ts:1452:7 › created › labels › filter should update stats

14 flaky
⚠️ [chromium] › library/tracing.spec.ts:239:5 › should not include trace resources from the previous chunks
⚠️ [chromium] › library/tracing.spec.ts:239:5 › should not include trace resources from the previous chunks
⚠️ [chromium] › page/page-event-request.spec.ts:130:3 › should report navigation requests and responses handled by service worker with routing
⚠️ [firefox] › page/page-request-continue.spec.ts:271:3 › should work with Cross-Origin-Opener-Policy
⚠️ [playwright-test] › ui-mode-trace.spec.ts:22:5 › should merge trace events
⚠️ [chromium] › library/tracing.spec.ts:239:5 › should not include trace resources from the previous chunks
⚠️ [playwright-test] › ui-mode-test-progress.spec.ts:167:5 › should update tracing network live
⚠️ [playwright-test] › ui-mode-trace.spec.ts:22:5 › should merge trace events
⚠️ [webkit] › library/browsercontext-fetch.spec.ts:1039:3 › should abort requests when browser context closes
⚠️ [webkit] › library/browsercontext-reuse.spec.ts:50:1 › should reset serviceworker
⚠️ [webkit] › library/inspector/cli-codegen-javascript.spec.ts:87:5 › should save the codegen output to a file if specified
⚠️ [playwright-test] › ui-mode-trace.spec.ts:22:5 › should merge trace events
⚠️ [playwright-test] › ui-mode-trace.spec.ts:80:5 › should merge screenshot assertions
⚠️ [playwright-test] › ui-mode-trace.spec.ts:126:5 › should show snapshots for sync assertions

25024 passed, 583 skipped
✔️✔️✔️

[playwright-test] › reporter-html.spec.ts:1452:7 › created › labels › filter should update stats

Error: expect(received).toBe(expected) // Object.is equality

Expected: "Total time: 1036ms"
Received: "Total time: 1.0s"

  1774 |         await expect(page.locator('.chip', { hasText: 'c.test.js' })).toHaveCount(1);
  1775 |
> 1776 |         await flakyButton.click();
       |                                 ^
  1777 |
  1778 |         await expect(searchInput).toHaveValue('@regression @flaky');
  1779 |         await expect(page).toHaveURL(/@regression%20@flaky/);

    at checkTotalDuration (D:\a\playwright\playwright\tests\playwright-test\reporter-html.spec.ts:1776:33)
    at D:\a\playwright\playwright\tests\playwright-test\reporter-html.spec.ts:1782:9

Merge workflow run.

@colinhacks colinhacks mentioned this pull request Aug 17, 2023
2 tasks
@pavelfeldman
Copy link
Member

Let's wait for the users to request interop with bun. We don't know if it works, so documenting it would be potentially setting up users for failure.

@infrahead
Copy link

@pavelfeldman FYI, it seems like Bun runtime support is close, but now stuck on this issue with imports/exports - oven-sh/bun#2492 (comment)

@mxschmitt
Copy link
Member

Without adding bots / testing infrastructure to make sure all the Playwright tests pass on bun, we are not confident enough to recommend this to our users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants