166 Commits

Author SHA1 Message Date
Adam Gastineau
875436855e
chore(lint): Ensure EOL newlines (#34117) 2024-12-20 09:17:09 -08:00
Max Schmitt
52b2548612
chore: no @web imports from @web package (#34055) 2024-12-17 20:27:21 +01:00
Adam Gastineau
aabbcbf41d
fix(trace-viewer): Fix network log flicker #33929 (#34036) 2024-12-17 05:24:22 -08:00
Max Schmitt
65688d623e
chore: update TypeScript to v5.7 (#33994) 2024-12-13 04:52:04 -08:00
Simon Knott
4fb6c4ed4c
fix(trace): in indexTree check isVisible before adding to result (#33797) 2024-11-28 14:04:34 +01:00
Pavel Feldman
a98021499f
chore: add cm placeholder text (#33635) 2024-11-15 16:19:35 -08:00
Pavel Feldman
649e0e0235
chore: nicer cm widgets for aria (#33524) 2024-11-11 09:40:50 -08:00
Pavel Feldman
503f74da90
chore: allow editing aria template in recorder (tests) (#33522) 2024-11-08 17:18:51 -08:00
Pavel Feldman
b021b58379
chore: allow editing aria template in recorder (#33482) 2024-11-08 07:43:01 -08:00
Simon Knott
0d92737a07
chore(web): replace static ID with React.useId (#33474) 2024-11-06 14:42:48 +01:00
Simon Knott
f554f42b82
feat(trace viewer): link from attach action to attachment tab (#33265) 2024-11-06 10:22:15 +01:00
Pavel Feldman
a655b0bfb3
chrome: aria api review (#33458) 2024-11-05 15:23:38 -08:00
Pavel Feldman
80bd246543
chore: use React.useId for a11y (#33402) 2024-11-01 13:38:16 -07:00
Yury Semikhatsky
c95feccce4
chore: support reverse in ansi2html, drop ansi-to-html (#33389) 2024-10-31 21:42:06 -07:00
Pavel Feldman
74e5e5560f
chore: update missing snapshots by default (#33311) 2024-10-25 16:13:38 -07:00
Pavel Feldman
6bfdad068c
chore: introduce accessibility tab in recorder (#33235) 2024-10-22 16:36:03 -07:00
Pavel Feldman
2a3d67195d
chore: use aria snapshots in some ui mode tests (#33212) 2024-10-21 21:54:06 -07:00
Pavel Feldman
2e8e7a66cd
chore: implement tree w/o list (#33169) 2024-10-18 13:50:43 -07:00
Pavel Feldman
623a8916f9
chore: implement tree w/o list (#33167) 2024-10-17 16:57:45 -07:00
Pavel Feldman
6cfcbe0d6d
chore: fix codegen selector while debugging (#33099)
Fixes #33052
2024-10-14 14:04:24 -07:00
Yury Semikhatsky
b9cce598dd
fix(screenshot): show image diff inline in errors list (#32997)
The diff is now shown inline in the errors list.

There are 2 possible failures of toHaveScreenshot
* Previous and actual snapshot mismatch. In this case html report will
show diff between Actual/Previous and have Expected as a separate
screenshot.
* Actual/Previous are equal but they differ from the expected. In this
case html report only contains Actual/Expected images and the diff.

Reference: https://github.com/microsoft/playwright/issues/32341

<img width="1039" alt="image"
src="https://github.com/user-attachments/assets/b458f986-cc25-4721-862c-0cc2c1b01a42">
2024-10-10 16:49:17 -07:00
Pavel Feldman
6c9823eeaf
chore: allow minimal height for trace attachments (#32996) 2024-10-08 08:33:45 -07:00
Pavel Feldman
c105de4436
chore: move actions types to recorder (#32839) 2024-09-26 14:50:09 -07:00
Pavel Feldman
8649b13f25
chore: start putting tv-recorder ui together (#32776) 2024-09-23 19:13:45 -07:00
Max Schmitt
4c31a8289f
feat(trace-viewer): add network requests 'copy as cURL' button (#32627) 2024-09-18 14:35:11 +02:00
Pavel Feldman
9a313eecc9
chore: roll expect and move it to third party (#32458) 2024-09-09 13:12:20 -07:00
Simon Knott
3fe1263643
feat(trace viewer): show Screenshot instead of Snapshot (#32248)
Closes https://github.com/microsoft/playwright/issues/23964.

Trace snapshots are a best-effort snapshots of the browser DOM, but we
can't guarantee them to be exactly what the browser showed. One example
of this is `canvas` elements, where you just can't see their contents.
That makes snapshots useful, but not perfect.

For those cases where the snapshot doesn't show everything, this PR
introduces a new setting to show a screenshot instead. You won't be able
to scroll or inspect the DOM or select a locator anymore. But if the
snapshot was missing something, or displaying something wrong, you can
now check the screenshot instead.
2024-09-06 16:24:33 +02:00
Dmitry Gozman
d7393f998e
chore: simplify settings management in UI mode (#32440) 2024-09-04 01:05:07 -07:00
Pavel Feldman
fc4d8f2bb6
chore: roll codicon (#32234) 2024-08-20 10:56:46 -07:00
Simon Knott
b599335404
chore(ui): enable react/recommended lint rules (#32214)
Closes https://github.com/microsoft/playwright/issues/32159. I
originally set out to enable Strict Mode for our React UI, but found a
way better thing: Enabling the lint rules we had already installed!

`eslint-plugin-react` is already in of our `package.json`, and this PR
enables it and fixes some of the reported issues. Most of them are
around the `key` prop which is mostly about performance, but there's
also fixes for misspelled `data-testid` props.
2024-08-20 14:16:28 +02:00
Rui Figueira
3d69c591d3
fix(web): use currentTheme instead of settings in toggleTheme (#32104) 2024-08-12 13:19:30 -07:00
Max Schmitt
0d575b4ef6
chore: less 'as any' in html-reporter (#32117)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Simon Knott <info@simonknott.de>
2024-08-12 15:17:42 +02:00
Pavel Feldman
80e014f4b6
chore: sources tab render polish (#32055) 2024-08-08 10:53:59 -07:00
Simon Knott
17bb36a7fe
fix(ui): reset higlighted action on keyboard navigation (#32051)
Closes https://github.com/microsoft/playwright/issues/32050

When keyboarding through the action view, the UI continues showing the
hovered action. This makes keyboard nav hard to use.

The fix is to reset the higlighted action on keyboard navigation. This
is what we do when the mouse pointer leaves an action, and what I think
is reasonable.
2024-08-08 10:06:36 +02:00
Pavel Feldman
79ca3f28c5
chore: simplify useSetting to not rely on useSyncExternalStore (#32018) 2024-08-06 14:30:15 -07:00
Yury Semikhatsky
5a80ddfaf9
chore: remove bright counter from sidebar tab selector (#31975)
Removing the following icon:

![image](https://github.com/user-attachments/assets/d2de2ed0-f66e-4452-8763-aad1b6e7bb79)

HTML `options` element cannot be styled, so just removing the counter in
sidebar mode:

<img width="348" alt="image"
src="https://github.com/user-attachments/assets/d636dca2-5007-41f7-866e-3a0f604d46fc">
2024-08-01 16:18:10 -07: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
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
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
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
Max Schmitt
44ce6096bb
feat(html-reporter): add Playwright logo as Favicon (#31908) 2024-07-30 12:02:06 +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
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
Dmitry Gozman
d87cb7a303
feat(trace viewer): allow hiding route actions (#31726)
Adds a new settings tab above the actions list.

<img width="307" alt="settings tab"
src="https://github.com/user-attachments/assets/792212b7-e2fd-4a5c-8878-654e2e060505">

Toggling the "Show route actions" checkbox hides all route calls:
`continue`, `fulfill`, `fallback`, `abort` and `fetch`.

References #30970.
2024-07-22 11:34:34 -07:00
Max Schmitt
6dbc7b54e8
feat(ui-mode): highlight console message in timeline on hover (#31756) 2024-07-18 16:39:40 +02:00
Yury Semikhatsky
9a11be3305
chore(trace-viewer): grid view z-index, source column in resource details (#31094)
New look for multiple contexts:

<img width="585" alt="image"
src="https://github.com/microsoft/playwright/assets/9798949/02dc5f54-0946-40a9-9459-942c4362a32e">
2024-05-30 14:45:33 -07:00
Yury Semikhatsky
4c020c9861
chore(trace-viewer): preserve column widths after showing resource details (#31093)
* Column widths are now stored on in the NetworkPanel context, this way
they are not reset after selecting an empty range (and changing position
of the NetworkGridView in the component tree).
* Column widths values are now preserved if column set changes (e.g.
selecting entries from a single context and then from multiple
contexts).
2024-05-30 12:21:32 -07:00
Yury Semikhatsky
dcaded5255
chore(trace-viewer): format negative duration as - (#30840) 2024-05-17 09:32:57 -07:00