Commit Graph

2977 Commits

Author SHA1 Message Date
Dmitry Gozman e5433d0576
chore(docs): validate params/options links (#32820)
Also supports fully-qualified links like this:
```
[`option: BrowserType.launch.headless`]
```

References https://github.com/microsoft/playwright/issues/32590.
2024-09-26 01:08:16 -07:00
Max Schmitt b01dd55697
docs: use node-version: lts/* in GHA examples (#32789) 2024-09-24 12:23:47 +02:00
Max Schmitt 26dc8955d3
docs: explain glob patterns (#32728) 2024-09-23 22:22:57 +02:00
Mathias Leppich 281eff1209
docs(trial): note that modifier keys are pressed regardless of trial option (#32734) 2024-09-23 22:17:47 +02:00
Dmitry Gozman cdcaa7fab6
feat: routeWebSocket (#32675)
This introduces `WebSocketRoute` class and
`page/context.routeWebSocket()` methods.
2024-09-20 03:20:06 -07:00
Pavel Feldman 2f4acbb001
chore: use contentFrame() as a canonical locator representation (#32697) 2024-09-18 20:15:01 -07: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
오소현 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
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
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
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
Matthew Jee f2a974b045
feat(api): add method to force garbage collection (#32383) 2024-09-13 23:09:36 +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
Max Schmitt 491678ada6
docs: release note fixes for 1.47 (#32589) 2024-09-12 12:51:30 +02:00
Dmitry Gozman 1981989aef
docs: mention variability of media codecs between platforms (#32569)
References #32558.
2024-09-11 13:35:17 -07:00
Yury Semikhatsky a4bd551597
docs: TestInfo.titlePath does not include project (#32548) 2024-09-10 16:52:12 -07:00
Pavel Feldman 6d5889a52c
chore: revert the matcherResult in API (#32524) 2024-09-09 16:44:32 -07:00
Max Schmitt 728083b435
chore: allow query as string in Python/.NET (#32516)
https://github.com/microsoft/playwright-python/issues/2497
2024-09-09 15:49:59 +02:00
Sander 4a53973fd0
docs(ct): vue + jsx and general improvements (#32212)
partial fix for:
https://github.com/microsoft/playwright/issues/31927#issuecomment-2267065378

---------

Signed-off-by: Sander <info@mesander.com>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-09-09 05:09:18 -07:00
Max Schmitt a8f67a42b8
docs(dotnet): fix wrong snippets (#32484)
Fixes https://github.com/microsoft/playwright-dotnet/issues/2994
2024-09-06 11:27:35 +02:00
Simon Knott 5d4a65b318
docs: update release notes for 1.47 to our changes from yesterday (#32482)
I'll also cherry-pick this into the release branch and update
playwright.dev.
2024-09-06 10:28:17 +02:00
Pavel Feldman a52eb0c9a0
chore: expose matcherResult on TestError (#32455) 2024-09-05 21:36:51 -07:00
Yury Semikhatsky 1989589edd
docs: update browsers version in release notes (#32475) 2024-09-05 13:59:54 -07:00
Simon Knott 0a49c05e2d
chore(test runner): document that --only-changed on CI needs history (#32461)
Closes https://github.com/microsoft/playwright/issues/32452

`--only-changed=$GITHUB_BASE_REF` needs the base ref available locally
to work properly. `fetch-depth: 0` does that, see
https://github.com/actions/checkout?tab=readme-ov-file#fetch-all-history-for-all-tags-and-branches.

---------

Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-09-05 12:13:09 +02:00
Simon Knott a8139b5d77
docs: add release notes for 1.47 (#32463) 2024-09-05 11:57:14 +02:00
Pavel Feldman 446ed72878
docs: revert typo (#32433) 2024-09-03 10:18:40 -07:00
Yury Semikhatsky b75483bbb4
Revert "docs: deprecate: Request.serviceWorker() (#32136)" (#32432)
This reverts commit b7ed4d7b9e.
2024-09-03 10:18:20 -07:00
Przemyslaw Malolepszy b8c4a477ff
chore(docs): fix APIResponse.headersArray() desc (#32375) 2024-09-03 09:01:01 +02:00
Kevin Jagodic 787da9b5a5
docs(mock): fix routeFromHAR() arguments for Java (#32409) 2024-09-03 08:57:57 +02:00
Simon Knott 0a40862bc8
chore(docs): fix typo (#32372) 2024-08-29 14:16:29 -07:00
Yury Semikhatsky 896190edbb
Revert feat(addInitScript): support cjs modules (#32364)
Reverting https://github.com/microsoft/playwright/pull/32282 and
https://github.com/microsoft/playwright/pull/32240.
2024-08-28 15:39:48 -07:00
Yury Semikhatsky d8137f228f
docs: update snippets to fix typescript errors (#32363)
Reference: https://github.com/microsoft/playwright/issues/9468
2024-08-28 14:24:01 -07:00
Yury Semikhatsky acd2a4ddad
docs: global beforeEach/beforeAll hooks (#32348)
Fixes https://github.com/microsoft/playwright/issues/9468
2024-08-27 17:04:53 -07:00
Yury Semikhatsky 888a5b53e7
docs: avoid confustion with incognito mode (#32327)
Fixes https://github.com/microsoft/playwright/issues/32321
2024-08-26 11:02:41 -07:00
Pavel Feldman 4340d153df
chore: deprecate locator.frameLocator() (#32306) 2024-08-26 10:28:54 -07:00
Pavel Feldman 3d9342aa77
chore: update removeAllListeners docs (#32305)
Closes https://github.com/microsoft/playwright/issues/31474
2024-08-26 09:29:02 -07:00
Dmitry Gozman abe6c04a54
chore: remove `noWaitAfter` from selectOption (#32283)
This follows removing this option from other methods in v1.46. The two
methods still supporting `noWaitAfter` are `click` and `press`.
2024-08-23 14:50:43 -07:00
Max Schmitt 787f20c920
chore: fix doclint (#32294) 2024-08-23 16:26:39 +02:00
Max Schmitt 1b220c5289
chore: remove Chromium Windows proxy hacks (#31724)
Fixes https://github.com/microsoft/playwright/issues/17252
2024-08-23 15:17:00 +02:00
Dmitry Gozman 3a75f23ea1
fix(addInitScript): require non-undefined arg to trigger commonjs module (#32282) 2024-08-23 02:48:56 -07:00
Dmitry Gozman dc4a8e48eb
docs(fixtures): explain an option array value edge case (#32261)
Closes #32033.
2024-08-22 05:47:19 -07:00
Dmitry Gozman d5a7495041
feat(addInitScript): support cjs modules when passing both `path` and `arg` (#32240)
This works with scripts bundled by:
- `esbuild entrypoint.ts --bundle --format=cjs --outfile=injected.js`
- webpack with a typical config
  ```js
  module.exports = {
    entry: { 'injected': './entrypoint.js', },
    output: {
      path: require('path').resolve(__dirname),
      filename: '[name].js',
      libraryTarget: 'commonjs2',
    },
  };
  ```
2024-08-21 09:46:38 -07:00
Guillaume M 837e2a883b
docs(browsers): fix typo (#32250) 2024-08-21 17:35:47 +02:00
Max Schmitt 6512bccffd
docs(best-practises): add note about tsc (#32245) 2024-08-21 11:37:53 +02:00
Dmitry Gozman b66cb6caaa
docs(evaluate): improve the guide (#32222) 2024-08-21 01:31:41 -07:00
Simon Knott 244761a3a2
chore(docs): Rework CI docs (#31988)
This PR moves around some of our CI docs. It moves the GitHub actions
docs from `ci-intro.md` to `ci.md`, reduces `ci-intro.md` to be an
introduction, adds a mention of Sharding to the best practices, and adds
a section on `--only-changed` called "Fail-Fast". Each of those changes
is a separate commit, to make this a little easier to review. If we find
any of those to commits to be contentious, i'll pull them out into
individual PRs.

While rolling this to playwright.dev, we'll also make the following
changes to its sidebar:
- move the `ci.md` document from the "Integrations" section to the
"Playwright Test" section
- make "Best Practices" the last item of the "Getting Started" section

---------

Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Yury Semikhatsky <yurys@chromium.org>
2024-08-20 09:03:02 +02:00
Max Schmitt 010778f6c5
feat(client-certificates): allow passing certificates from memory (#32210) 2024-08-19 09:24:32 +02:00