Commit Graph

3326 Commits

Author SHA1 Message Date
Pavel Feldman
ff3d3ae8f2
fix(ui): print config and global setup errors (#30531)
Fixes: https://github.com/microsoft/playwright/issues/30513
2024-04-24 18:54:48 -07:00
Dmitry Gozman
59689c9c97
feat(addLocatorHandler): various improvements (#30494)
- Automatically waiting for the overlay locator to be hidden, with
`allowStayingVisible` opt-out.
- `times: 1` option.
- `removeLocatorHandler(locator, handler)` method.
- Passing `locator` as first argument to `handler`.

Fixes #30471. Fixes #30424. Fixes #29779.
2024-04-24 15:19:12 -07:00
Yury Semikhatsky
f1f3929a67
chore: get rid of ConfigInWorker, use FullConfig instead (#30517)
Addressing API review feedback.
2024-04-24 14:14:05 -07:00
Dmitry Gozman
6fecf52016
test: adjust headers expectations for firefox-beta (#30520)
There is a new experimental feature enabled in firefox-beta that sends a
"Priority" header.
2024-04-24 14:05:39 -07:00
Pavel Feldman
e91d372544
fix(ct): allow importing components from node_modules (#30493)
Fixes https://github.com/microsoft/playwright/issues/29854
2024-04-24 12:32:28 -07:00
Dmitry Gozman
8fc7723f22
fix(types): allow any return type from event handlers (#30492)
Closes #29353.
2024-04-24 09:25:43 -07:00
Yury Semikhatsky
230a8437d3
feat(fetch): support FormData as multipart parameter (#30489)
Reference https://github.com/microsoft/playwright/issues/28070
2024-04-23 17:05:27 -07:00
Yury Semikhatsky
73c12f1f77
fix: increase global timeout for a test (#30491)
1s is not enought on CI to start running the tests sometimes.
2024-04-23 16:10:30 -07:00
Pavel Feldman
4514b7e3ed
chore: use original test ids in html report (#30486)
Fixes https://github.com/microsoft/playwright/issues/30430
2024-04-23 14:28:27 -07:00
Dmitry Gozman
b52cd7e4dc
test: make sure skipped tests in serial mode are reported (#30484)
This is a regression test for #28321, in preparation for changing some
skipped/flaky test status logic.
2024-04-23 10:51:27 -07:00
Pavel Feldman
f5ca5241f3
feat(esm): support import attributes (#30482)
Fixes https://github.com/microsoft/playwright/issues/30473
2024-04-23 10:13:01 -07:00
Rui Figueira
c80b851422
fix(codegen): prevent csp directive violations (#30366) 2024-04-23 07:33:12 -07:00
Dmitry Gozman
18dcd6adff
test: make expectations for some reporter tests readable (#30470) 2024-04-22 18:29:26 -07:00
Dmitry Gozman
b0fbe058ae
feat: TestProject.ignoreSnapshots (#30466) 2024-04-22 16:16:38 -07:00
Dmitry Gozman
b9e5a934ee
test: make expectations readable for more step reporting tests (#30468) 2024-04-22 15:30:51 -07:00
Yury Semikhatsky
1d786c804d
chore: generate globalTimeout and maxFailures errors in runner (#30467)
Generate 'global timeout' and 'max failures' errors in the runner. Avoid
reading `config.globalTimeout` and `config.maxFailures` in the base
reporters.

Reference https://github.com/microsoft/playwright/issues/29768
2024-04-22 14:00:16 -07:00
Dmitry Gozman
4a275b8eca
feat: expect(locator).toHaveAccessibleDescription (#30463)
References #18332.
2024-04-22 12:33:30 -07:00
Dmitry Gozman
4046d154ae
test: unflake and enable some Firefox tests (#30461)
Fixes #30399.
2024-04-22 11:25:10 -07:00
Playwright Service
dd1a9f5e96
feat(chromium): roll to r1115 (#30449) 2024-04-20 18:42:22 +02:00
Max Schmitt
a932222662
fix(highlight): highlight Top Layer elements (#30001) 2024-04-20 08:51:16 +02:00
Dmitry Gozman
9b6627a063
feat(role): roll and pass WPT accname tests, calculate description (#30434)
There are new "non-manual" WPT accname tests that we now mostly pass,
which required a few tweeks in calculating role and name.

Also implemented accessible description computation, which is just a
small addition on top of accessible name, and passed respective wpt
tests.

References #18332.
2024-04-19 12:49:49 -07:00
Yury Semikhatsky
8c181f7e2b
fix: rebuild project tree from scratch when listing tests (#30407)
Instead of filtering tests assuming there are no two projects with same
name we always rebuild test tree from scratch and restore previos test
results in the list mode.

Fixes https://github.com/microsoft/playwright/issues/30396
2024-04-18 16:49:07 -07:00
Dmitry Gozman
eea1f9984f
feat: expect(locator).toHaveAccessibleName (#30420)
References #18332.
2024-04-18 12:28:55 -07:00
Andrey Lushnikov
bdf95186f0
test: add test for tab blurring in firefox (#30418)
References https://github.com/microsoft/playwright/issues/30399
2024-04-18 10:49:09 -07:00
Dmitry Gozman
103ec90751
fix(role): align presentation role conflict resolution with the spec (#30408)
See
https://www.w3.org/TR/wai-aria-1.2/#conflict_resolution_presentation_none

Fixes #26809.
2024-04-18 08:53:31 -07:00
Dmitry Gozman
984182bd53
fix(role): embedded control inside the target element (#30403)
According to the spec, such controls should use the native value as long
as they have "aria-label". The relevant spec section is 2D.

However, there is an open issue that claims this should always apply,
and all browsers and wpt test actually do that:
https://github.com/w3c/accname/issues/64.

Fixes #28848.
2024-04-17 12:25:08 -07:00
Dmitry Gozman
b72e3a3eba
fix(role): explicitly hidden aria-labelledby should be recursively traversed (#30402)
The accessible name computation spec has changed to explicitly mention
this case:

Step 2A. Hidden Not Referenced. If the current node is hidden and is:
- Not part of an aria-labelledby or aria-describedby traversal, where
the node directly referenced by that relation was hidden.
- Nor part of a native host language text alternative element (e.g.
label in HTML) or attribute traversal, where the root of that traversal
was hidden.

See https://w3c.github.io/accname/#computation-steps. Chromium, Firefox
and Safari all agree with the spec.

Fixes #29796.
2024-04-17 11:22:09 -07:00
Yury Semikhatsky
cda1c945af
test: web assertion inside expect.poll (#30391)
Reference https://github.com/microsoft/playwright/issues/30322
2024-04-16 17:37:25 -07:00
Yury Semikhatsky
3bdbe4284e
fix(steps): make expect.toPass and expect.poll step containers (#30389)
Fixes https://github.com/microsoft/playwright/issues/30322
2024-04-16 16:18:37 -07:00
Yury Semikhatsky
73fce8fb98
chore: replace Zones with AsyncLocalStorage (#30381)
Reference https://github.com/microsoft/playwright/issues/30322
2024-04-16 12:51:20 -07:00
Yury Semikhatsky
3cea17abb6
fix: shut down workers before reporter.onEnd (#30329) 2024-04-16 09:49:11 -07:00
Yury Semikhatsky
6ad48fb594
chore: make step test expectations readable (#30362)
Reference https://github.com/microsoft/playwright/issues/30322
2024-04-13 20:07:18 -07:00
Yury Semikhatsky
c4418875d3
chore: do skip failing test (#30361) 2024-04-12 15:47:13 -07:00
Yury Semikhatsky
dc1077c5a2
test: steps inside expect.toPass (#30359)
Reference https://github.com/microsoft/playwright/issues/30322
2024-04-12 14:51:10 -07:00
Max Schmitt
a467312731
fix(snapshotter): remove noscript when javaScriptEnabled is undefined (#30355) 2024-04-12 20:26:52 +02:00
Yury Semikhatsky
1ef85015f3
fix(merge): preserve static annotations on the tests that did not run (#30348)
Fixes https://github.com/microsoft/playwright/issues/30260
2024-04-11 16:17:57 -07:00
Max Schmitt
96053ed0b5
Revert "fix(reuse): reset Origin Private File System API (#29921)" (#30342)
This reverts commit 048d6669fd.

This change caused the crash for
https://github.com/microsoft/playwright/issues/30339#issuecomment-2049870789.
If we don't execute this code, it does not crash.

Reverting it for now until the Chromium fix lands in Beta/Stable.
2024-04-11 19:07:15 +02:00
Max Schmitt
bff9f30b6f
test: add test for 'should parse cookie with large Max-Age correctly' (#30323) 2024-04-10 22:13:01 +02:00
Max Schmitt
15b423106f
fix(ui-mode): do not loose run information after writing into testDir (#30312)
Partially reverts https://github.com/microsoft/playwright/pull/30008
that started to reset all test results upon listing tests, including the
test that did just run and triggered re-listing.

https://github.com/microsoft/playwright/issues/30300.
2024-04-10 19:01:51 +02:00
Max Schmitt
b2ded9fed1
fix(expect): throw better received error when no element was found (#29890)
Fixes https://github.com/microsoft/playwright/issues/29873
2024-04-10 10:01:19 +02:00
Sander
1a34c85886
chore(ct): bump vite to v5.2.8 (#30264) 2024-04-08 09:48:05 +02:00
Dmitry Gozman
a6827772a5
fix(esmLoader): unref MessagePort in the main thread (#30271)
This prevents the process from not exiting forever due to an open port.
2024-04-06 14:25:57 -07:00
Dmitry Gozman
e18a358bc6
test: check that ESM loader works without config with type:module (#30258) 2024-04-05 07:03:27 -07:00
Dmitry Gozman
5d810f1e07
chore: roll stable test runner to 1.43.0-beta-1712217576000 (#30250)
Co-authored-by: Yury Semikhatsky <yurys@chromium.org>
2024-04-04 11:26:03 -07:00
Dmitry Gozman
d5907f4b13
feat(junit): includeProjectInTestName option (#30233)
Fixes #30246.
2024-04-04 11:04:51 -07:00
Max Schmitt
18b51308ff
test(svelte): migrate svelte-navigator to custom minimal router (#30225)
Repro: `cd tests/components/ct-svelte && rm -rf node_modules
package-lock.json && npm i && npx playwright test --project=chromium`

Follow-up based on
https://github.com/microsoft/playwright/pull/28624#issuecomment-1858608101.

Svelte has no router by default, only SvelteKit - so lets remove the
package which is not maintained anymore and not recommended.
2024-04-04 16:01:08 +02:00
Max Schmitt
43745210a5
fix(trace-viewer): exit if given trace.zip does not exist (#30222) 2024-04-03 18:47:03 +02:00
Козынченко Вячеслав
e58a33a0ae
feat(expect) - add ignoreCase option for toHaveURL (#30192)
feat(expect): add ignoreCase option for toHaveURL

Fixes #30057
2024-04-02 16:20:46 -07:00
Yury Semikhatsky
81bcf2a53b
docs: document FullReporter API (#30186)
* FullConfig split into FullConfig and ConfigInWorker
* FullProject split into FullProject and ProjectInWorker
* Tests can only access {Config, Project}InWorker, while reporters can
only access Full{Config,Project}. This will allow in the future to
change the reporter API independently from the tests.
* Added documentation for the 4 classes.
2024-04-02 16:15:02 -07:00
Dmitry Gozman
6d56b453ff
fix(connect): include websocket close reason in the error message (#30203)
When websocket disconnects during `browserType.connect()` call, the
error looks like this now:

```
browserType.connect: Custom error message received over WebSocket
```

Previously, it was a generic error:
```
browserType.connect: Target page, context or browser has been closed
```
2024-04-01 21:05:33 -07:00
Peng Xiao
cc881fdb1f
fix: content editable retarget (#29792)
If `contenteditable` is wrapped into a button or `[role=button]`,
`element.fill` will incorrectly retarget the closest button element.

fix https://github.com/microsoft/playwright/issues/29813
2024-04-01 13:03:09 -07:00
Hansanto
a950a7b86b
feat: Support intervals arg for toPass (#30037)
Fixes #30040

# Context

In the `playwright.config` file, we can custom the default `timeout`
property for `expect.toPass` by the property:

```ts title='playwright.config.ts'
export default defineConfig({
  // ...
  expect: {
    toPass: {
      timeout: 60_000,
    },
  },
});
```

However, we can't customize the `intervals` option. So the default value
is always `[100, 250, 500, 1000]`.

# Goal

Add the possibility to customize the intervals option from the
`playwright.config` file.

```ts title='playwright.config.ts'
export default defineConfig({
  // ...
  expect: {
    toPass: {
      timeout: 60_000,
      intervals: [1000, 2000, 3000]
    },
  },
});
```
2024-03-29 10:17:29 -07:00
Yury Semikhatsky
3001c9ac73
fix: preserve test declaration order in html and merged report (#30159)
* Add `Suite.entries` that returns tests and suites in their declaration
order
* Exposed `Suite.type` and `TestCase.type` for discriminating between
different entry types.
* Blob report format is updated to store entries instead of separate
lists for suites and tests.
* Bumped blob format version to 2, added modernizer.

Fixes https://github.com/microsoft/playwright/issues/29984
2024-03-29 10:12:33 -07:00
Yury Semikhatsky
16318ea715
chore: remove unused botName from types (#30172) 2024-03-28 16:16:15 -07:00
Andrey Lushnikov
4781b3c3a8
fix(firefox): disable cache when request interception is enabled (#30113)
Fixes #30000
2024-03-28 10:25:37 -07:00
Yury Semikhatsky
021c5c108c
chore: revert support of duplicate form data fields in multipart post data (#30127)
We want to adopt FormData API for the requests.

This is a revert of 4b3c596874 and
a849ea9741

Reference https://github.com/microsoft/playwright/issues/28070
2024-03-26 12:36:35 -07:00
Dmitry Gozman
dd1eca2a9d
fix(trace viewer): show correct number of pages without screencast (#30124)
Exposed by the flaky "should open two trace files" test.
2024-03-26 10:25:12 -07:00
Pavel Feldman
2de8a6b002
chore: move filter params into the clearCookies (#30111) 2024-03-26 08:12:26 -07:00
Andrey Lushnikov
397244c026
test: add a test for disabled cache with context-wide request interception (#30072)
References #30000
2024-03-25 22:03:24 -07:00
Max Schmitt
599185dd07
feat(ui-mode): show native tags in test tree (#30092)
This brings up the question that we would show the tag name twice if its
a tag in a title. This would be aligned to how HTML report is doing it.

Fixes https://github.com/microsoft/playwright/issues/29927

---------

Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-03-26 01:06:22 +01:00
Dmitry Gozman
051afb9ce0
fix(test runner): update fixture teardown error message (#30109)
With the recent change that gave after hooks a separate timeout, fixture
teardown does not imply that "test finished successfully, but fixture
teardown was slow".
2024-03-25 17:04:03 -07:00
Max Schmitt
65d82797f1
fix(ct): ct ID clash on similar imports (#30108)
This restores the [best
effort](https://github.com/microsoft/playwright/pull/29407/files#diff-8dd3534dc5013c3779edeaded71324b0dd1c1807668f3c6d9e9a1aab1c20ae91L152)
logic if its a relativ path.

Fixes https://github.com/microsoft/playwright/issues/30085

---------

Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Pavel Feldman <pavel.feldman@gmail.com>
2024-03-25 23:50:45 +01:00
Yury Semikhatsky
a849ea9741
feat(fetch): multiple fields with the same name in post data (#30104)
Rerefence https://github.com/microsoft/playwright/issues/28070
2024-03-25 15:39:45 -07:00
Dmitry Gozman
911d8effb9
feat(test runner): do not mock tty in the worker process (#30107)
This was historically done to make `console.log()` have colors. However,
this makes any other code that checks `process.stdout.isTTY` incorrectly
assume real TTY support.

Node18 and Node20 now respect `FORCE_COLOR=1` in console, so our default
behavior of forcing colors in the worker process just works out of the
box. See https://github.com/nodejs/node/pull/48034.
2024-03-25 15:31:58 -07:00
Max Schmitt
253a2f9a9c
chore: address UI Mode keyboard shortcut feedback (#30088)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-03-25 19:48:20 +01:00
Max Schmitt
e69355a6e2
test: skip 'should fulfill with gzip and readback' on Electron and Android (#30103) 2024-03-25 19:35:44 +01:00
Dmitry Gozman
95d649b406
feat: address api review feedback for 1.43 (#30066)
- Update docs for `trace: retain-on-first-failure`.
- Update docs for `devtools` option.
- Rename `Locator.enterFrame()` to `Locator.contentFrame()`.
- Rename `FrameLocator.exitFrame()` to `FrameLocator.owner()`.
2024-03-25 07:42:13 -07:00
Dmitry Gozman
7a3c002944
fix(ct): allow importing json files (#30067)
While we are not fully resolving imports during compilation, do not
treat `json` as a non-importable asset.

Fixes #29926.
2024-03-25 07:41:54 -07:00
Pavel Feldman
1539cde034
chore: allow passing path to config to the test server (#30068) 2024-03-22 16:04:59 -07:00
Dmitry Gozman
c8e8d8f8bb
test: fulfilling with gzip should allow to read the body (#30065)
Fixes #29261.
2024-03-22 13:32:28 -07:00
Dmitry Gozman
c1400a3db5
Revert "feat(codegen): add button to generate toHaveScreenshot statement (#29996)" (#30064)
This reverts commit 1bb463163b. Decided to
wait for a better VRT story.

References #29250.
2024-03-22 13:26:22 -07:00
Yury Semikhatsky
a511731f55
fix(html): keep projects from different bots separate (#30051) 2024-03-22 10:02:00 -07:00
Dmitry Gozman
348d0c2bfa
test: can register service workers in an iframe (#30045)
References #29267.
2024-03-21 15:34:23 -07:00
Dmitry Gozman
ef57489cf9
test: iframe is covered by service workers (#30042)
References #29267.
2024-03-21 11:27:27 -07:00
Dmitry Gozman
3e73a6ce69
feat(test runner): show multiple errors, at most one per stage (#30024)
Previously, there was at most one "hard error", as opposite to multiple
"soft errors". This was done to preserve the historic behavior at the
time of introducing multiple `TestInfo.errors`.

With this change, every user callback that is executed `withRunnable()`
can throw an error and/or timeout, and both of these will end up in
`TestInfo.errors`.

Additionally, there is at most one "unhandled exception" error, to avoid
flooding the report with mass failures.

Drive-by: remove boolean arguments from `_failWithError()`.

Fixes #29876.
2024-03-20 21:01:30 -07:00
Yury Semikhatsky
69e90f38c7
fix(codegen): import re in python (#30026)
Fixes https://github.com/microsoft/playwright/issues/30019
2024-03-20 16:38:28 -07:00
Yury Semikhatsky
69f2ae1e4d
test: intercepted requests bypass disk cache (#30011)
Reference https://github.com/microsoft/playwright/issues/30000
2024-03-20 15:43:29 -07:00
Max Schmitt
dd0b6f7ec5
test: generate debug controller channel (#30018) 2024-03-20 16:56:29 +01:00
Max Schmitt
911fd204cf
devops: fix WebView2 tests (#30009)
Turns out we were using version 119.0.2151.58 before where the tests are
failing. After this change we are using 122.0.2365.92.

Fixes https://github.com/microsoft/playwright/issues/29695
Relates https://github.com/actions/runner-images/issues/9538
2024-03-19 23:18:20 +01:00
Pavel Feldman
0a22a86e2e
chore: prepare to reuse test server from ui mode (5) (#30005) 2024-03-19 14:08:21 -07:00
Dmitry Gozman
1bb463163b
feat(codegen): add button to generate toHaveScreenshot statement (#29996)
Fixes #29250.
2024-03-19 14:01:04 -07:00
Pavel Feldman
54aca430b0
chore: prepare to reuse test server from ui mode (4) (#29995) 2024-03-19 13:00:49 -07:00
jonghoonpark
b929c0d8f7
feat(ui-mode): add key shortcuts for playwright uI test runner (#29868) 2024-03-19 12:36:42 +01:00
Dmitry Gozman
be1af15d57
feat: always enable ESM loader with the new API (#29991)
It does not require a process restart anymore, so safe to enable.

Fixes #29747.
2024-03-18 21:54:25 -07:00
Dmitry Gozman
b41b802662
fix(test runner): avoid dependency tracking colliding between esm and cjs (#29994)
When collecting dependencies both from CJS loader and from ESM loader,
the latter would overwrite the dependencies set instead of appending.

Also make sure cts/cjs/mts/mjs are all supported equally.

References #29747.
2024-03-18 17:17:58 -07:00
Dmitry Gozman
70e6cdac57
feat: enterFrame/exitFrame (#29992)
This introduces `Locator.enterFrame()` and `FrameLocator.exitFrame()` to
convert between locator and frame locator.

Fixes #29336.
2024-03-18 13:42:08 -07:00
Max Schmitt
a6d1fb93de
fix(trace-viewer): encode attachment filenames as UTF-8 (#29993)
Fixes https://github.com/microsoft/playwright/issues/29967

Tested in Firefox, Chromium, and Safari. This now leads to "good
attachment names" in Chromium and Safari, for Firefox, it won't produce
attachments, it will open them inline, but this is not a regression, was
before like that already.

See here for the spec:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#filename_2

---------

Signed-off-by: Max Schmitt <max@schmitt.mx>
2024-03-18 21:26:45 +01:00
Yury Semikhatsky
35db70ea1d
chore: trim file names longer than 60 chars (was 100) (#29725)
Test-specific output dir and snapshot names are trimmed to 60 chars
instead of just 100. The snapshot names are still trimmed at 100 chars
for backwards compatibility.


Reference https://github.com/microsoft/playwright/issues/29719
2024-03-18 12:53:15 -07:00
Pavel Feldman
ef4438ee99
chore: prepare to reuse test server from ui mode (2) (#29966) 2024-03-18 09:59:02 -07:00
Pavel Feldman
6faadf5160
chore: prepare to reuse test server from ui mode (#29965) 2024-03-18 09:50:11 -07:00
Max Schmitt
048d6669fd
fix(reuse): reset Origin Private File System API (#29921)
Fixes https://github.com/microsoft/playwright/issues/29901

This clears the Origin Private File System API when using VSCode
extension.
2024-03-15 17:40:46 +01:00
Max Schmitt
5bc6ca6345
fix: allow disposing ElementHandles multiple times (#29953)
Fixes https://github.com/microsoft/playwright/issues/29945
2024-03-15 16:26:56 +01:00
Max Schmitt
7cbef691ae
fix: throw error if setInputFile does not exist (#29944)
Fixes https://github.com/microsoft/playwright/issues/29941
2024-03-14 20:27:33 +01:00
Max Schmitt
93dc89fa1f
test: add file upload test case with popup handling (#29937)
https://github.com/microsoft/playwright/issues/29923

---------

Signed-off-by: Max Schmitt <max@schmitt.mx>
2024-03-14 19:26:42 +01:00
Dmitry Gozman
349b25e61a
fix(storageState): try to collect storage state on existing pages first (#29915)
This helps in a case where navigating to an origin fails for some
reason, for example because a registered service worker loads some
content into the supposedly blank page.

Fixes #29402.
2024-03-12 19:20:35 -07:00
Yury Semikhatsky
166d2d4fde
chore: separate results for repeated snapshot names (#29880)
Reference #29719
2024-03-12 16:10:43 -07:00
Max Schmitt
38fc74db7c
fix: postDataJSON with application/x-www-form-urlencoded; charset=UTF-8 (#29889)
Fixes https://github.com/microsoft/playwright/issues/29872
2024-03-12 17:20:39 +01:00
Yury Semikhatsky
59228f19ce
fix: tty.WriteStream method stubs for process.stdout/stderr (#29865)
Fixes #29839
2024-03-11 10:11:16 -07:00
Max Schmitt
94e61fc95a
test: bump ct typescript version (#29855) 2024-03-11 17:09:26 +01:00
Yury Semikhatsky
7f6f17d1c3
chore: simplify toMatchSnapshot names calculation (#29862)
Reference https://github.com/microsoft/playwright/issues/29719
2024-03-10 11:11:35 -07:00
Dmitry Gozman
d214778548
chore(test runner): move timeout handling to the top, stop inheriting runnable (#29857) 2024-03-08 15:19:36 -08:00
Dmitry Gozman
875ce1cf09
fix(chromium): use blockedReason as failure reason when available (#29849)
This covers blocked requests, e.g. mixed-content, that receive
`loadingFailed` with empty `errorText`.

Also, forcefully resolve `allHeaders()` in this case, since we know
there will be no actual network headers.

Fixes #29833.
2024-03-07 14:07:04 -08:00
Dmitry Gozman
006ee7f3b0
feat: separate timeout for after hooks (#29828)
Instead of sharing the timeout with the test, and then extending it when
test times out, we give after hooks a separate timeout.
2024-03-06 12:31:54 -08:00
Sarkis Matinyan
0c3f60e95e
fix(ui): show stack frames in ui mode (#29560)
#29558, #29500
2024-03-06 12:29:35 -08:00
Lukas Bockstaller
425f737eb6
feat: exposes tags in testInfo (#29794)
Fixes #29793.

---------

Signed-off-by: Lukas Bockstaller <lukas.bockstaller@everest-erp.com>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-03-06 08:33:06 -08:00
Dmitry Gozman
1d4bdc6898
chore(test runner): make runAsStage throw and catch errors explicitly (#29814) 2024-03-05 16:35:11 -08:00
Dmitry Gozman
a3ed799cd5
fix(tsconfig): when extending, retain pathsBasePath from the original config (#29822)
This fixes a case where we incorrectly used the final config's base path
when resolving relative path mappings in the absence of the baseUrl.

Fixes #29816.
2024-03-05 16:34:39 -08:00
Dmitry Gozman
abfd2c4e66
feat(ui mode): text filter should filter by explicit tags (#29821)
Fixes #29815.
2024-03-05 10:58:55 -08:00
Dmitry Gozman
5eb8fea616
chore: rewrite worker main through TestInfoImpl._runAsStage (#29644) 2024-03-04 19:36:58 -08:00
Max Schmitt
291567b922
test(remove-cookie): do not rely on external websites for tests (#29811)
Fixes https://github.com/microsoft/playwright/issues/29795
2024-03-04 23:49:12 +01:00
Rui Figueira
73ffaf65d7
fix(codegen): fill action prevents omnibox navigation recording (#29790)
This PR is a fix proposal for a bug when trying to record a omnibox
navigation after a recorded action (e.g., `fill`).

The following test, included in this PR, reproduces the problem:

```ts
  test('should record omnibox navigations after recordAction', async ({ page, openRecorder, server }) => {
    const recorder = await openRecorder();
    await recorder.setContentAndWait(`<textarea></textarea>`);
    await Promise.all([
      recorder.waitForOutput('JavaScript', 'fill'),
      page.locator('textarea').fill('Hello world'),
    ]);
    // for performed actions, 5 seconds is the time needed to ensure they are committed
    await page.waitForTimeout(5000);
    await page.goto(server.PREFIX + `/empty.html`);
    await recorder.waitForOutput('JavaScript', `await page.goto('${server.PREFIX}/empty.html');`);
  });
```

After performed actions (e.g., `click`), it successfully records the
navigation as long as there's at least a 5 sec. gap between both
actions. That happens because after that 5 sec. interval the performed
action is automatically commited and therefore the navigation is not
stored as a signal of that action.

The proposed fix for recorded actions also forces that action to be
automatically commited after 5 sec (for testing, I'm using 500ms to
speed up the test execution).
2024-03-04 12:31:03 -08:00
PaulTriandafilov
8e48ee714d
feat(playwright-core): add remove cookies api (#29698) 2024-03-02 07:27:01 -08:00
Pavel Feldman
ef924c14e7
chore: do not use project id in telereporter (#29776) 2024-03-01 21:44:08 -08:00
Pavel Feldman
bbcc3c1238
chore: remove private config usage from telereporter (#29771) 2024-03-01 13:14:12 -08:00
Dmitry Gozman
a8c26d235c
Revert "chore(role): cache element list by role (#29130)" (#29765)
This reverts commit 1ce3ca25a2.

Added a regression test.

Fixes #29760.
2024-03-01 09:37:28 -08:00
Pavel Feldman
baf2cdf936
fix(ct): stop-gap for shared file import (#29744)
Fixes: https://github.com/microsoft/playwright/issues/29739
2024-02-29 19:13:32 -08:00
Dmitry Gozman
0f30cdab23
feat(firefox): roll ff and ff-beta to 1442 (#29751)
This requires changes in `FFPage`.
Also fixing a new ff-specific test that introduced flakiness on the
bots.

Closes https://github.com/microsoft/playwright/pull/29750
Closes https://github.com/microsoft/playwright/pull/29724
Closes https://github.com/microsoft/playwright/pull/29681
Closes https://github.com/microsoft/playwright/pull/29678
2024-02-29 14:44:45 -08:00
Pavel Feldman
d9a00342c8
fix(HEAD): revert GET->HEAD migration, net-effect was negative (#29738)
Fixes: https://github.com/microsoft/playwright/issues/29732
2024-02-29 09:02:05 -08:00
Dmitry Gozman
aedd7ca0be
chore: make CRNetworkManager handle multiple sessions (#29721)
It was already handling worker sessions, but not OOPIFs. As a result,
some functionality was properly implemented only for OOPIFs and not for
workers.

This change removes OOPIFs fanout for network-related calls from CRPage
and moves that to the CRNetworkManager, now also covering workers.
2024-02-28 15:51:27 -08:00
Stevan Freeborn
52b803ecf5
feat(trace mode): add on-first-failure mode for traces (#29647)
Implements the changes suggested in #29531
2024-02-28 14:39:18 -08:00
Pavel Feldman
d48aadac7e
fix: point to the right cli program export (#29715)
Fixes: https://github.com/microsoft/playwright/issues/29711
2024-02-28 14:05:42 -08:00
Yury Semikhatsky
d8c16c1edf
chore: roll stable runner to 1.42.0-beta-1708998235000 (#29675) 2024-02-27 08:36:03 -08:00
Yury Semikhatsky
1c8e8bea7e
chore: roll stable test runner to 1.42.0-beta-1708994059000 (#29672) 2024-02-26 17:39:25 -08:00
Andrey Lushnikov
b183159fd0
test: add regression test for cross-context clicking (#29668)
References https://github.com/microsoft/playwright/issues/29096
2024-02-26 16:52:49 -08:00
Pavel Feldman
9d0430fa26
chore: strengthen linting (#29669) 2024-02-26 16:52:28 -08:00
Sander
015a1bcc1c
feat(ct): double unmounting component throws error (#29650) 2024-02-26 11:16:27 -08:00
Sander
7e502e91b2
fix(ct): solid pass children when they are defined (#29648) 2024-02-26 11:15:08 -08:00
Dmitry Gozman
d7c4ee901a
test: enable localhost proxy tests on webkit mac, unless bypass rules are set (#29641) 2024-02-23 14:27:30 -08:00
Jeppe Reinhold
4d868f6ba8
fix(ct-react+ct-react17): only pass children to React.createElement when they are defined (#29592) 2024-02-23 12:30:42 -08:00
Pavel Feldman
a3aea813bc
chore: implement server-based list files (#29633) 2024-02-23 08:29:44 -08:00
Dmitry Gozman
f9aebda5db
fix(fixtures): attribute teardown step to the right TestInfo instance (#29523) 2024-02-20 12:35:43 -08:00
Jean-François Greffier
6494bb30a0
JUnit codegen (#29424)
Codegen for JUnit

Fixes https://github.com/microsoft/playwright-java/issues/1039

Following JUnit5 integration
https://github.com/microsoft/playwright-java/issues/1369
2024-02-20 11:08:53 -08:00
Max Schmitt
84fefdaac6
fix(console-api): locator filter with hasText (#29563)
Relates https://github.com/microsoft/playwright/issues/29546
2024-02-20 17:35:11 +01:00
Yury Semikhatsky
f3fde992eb
chore: remove --project-grep, add wildcard support (#29537)
Reference #15128
2024-02-16 19:18:00 -08:00
Dmitry Gozman
269a293ba1
chore(test runner): allow TestInfoImpl without a TestCase (#29534)
This will be useful to run `beforeAll`/`afterAll` hooks with a separate
`TestInfo` instance, as well as run use helpers like
`_runAndFailOnError()` during scope teardown.
2024-02-16 12:43:13 -08:00
Max Schmitt
05e6b5b5c7
test: unflake electron tests (#29520) 2024-02-15 22:09:17 +01:00
Dmitry Gozman
dc9cddde95
chore: do not rely on zones for predefined steps (#29485)
This fixes some edge cases where fixtures and steps inside them were
attached to the wrong parent (see the new test).
This will also allow to replace some `runAsStep` calls with a flat list
of tasks to do that do not rely on lexical scope.
2024-02-15 12:49:08 -08:00
Dmitry Gozman
08afb34c14
chore(test runner): make timeout error an Error (#29515) 2024-02-15 11:38:13 -08:00
Dmitry Gozman
bd5403dcad
chore: remove --tag and tagFilter (#29468)
This makes new tags filtered by the `grep`. New `TestCase.tags` API now
includes both old and new tags.
2024-02-15 11:37:16 -08:00
Dmitry Gozman
bc2d4302f5
test: fix a broken reporter test (#29514)
It failed to print an error with missing stack, e.g. a timeout error.
2024-02-15 09:45:48 -08:00
Sylvain Finot
b11b118e02
feat(chromium): expose parameters to generate outline / tagged PDF (#29494)
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2024-02-15 17:28:04 +01:00
Pavel Feldman
217c0618df
chore: rename find-related-tests to find-related-test-files (#29483) 2024-02-13 15:40:49 -08:00
Yury Semikhatsky
2693614c7a
Revert "fix(chromium): best effort 304 status on reload (#29373)" (#29481)
This reverts commit 17bc8f9a15.

Reference https://github.com/microsoft/playwright/issues/28779
Fixes https://github.com/microsoft/playwright/issues/29441
2024-02-13 11:43:04 -08:00
Pavel Feldman
7aef5249d8
chore: pass the private data to the runner via config (#29467) 2024-02-13 09:34:03 -08:00
Max Schmitt
8fca4c86aa
test: make Android/WebView2 bots green (#29477) 2024-02-13 17:55:58 +01:00
Max Schmitt
30557ed28c
fix(electron): stalling on delayed process close (#29431) 2024-02-13 10:25:46 +01:00
Dmitry Gozman
f605a5009b
fix(esmLoader): do not serialize the whole compilation cache after each import (#29464)
Instead, send the newly created cache entry only.

References #29418.
2024-02-12 16:39:53 -08:00
Max Schmitt
fe81790221
fix(accessibility): firefox with aria-invalid element (#29462)
Fixes https://github.com/microsoft/playwright/issues/29459
2024-02-12 12:12:31 -08:00
Max Schmitt
498b8bb269
fix(tracing): do not serialise out-of-process Buffers (#29425) 2024-02-12 21:03:38 +01:00
Max Schmitt
b15a7076dc
test: unskip 'msedge' tests (#29456)
This removes all msedge skips again and makes msedge equal with chromium
skip wise.

Fixes https://github.com/microsoft/playwright/issues/26711
2024-02-12 17:37:45 +01:00