Граф коммитов

13245 Коммитов

Автор SHA1 Сообщение Дата
Dmitry Gozman f9d9ad25de
feat(locator handler): perform checkpoit during `locator.waitFor` (#32683)
Fixes #32255.
2024-09-18 09:34:06 -07:00
Max Schmitt d4eecafa8a
test: listen always on 127.0.0.1 for client certificate tests (#32677) 2024-09-18 17:09:08 +02:00
Max Schmitt 523ec83cad
chore: move Location type from testReporter.d.ts to test.d.ts (#32687) 2024-09-18 16:57:11 +02:00
Playwright Service ddd43d0f20
feat(webkit): roll to r2078 (#32685)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-18 15:50:43 +02:00
Max Schmitt ec3db20743
test: fix toolbar hydration test under frozen suite (#32684) 2024-09-18 15:35:33 +02:00
Simon Knott 825df6c074
feat(har): record `serverIPAddress` for API requests (#32660)
Discovered working on
https://github.com/microsoft/playwright/pull/32658. We're recording the
remote server address for browser requests, but not for API requests.
This PR adds that for API requests.
2024-09-18 14:51:42 +02:00
Playwright Service 7d4aa0aa8e
feat(chromium-tip-of-tree): roll to r1260 (#32651)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-18 14:37:19 +02:00
Max Schmitt 4c31a8289f
feat(trace-viewer): add network requests 'copy as cURL' button (#32627) 2024-09-18 14:35:11 +02:00
Max Schmitt 9fc195bff5
test: update cookie expectations for macOS 15 (#32674) 2024-09-18 11:08:17 +02:00
Simon Knott 4460c98710
fix(har tracing): record `response.bodySize` for API requests (#32656)
A small drive-by that came out of working on
https://github.com/microsoft/playwright/issues/32653.
2024-09-18 08:21:10 +02:00
Simon Knott 8a97050822
feat(har): record `securityDetails` for API Requests (#32664)
While working on https://github.com/microsoft/playwright/pull/32658 I
discovered that we're recording `securityDetails` for browser requests,
but not for API requests. This PR fixes that.
2024-09-18 08:18:47 +02:00
Simon Knott 443f72dcbe
feat(watch): hide show-report prompt (#32666)
Closes https://github.com/microsoft/playwright/issues/32665
2024-09-18 08:17:13 +02:00
Pavel Feldman 355c88f48f
chore: iterate towards recording into trace (#32646) 2024-09-17 18:26:44 -07:00
Yury Semikhatsky 623b2e6bc8
chore: bump vite dependency 5.0.13->5.4.6 (#32672)
Fixes the following:

```
npm audit report

vite  5.0.0 - 5.2.13
Severity: moderate
Vite DOM Clobbering gadget found in vite bundled scripts that leads to XSS - https://github.com/advisories/GHSA-64vr-g452-qvp3
```
2024-09-17 17:01:38 -07:00
Yury Semikhatsky 4c4d74ca5b
chore: page.screenshot() in bidi (#32671)
The results are copied from the existing chromium expectations.
2024-09-17 16:51:56 -07:00
Yury Semikhatsky 8b84b20dd0
chore: back-forward in bidi (#32670) 2024-09-17 16:02:13 -07:00
Yury Semikhatsky 375a1c4982
chore: exposeBinding/exposeFunction in bidi (#32669) 2024-09-17 15:37:42 -07:00
Yury Semikhatsky ad70e7a783
fix(trace-viewer): time delta between local and remote actions (#32661) 2024-09-17 11:14:15 -07:00
Simon Knott f1390cc269
chore(har recorder): ensure we respect minimal mode (#32658)
Closes https://github.com/microsoft/playwright/issues/32653.

Adds some test coverage to ensure we respect minimal mode for API
Requests in HAR tracing.

| omit setting | result |
| - | - |
| `omitCookies` |  added test for it |
| `omitTiming` | already covered |
| `omitSecurityDetails` | not recorded yet |
| `omitServerIP` | we don't record it yet, so no action here. gonna open
a separate issue |
| `omitPages` | not relevant to API requests |
| `omitSizes` | added test for it |
| `omitScripts` | not relevant to API requests |
2024-09-17 19:59:44 +02:00
오소현 8761dafc73
feat(test runner): allow to pass arbitrary location to test.step (#32504)
Fixes https://github.com/microsoft/playwright/issues/30160

### Description:
This pull request introduces the ability to specify custom locations for
test steps in Playwright. By enabling the provision of arbitrary
locations to the test.step method, it resolves the limitation where
helper methods obfuscate the original call site, providing more accurate
and meaningful location data in test reports.

### Motivation:
To enhance the utility and clarity of test reports in Playwright.
Specifically, it addresses the need to trace test steps back to their
precise location in the code, which is especially important when steps
are abstracted in helper functions. This feature is crucial for
maintaining accurate documentation and facilitating debugging processes.

### Changes:
Added functionality to pass a custom location object to test.step.

### Expected Outcome:
This PR is expected to significantly improve the precision and
usefulness of diagnostic data in test reports by allowing specific
locations within helper functions to be accurately documented. It
facilitates better tracking of test executions and simplifies the
debugging process, making it easier for developers to understand and
address issues within complex tests.

### References:
Closes https://github.com/microsoft/playwright/issues/30160 -
"[Feature]: allow to pass arbitrary location to test.step"

**Code Check**
I conducted tests on this new feature by integrating it into some
existing test codes, and it worked well. I will attach the code used for
testing and a screenshot showing the successful outcome.

<details>
<summary>toggle dropdown</summary>
<div markdown="1">

```
import type { Location } from '../../../packages/playwright/types/testReporter'
...
test('should respect the back button', async ({ page }) => {
    await page.locator('.todo-list li .toggle').nth(1).check();
    await checkNumberOfCompletedTodosInLocalStorage(page, 1);
...
    await test.step('Showing active items', async () => {
      await page.getByRole('link', { name: 'Active' }).click();
    }, {location});
```

<img width="1109" alt="image"
src="https://github.com/user-attachments/assets/359feafa-0949-4c71-9426-46debef21bdd">
</div>
</details>
2024-09-17 08:11:21 -07:00
Max Schmitt 507e515cb2
chore: remove unused @babel/parser (#32654) 2024-09-17 16:14:24 +02:00
Simon Knott 751b939d3a
feat(fetch): record timings (#32613)
Related to https://github.com/microsoft/playwright/issues/19621

Adds some instrumentation to collect timings for `APIRequestContext`
requests and adds them to the HAR trace. Doesn't yet expose them via an
API, but makes our `Duration` field in the trace viewer show a nice
duration:

<img width="1392" alt="Screenshot 2024-09-14 at 11 46 04"
src="https://github.com/user-attachments/assets/8020382d-9494-4634-9cfd-22b6f4a1d770">


I'm gonna add it to our API in a separate PR.

---------

Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-09-17 16:11:21 +02:00
Max Schmitt c216c25a1d
feat(html-reporter): add file name copy button (#32652) 2024-09-17 15:54:22 +02:00
Simon Knott f6219e6e79
Revert "feat(tracing): add .pwtrace to trace file extension" (#32648)
Reverts microsoft/playwright#32581
Relates
https://github.com/microsoft/playwright/issues/32226#issuecomment-2351164727
2024-09-17 15:32:30 +02:00
Ana Margarida Silva b23edf5137
fix(docs): remove todo in ci intro docs (#32643) 2024-09-17 10:36:43 +02:00
Simon Knott ec2ae1ed2d
feat(watch mode): buffer mode (#32631)
Closes https://github.com/microsoft/playwright/issues/32578.

Adds a buffer mode that can be toggled by pressing <kbd>b</kbd>. When
engaged, changed test files are collected and shown on screen. The test
run is then kicked off by pressing <kbd>Enter</kbd>.

This changes the signal to start a test run from <kbd>Cmd+s</kbd> to a
<kbd>Enter</kbd> press in the test terminal. It should help users with
auto-save and make it easier to run on long-running tests. It feels very
similar to running `npx playwright test`, but without having to write a
filter.



https://github.com/user-attachments/assets/71e16139-9427-4e90-b523-8d218f09ed9d
2024-09-17 08:45:44 +02:00
Simon Knott b0f15b320f
fix(recorder): reattach toolbar if it was unmounted by framework hydration (#32637)
Closes https://github.com/microsoft/playwright/issues/32632. A side
effect of Remix's hydration implementation is that it throws away the
entire DOM. This is broadly discussed in
https://github.com/remix-run/remix/issues/4822 - there might be a fix in
coming React versions, but who knows.
Besides breaking browser extensions, this also deletes our toolbar!
This PR fixes it by periodically checking in on `x-pw-glass`, and
remounting it if it was unmounted. Hacky but effective!
2024-09-17 08:37:49 +02:00
Pavel Feldman 47713e8a66
chore: make recorder tests pass in frozen mode (#32645) 2024-09-16 22:47:54 -07:00
Pavel Feldman 3bff7b6ab1
chore: preserve selected trace action in live trace (#32630) 2024-09-16 17:33:52 -07:00
Yury Semikhatsky 2a347b5494
chore: support launchPersistentContext with bidi (#32641) 2024-09-16 17:31:26 -07:00
Pavel Feldman 6dbde62a6b
chore: simplify signal handling while recording (#32624) 2024-09-16 14:39:36 -07:00
Pavel Feldman 92c6408b94
fix(recorder): address the react race condition (#32628) 2024-09-16 13:47:13 -07:00
Dmitry Gozman ce06a81aa6
feat: make `npx playwright clear-cache` public (#32638) 2024-09-16 12:54:20 -07:00
Max Schmitt 21d162c945
feat(client-certificates): add support for proxies (#32611)
Fixes https://github.com/microsoft/playwright/issues/32370
2024-09-16 17:57:33 +02:00
Max Schmitt b335b00a86
docs: add reference to locator strictness if or resolves to multiple elements (#32633) 2024-09-16 17:30:14 +02:00
Playwright Service feac957475
feat(webkit): roll to r2077 (#32636)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-16 17:18:01 +02:00
Anthony Roberts 71c43693ac
feat(reporter): add copy button for annotations (#31790)
Adds a copy-to-clipboard button for each annotation so that text can be
copied easily.
This re-uses the existing `CopyToClipboard` component and adds a `small`
variant that can be used inline. The icon size and colour have been
chosen to avoid being overwhelming when used inline.

Related to #30141 
I opted not to introduce the hover behaviour from #30749 as it's less
discoverable, but can understand why that might be favourable. Certainly
open to suggestions 😄

<img width="379" alt="Screenshot 2024-07-22 at 3 23 53 PM"
src="https://github.com/user-attachments/assets/3b9998cf-2e8d-40c9-9c8a-64eab3a9ed2e">
2024-09-16 07:57:11 -07:00
Max Schmitt 762e954599
devops: update GitHub Actions (#32634)
Fixes: 
<img width="2205" alt="image"
src="https://github.com/user-attachments/assets/0cd09784-6f0b-4331-9e08-315cf8614031">

For future reference: `pip install github-actions-cli &&
github-actions-cli update-actions --update`
2024-09-16 15:43:42 +02:00
Dmitry Gozman 268357238a
fix(expect): respect custom message in expect.poll (#32603)
Fixes #32582.
2024-09-16 00:10:06 -07:00
Max Schmitt c24ad36f86
docs(docker): fix Docker container permissions (#32621) 2024-09-16 07:39:36 +02:00
Simon Knott aeb4d182f7
feat(tracing): add .pwtrace to trace file extension (#32581)
Closes https://github.com/microsoft/playwright/issues/32226

I've updated every mention of `.trace.zip` except for the release notes.
2024-09-14 10:17:07 +02:00
Yury Semikhatsky 34876e9291
chore: cookies in intercepted bidi requests (#32623) 2024-09-13 18:29:35 -07:00
Matthew Jee f2a974b045
feat(api): add method to force garbage collection (#32383) 2024-09-13 23:09:36 +02:00
Playwright Service 5b28d2a84c
feat(firefox): roll to r1464 (#32614)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-13 18:12:43 +02:00
Playwright Service b82100adf5
feat(firefox-beta): roll to r1464 (#32615)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-13 18:12:35 +02:00
Max Schmitt 79cba7d704
chore: introduce option overrides on context/browser (#32606) 2024-09-13 17:34:34 +02:00
Simon Knott 9bb1c86f93
feat(test runner): don't run tests on --watch start (#32583)
Closes https://github.com/microsoft/playwright/issues/32580.
2024-09-13 17:24:38 +02:00
Max Schmitt 9e99c86f00
chore: unhide merge-reports command (#32605) 2024-09-13 16:13:23 +02:00
Playwright Service e3370c9eb0
feat(webkit): roll to r2075 (#32610)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-13 15:13:11 +02:00
Simon Knott 48c7fb6b06
feat(library): accept `FormData` in `fetch` (#32602)
Closes https://github.com/microsoft/playwright/issues/26520 by accepting
`FormData`, which became stable in Node.js in v21.
2024-09-13 13:21:02 +02:00