Commit Graph

12943 Commits

Author SHA1 Message Date
Max Schmitt
73e0e92a7e
devops: retry download of upstream Node.js for drivers (#31962) 2024-08-01 19:45:25 +02:00
Dmitry Gozman
a541751657
feat(ui mode): linkify attachment names and content (#31960)
- Pass `contentType` to the CodeMirror.
- Support `text/markdown` mode.
- Custom mode for non-supported types that linkifies urls.
2024-08-01 09:27:45 -07:00
Simon Knott
76cca7fc2c
fix(ui): only populate settings once (#31958)
We populate `localStorage` using an init script. Currently, this script
isn't just run for the UI though, but also for all iframes. So we're
resetting `localStorage` every time the UI loads an iframe.

This hasn't been a problem in the past, because the only consumer of
`localStorage`, `Settings`, only read from `localStorage` once and kept
most state in `useState` afterwards. With
https://github.com/microsoft/playwright/pull/31911, this is no longer
true, so the bug starts biting us!

The fix is to ensure the init script isn't run on iframes.
2024-08-01 17:28:48 +02:00
Playwright Service
c858554dca
feat(chromium-tip-of-tree): roll to r1246 (#31951) 2024-08-01 15:13:15 +02:00
Dmitry Gozman
bbe252a3d7
fix(ui mode): api review feedback (#31952)
- Hide "Testing Options" as not ready.
- Update SettingsView margins.
- Include `page.route` and similar methods into "Show route actions".
2024-08-01 05:36:19 -07:00
Playwright Service
6c6f10b678
feat(chromium): roll to r1129 (#31955)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-01 14:32:44 +02:00
Playwright Service
a83134b270
feat(ffmpeg): roll to r1010 (#31949) 2024-08-01 13:17:11 +02:00
Yury Semikhatsky
47714d6559
feat(ui-mode): add annotations tab (#31945)
<img width="867" alt="image"
src="https://github.com/user-attachments/assets/7d714723-1d3f-49b2-944a-0a476d79aee8">

---------

Signed-off-by: Dmitry Gozman <dgozman@gmail.com>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-08-01 03:43:29 -07:00
Playwright Service
6af2635343
feat(chromium-tip-of-tree): roll to r1245 (#31948)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-01 10:27:02 +02:00
Yury Semikhatsky
62834e314f
chore(trace-viewer): less bright status code icon (#31940)
<img width="182" alt="image"
src="https://github.com/user-attachments/assets/8b381bcc-46e3-45c7-8fd2-e020436d1bff">

<img width="206" alt="image"
src="https://github.com/user-attachments/assets/4ea02b47-a4da-44f7-9c26-13b05374e89d">

<img width="213" alt="image"
src="https://github.com/user-attachments/assets/38b50e2a-f69c-4a78-abb2-2680453fc5fd">
2024-07-31 17:29:05 -07:00
Yury Semikhatsky
0217defab4
chore(trace-viewer): do not shrink metadata view (#31938)
Avoids the following effect:

![image](https://github.com/user-attachments/assets/694de773-acc0-4266-87f2-eab67a3c7ce2)
2024-07-31 16:37:16 -07:00
Yury Semikhatsky
ecd384212d
chore(trace-viewer): copy only file name without line number (#31939)
As discussed in the meeting, copy only file name which is shown in the
same line, do not include highlighted line number.
2024-07-31 15:40:13 -07:00
Dmitry Gozman
e62a54af7a
fix(test runner): do not revert the transform (#31930)
This allows a dynamic import of a TS file to be processed by Babel.

For some reason, Playwright used to revert the CJS transforms. However,
ESM loader and transforms are always active, so CJS should be too.
2024-07-31 13:17:09 -07:00
Yury Semikhatsky
edb89dcb66
chore: make sure error stack includes message as before #31691 (#31934)
This brings stack formatting to how it was prior to
1686e5174d
so that the ports can use it.
2024-07-31 10:58:37 -07:00
Dmitry Gozman
7c55b94280
fix(trace): make sure the correct attachment name is used for downloads (#31928)
When two attachments have the same content sha1, we used the first one's
name for the downloaded file, no matter which one the user clicked to
download. Now we pass the name explicitly.

References #31912.
2024-07-31 06:20:36 -07:00
Sander
c9a12e4ca1
docs(ct): fix component.update example for vue and svelte (#31889) 2024-07-31 13:40:19 +02:00
Simon Knott
daca1681c0
refactor(ui): in splitview component, move sidebar and main from children into named properties (#31925)
Pulled out from https://github.com/microsoft/playwright/pull/31900

I stumbled over `React.Children`, because it's the first time I saw that
used. https://react.dev/reference/react/Children lists `React.Children`
it as "Legacy" and mentions it's uncommon. Also, the fact that SplitView
only displays its first two children, and all others are silently
discarded, can be a surprise to some.

By separating things out into `sidebar` and `main`, not only do we give
the two elements names (otherwise one needs to remember that sidebar is
always the first child), but we also prevent any "third children" from
being dropped.
2024-07-31 12:48:46 +02:00
Simon Knott
99724d0322
refactor(ui): some react refactorings (#31900)
Addresses https://github.com/microsoft/playwright/issues/31863. This PR
is chonky, but the individual commits should be easy to review. If
they're not, i'm happy to break them out into individual PRs.

There's two main things this does:

1. Remove some unused imports
2. Add a `clsx`-inspired helper function for classname templating

I wasn't able to replace `ReactDOM.render` with `ReactDOM.createRoot`.
This is the new recommended way starting with React 18, and the existing
one is going to be deprecated at some point. But it somehow breaks our
tests, i'll have to investigate that separately.
2024-07-31 12:12:06 +02:00
Dmitry Gozman
64fe245297
fix(trace viewer): attachment download (#31920)
- Update attachments tab margins.
- Make sure to pass `&download` in attachment urls. This makes them
downloadable, regressed in #28727.
- Do not additionally list image diffs as screenshots.

Fixes #31912.
2024-07-31 02:29:14 -07:00
Max Schmitt
55187207e4
chore: various roll fixes for .NET (#31914) 2024-07-30 19:09:20 +02:00
Simon Knott
b8b562888e
refactor(ui): synchronize settings via useSyncExternalStore instead of prop drilling (#31911)
Broken out from https://github.com/microsoft/playwright/pull/31900, part
of https://github.com/microsoft/playwright/issues/31863.

Synchronizes different `useSettings` calls via `useSyncExternalStore`.
This saves us from having to drill down settings props everywhere,
without the big refactoring that a `Context` would be.
2024-07-30 17:57:31 +02:00
Simon Knott
8412d973c0
fix(ui): added test in watched file should be run (#31842)
Closes https://github.com/microsoft/playwright/issues/22211

Currently, when the server notifies the UI about changed files, the UI
determines what files to re-run based on an old test list. By listing
tests before that, we make sure that the test list is up-to-date, and
that added tests are included in the next run.

I've also removed the `listChanged` event as discussed in the team sync.
The event isn't used anywhere and fires in exactly the same cases where
`testFilesChanged` fired, so i've folded them into one another. This allowed simplifying `Watcher`.
2024-07-30 14:17:41 +02:00
Playwright Service
947f925443
feat(webkit): roll to r2054 (#31910)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-30 12:24:14 +02:00
Max Schmitt
bd186640df
fix(client-certificates): use matching origin for connections on :443 (#31913)
Motivation: When using client-certificates on a website on port `443`,
we would normalise the user input with `new URL` but still generate a
"bad" representation of the "origin" internally, since the just do
concatenated "host:port".

(The origin doesn't contain the port in case of :443)

We use `clientCertificatesToTLSOptions` in two places:

a) for APIRequestContext, there we pass one from the URL constructor
over and
b) from the socks proxy, there we **now** also pass a "good one" over.

Test plan: We don't want to run the tests on port :443, so only manually
validated the fix.

Relates https://github.com/microsoft/playwright/issues/31906
2024-07-30 12:23:57 +02:00
Max Schmitt
44ce6096bb
feat(html-reporter): add Playwright logo as Favicon (#31908) 2024-07-30 12:02:06 +02:00
Max Schmitt
ac0a3fb275
docs(best-practises): make trace icon location more clear (#31909) 2024-07-30 11:19:07 +02:00
Pavel Feldman
58b0c76f20
chore: use soft event emitter (#31868) 2024-07-29 17:11:31 -07:00
Max Schmitt
7e7319da7d
fix(client-certificates): don't use proxy when using BrowserContext.request (#31898) 2024-07-29 16:44:53 +02:00
Dmitry Gozman
f232507afa
feat(ui mode): ui updates (#31894)
- Update copy to clipboard button.
- Reveal test source in the Source tab instead of external editor.
- New button to reveal in the external editor in the Source tab.
- Move the Pick Locator button next to snapshot tabs.
2024-07-29 07:32:13 -07:00
Max Schmitt
f45cf65921
chore: add maxRetries to APIRequestContext.delete (#31893) 2024-07-29 14:39:30 +02:00
Max Schmitt
cc313f3290
fix(client-certificates): error response body Content-Length calculation (#31897) 2024-07-29 14:39:14 +02:00
Max Schmitt
acf5ea0904
chore: update browser patches as of Jun, 12, 2024 (#31888) 2024-07-29 10:30:28 +02:00
Playwright Service
1a7d6749da
feat(webkit): roll to r2053 (#31885)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2024-07-26 20:32:12 +02:00
Playwright Service
7690694677
feat(webkit): roll to r2052 (#31882) 2024-07-26 20:29:31 +02:00
Max Schmitt
e784e2df01
chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
Max Schmitt
57c7d9e9bb
docs: add release notes for 1.46 (#31875)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Signed-off-by: Dmitry Gozman <dgozman@gmail.com>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-07-26 08:34:26 -07:00
Dmitry Gozman
9227d1c598
docs: explain a bit more about fixture boxing and custom titles (#31877) 2024-07-26 07:43:58 -07:00
Max Schmitt
6988194c97
test: unflake contextmenu recorder test (#31749) 2024-07-26 12:43:05 +02:00
Max Schmitt
b214941a01
chore: make it more clear that --only-changed is per file (#31874) 2024-07-26 12:41:33 +02:00
Max Schmitt
47e4e45bc2
chore: update WebKit version to 18.0 (#31873) 2024-07-26 11:32:51 +02:00
Max Schmitt
09581b615d
fix(client-certificates): return target errors on response when using http2 (#31867) 2024-07-26 11:28:45 +02:00
Max Schmitt
335d31bf65
devops: remove GHA todo in primary workflow for itest (#31871)
This TODO got added during our GHA refactoring a while ago, where I
thought it might make sense to run our itests in `bash`. We didn't do it
before the refactoring either. It seems good to keep them running in
`pwsh` instead, so lets just remove the TODO.

Investigation notes: Running in `bash` on Windows via `Git Bash` seems
like doing a lot of magic, especially with path handling. Things
[like](a02ed38e60/tests/installation/registry.ts (L143))
this break then, since `tar` even when using `Git Bash` [doesn't accept
a Windows
path](https://sourceforge.net/p/mingw/mailman/mingw-users/thread/54CE104A.7060108@hccnet.nl/).

Signed-off-by: Max Schmitt <max@schmitt.mx>
2024-07-26 11:04:51 +02:00
Max Schmitt
81b3c0c402
fix(client-certificates): include socks-certs in npm package (#31872) 2024-07-26 11:04:38 +02:00
Max Schmitt
a02ed38e60
chore: reduce file reads in client-certificates internal TLS server (#31865) 2024-07-25 22:36:25 +02:00
Dmitry Gozman
a41cebc1c9
feat(ui mode): introduce Testing Options and Settings (#31841)
Testing Options control tests, while Settings are UI mode settings.

<img width="298" alt="Screenshot 2024-07-25 at 10 54 22 AM"
src="https://github.com/user-attachments/assets/7b6f5fff-687b-48d1-80b3-d1e6f2a257e8">


These sections are separately expandable, collapsed by default.

<img width="294" alt="Screenshot 2024-07-24 at 2 06 25 PM"
src="https://github.com/user-attachments/assets/5d35ac8c-9289-46ca-aaa2-ebc5419fa0c4">

References #31520.

---------

Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Simon Knott <info@simonknott.de>
2024-07-25 11:23:43 -07:00
Max Schmitt
a966abfd31
test: unflake happy-eyeballs tests (#31861) 2024-07-25 20:22:51 +02:00
Dmitry Gozman
d8d5289e86
fix(remote): make sure api calls reject before browser is closed (#31858)
Upon calling `browser.close()` or dropping remote connection, make sure
to reject api calls before resolving `browser.close()` and firing a
`disconnected` event.

This change aligns the order guarantee with non-remote case.
2024-07-25 09:57:34 -07:00
Max Schmitt
0c6ecf8df4
chore: use happy eyeballs for client-certificates (#31859) 2024-07-25 18:55:47 +02:00
Playwright Service
d3e2c6cbb2
feat(chromium-tip-of-tree): roll to r1244 (#31856)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-25 18:54:24 +02:00
Max Schmitt
90af289ba2
test: use managed http2 server for client-certificates (#31844) 2024-07-25 18:53:38 +02:00