2332 Commits

Author SHA1 Message Date
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
Debbie O'Brien
f927495791
docs: release video and trace viewer video (#32164) 2024-08-14 23:20:19 +02:00
Bryant Ung
3280ec5ee3
doc(release notes): Fix 1.46 release notes typos (#32145) 2024-08-13 15:24:47 -07:00
Kuba Janik
0588834307
feat: allow URLSearchParams and string as params in APIRequestContext (follow-up) (#32143)
Follow-up to https://github.com/microsoft/playwright/pull/32120

I made some changes suggested by @yury-s in the previous PR that make a
lot of sense:
- added an example to the documentation
- improved tests
  - check params on the client and server end
  - reverted to non-English characters being used as params
2024-08-13 10:39:56 -07:00
Max Schmitt
b7ed4d7b9e
docs: deprecate: Request.serviceWorker() (#32136) 2024-08-13 15:59:30 +02:00
Kuba Janik
308381eeae
feat: allow URLSearchParams and string as params in APIRequestContext (#32120) 2024-08-12 14:22:03 -07:00
Yury Semikhatsky
2ae196f708
fix(docs): API types do not extend EventEmitter (#32124)
Fixes https://github.com/microsoft/playwright/issues/32097
2024-08-12 11:22:48 -07:00
Max Schmitt
cae779b74f
docs: recommend Ubuntu 24.04 in Docker images (#31435) 2024-08-12 16:39:56 +02:00
Max Schmitt
98a6e14e9d
docs: remove redundant TOC usages (#32096) 2024-08-09 12:44:01 +02:00
Yury Semikhatsky
7f60f284c6
docs(auth): use abs path, difference between storage locations (#32037)
Reference: https://github.com/microsoft/playwright/issues/31987
2024-08-06 11:36:49 -07:00
Yury Semikhatsky
43e852334b
docs: route.fallback() vs. route.continue() (#32035)
Fixes https://github.com/microsoft/playwright/issues/31983
2024-08-06 11:35:53 -07:00
Dmitry Gozman
a54ed48b42
feat(test runner): --tsconfig cli option (#31932)
Introduce `--tsconfig` to specify a single config to be used for all
imported files, instead of looking up tsconfig for each file separately.

Fixes #12829.
2024-08-06 06:55:15 -07:00
Meir Blachman
5a015b0d6e
docs(release-notes): fix typo in .NET release notes (#32015) 2024-08-06 07:19:55 +02:00
Pavel Feldman
3c87f217df
feat(events): allow waiting for removeAllListeners (#31941) 2024-08-05 21:14:35 -07:00
Yury Semikhatsky
193013c9ee
docs(har): default update mode is minimal (#32016)
Update the documentation to match actual behavior.

The actual behavior today:
* Default mode is `full` when `recordHar` is passed to
`browser.newContext`
* Default mode is `minimal` when calling `context.routeFromHAR` and
`page.routeFromHAR`

Reference https://github.com/microsoft/playwright/issues/31983
2024-08-05 11:29:43 -07:00
Dmitry Gozman
32ee09dbe6
docs: release notes for 1.46 update (#32010) 2024-08-05 05:35:46 -07:00
Max Schmitt
d0c840f639
fix(clock): mock time in Event.prototype.timeStamp (#31986)
Ideally we generate the timestamp when the Event gets created. This
patch adds a best-effort logic, since we can't override the constructor
of natively created events, e.g. `MouseEvent`.

Fixes https://github.com/microsoft/playwright/issues/31924
2024-08-02 15:27:54 +02:00
Sander
c9a12e4ca1
docs(ct): fix component.update example for vue and svelte (#31889) 2024-07-31 13:40:19 +02:00
Max Schmitt
55187207e4
chore: various roll fixes for .NET (#31914) 2024-07-30 19:09:20 +02:00
Max Schmitt
ac0a3fb275
docs(best-practises): make trace icon location more clear (#31909) 2024-07-30 11:19:07 +02:00
Max Schmitt
f45cf65921
chore: add maxRetries to APIRequestContext.delete (#31893) 2024-07-29 14:39:30 +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
b214941a01
chore: make it more clear that --only-changed is per file (#31874) 2024-07-26 12:41:33 +02:00
Max Schmitt
7570c25b3d
chore: remove glob from client-certificate matching (#31846)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-07-24 19:13:03 +02:00
Elio Struyf
1e94abb683
docs: added MS Teams and mail reporter (#31579) 2024-07-24 11:55:45 +02:00
Yury Semikhatsky
13b5510d57
docs(webkit): supprot for non-core features may differ between OSes (#31831)
Fixes: https://github.com/microsoft/playwright/issues/31017
2024-07-23 17:35:02 -07:00
Max Schmitt
c4862c022c
chore: client certificates api review (#31826) 2024-07-23 22:56:36 +02:00
Yury Semikhatsky
383e4b3c73
Revert "feat: introduce touchscreen.touch() for dispatching raw touch… (#31823)
… events (#31457)"

This reverts commit a3e31fd2c4146e67a63ff4d3dc4f655533adcbde.
2024-07-23 10:29:37 -07:00
Simon Knott
f23d02a211
feat(test runner): --only-changed option (#31727)
Introduces an `--only-changed [base ref]` option.

`playwright test --only-changed` filters the test run to only run test
suites that have uncommitted changes.
`playwright test --only-changed=foo` runs only tests that were changed
since commit `foo`.

In pull request CI, this can be used to run changed tests first and fail
fast: `--only-changed=$GITHUB_BASE_REF`.
During local development, it can be used to quickly filter down to the
touched set of tests suites.
In some rare usecases, this can also help to cut down on CI usage for
pull requests. Tread with caution though.

File dependencies are taken into account to ensure that if you touched a
utility file, all relevant tests are still executed.

Closes https://github.com/microsoft/playwright/issues/15075
2024-07-23 18:04:17 +02:00
Simon Knott
2cc4e14756
fix(core): update maxRetries docs (#31810) 2024-07-23 08:27:27 -07:00
Dmitry Gozman
e86c8af599
chore: rename route fixture in ct (#31817)
Addresses review feedback.
2024-07-23 07:43:28 -07:00
Yury Semikhatsky
e269092ef9
Revert "fix: add 'window-management' to chromium browser (#31687)" (#31801)
This reverts commit 0aa2f06f68959e2515f62ea9bb570cf1815230b2.

Discussed the new permission in the API review and decided not to
proceed with the feature as we are not ready to commit to supporting it
yet:
* the API is Chromium specific
* the API is still experimental
* there is no clarity to what extend the screen manipulation APIs will
work in old headless which is our main test environment

We'll keep an eye on the demand for the feature and may get back to
implementing it in the future.

Reference: https://github.com/microsoft/playwright/issues/27198
2024-07-22 11:27:12 -07:00
Josh Soref
7abbbd0c84
docs: spelling (#31779)
Fixes misspellings identified by the [check-spelling
action](https://github.com/marketplace/actions/check-spelling).

The misspellings have been reported at
https://github.com/jsoref/playwright/actions/runs/10015023629#summary-27685777352

The action will report that the changes in this PR would make it happy:
https://github.com/jsoref/playwright/actions/runs/10015023971#summary-27685778305

---

I understand that the commit messages will need to be reworded to match
house style. For the time being, these are merely noting the changes
they contain so that when I rebase or need to drop things, I can. --
I've already rebased once as someone fixed one of the items that my
draft work was going to fix.

---

## Testing
* The tests _mostly_ passed when I managed to trigger them, but there
were a handful of things that I didn't quite understand
* There are a large number of warnings relating to a bad interaction
between any workflow that uses this local action
b535139b32/.github/actions/run-test/action.yml (L74-L80)
and the action it calls -- I've opened Azure/login#474 asking them to
refactor their action so that it doesn't cause so much noise while
running this repository's tests
* I'm vaguely curious as to why this repository has a `branch`
constraint for its `pull_request` events in its workflows -- that
constraint gave me a number of additional headaches while trying to
prepare this branch for this PR.

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2024-07-22 06:45:22 -07:00
Dmitry Gozman
6491e5b415
chore: deprecate/remove noWaitAfter from some actions (#31739)
The following actions keep `noWaitAfter` option: `click`, `selectOption`
and `press`.

All other actions that used to have `noWaitAfter` now behave like it was
set to true, not waiting for follow-up navigations. In the docs, this
option is marked as completely ignored.

A small logic change was made to compensate for this behavior: when
waiting for the `hitTargetInterceptor`, we now race it against
navigations to avoid stalling when navigation stalls. Previously,
waiting for the interceptor was disabled when `noWaitAfter` was passed,
and since it's impossible to pass this option now, we mitigate by never
stalling instead.

Fixes #31469.
2024-07-18 00:19:08 -07:00
Max Schmitt
ed6abf86c7
fix(expect): throw unsupported error when using this.equals() in expect (#31723) 2024-07-17 13:22:00 +02:00
Max Schmitt
f66f5b800e
docs: fix broken anchor links (#31707) 2024-07-16 16:11:20 +02:00
damar Zaky
96e0a96ac1
docs: fix grammar and typos in various files (#31678)
- docs/src/best-practices-js.md
- docs/src/codegen.md
- docs/src/debug.md
- docs/src/events.md
- docs/src/library-js.md
- docs/src/locators.md
- docs/src/other-locators.md
- docs/src/test-components-js.md
- docs/src/trace-viewer.md

---------

Signed-off-by: damar Zaky <damzaky@gmail.com>
2024-07-16 06:15:25 -07:00
Ismael Onilearan
0aa2f06f68
fix: add 'window-management' to chromium browser (#31687) 2024-07-15 14:34:57 -07:00
Jorge Caridad
fb59e6372b
docs: fix typos in various documentation files (#31656) 2024-07-12 10:24:52 -07:00
Max Schmitt
9569cb5c1e
feat: support client certificates (#31529)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-07-12 11:42:24 +02:00
Yury Semikhatsky
01e2c8ab06
docs: document numeric values of PLAYWRIGHT_FORCE_TTY (#31653)
Fixes https://github.com/microsoft/playwright/issues/31647
2024-07-11 14:02:47 -07:00
Daniel Flores
b13bd66d20
docs: add missing pytest-playwright installation command (#31645) 2024-07-11 21:27:54 +02:00