Commit Graph

11968 Commits

Author SHA1 Message Date
Yury Semikhatsky
82981a8091
fix: interception id not found error in route.continue (#29180)
We stopped catching all exceptions in
https://github.com/microsoft/playwright/pull/28539 in hope that we'll
get loadingFailed even before Fetch.continue/fulfill command's error.
Turns out this is racy and may fail if the test cancels the request
while we are continuing it. The following test could in theory reproduce
it if stars align and the timing is good:

```js
it('page.continue on canceled request', async ({ page }) => {
  let resolveRoute;
  const routePromise = new Promise<Route>(f => resolveRoute = f);
  await page.route('http://test.com/x', resolveRoute);

  const evalPromise = page.evaluate(async () => {
    const abortController = new AbortController();
    (window as any).abortController = abortController;
    return fetch('http://test.com/x', { signal: abortController.signal }).catch(e => 'cancelled');
  });
  const route = await routePromise;
  void page.evaluate(() => (window as any).abortController.abort());
  await new Promise(f => setTimeout(f, 10));
  await route.continue();
  const req = await evalPromise;
  expect(req).toBe('cancelled');
});
```

Fixes https://github.com/microsoft/playwright/issues/29123
2024-01-25 16:54:42 -08:00
Gabriel Feo
12a9a308f8
chore: replace "node.js" mention in shared docs (#29119)
Remove "Node.js" mention from the shared part of docs, which are shown
in docs for Python and other platforms.
2024-01-25 16:53:25 -08:00
Max Schmitt
f741f08b3b test: fix itest (follow up to #28932) 2024-01-25 23:55:24 +01:00
Yury Semikhatsky
0113e8455b
fix: make TeleSuite.project work for all suites (#29177)
Fixes https://github.com/microsoft/playwright/issues/29173
2024-01-25 13:44:08 -08:00
Yury Semikhatsky
85c42939b1
devops: do not use broken overwrite: true for uploads (#29160)
Reverting parts of https://github.com/microsoft/playwright/pull/29080
related to use of overwrite: true as it is racy and
[fails](https://github.com/microsoft/playwright/actions/runs/7641699534/job/20819588957?pr=28932#step:10:63)
time to time with parallel jobs:


![image](https://github.com/microsoft/playwright/assets/9798949/cd484e2d-2875-4950-9247-5ea033c6e92d)


Reference https://github.com/actions/upload-artifact/issues/506
2024-01-25 12:55:29 -08:00
Max Schmitt
4c4789c740
chore: validate deps during install (#28932)
Motivation: On Windows we call around 50 times `PrintDeps.exe` which
takes on a very fast machine 500+ms. On Linux we do it around 120 times
(`ldd`) which takes around 150ms.

This change validates the dependencies once on browser install (`npx
playwright install`). In case its failing, it will emit a warning, in
case of a success, it will create a marker file that the binary has been
validated. For future `launch()` calls, we'll read this file and if
exists, we'll not validate again. Otherwise we'll validate again.

Note: If the marker file is older than 30 days, the browser will be
validated again.
2024-01-25 20:55:53 +01:00
Pavel Feldman
6a14b1dc51
chore: automatically detect the dev server (#29176) 2024-01-25 11:46:47 -08:00
Pavel Feldman
24ff2e2bad
chore: provisional fix for win install test failure (#29175) 2024-01-25 11:46:30 -08:00
Pavel Feldman
b5e175e6e2
fix: tolerate wrongly-typed annotations (#29162)
Fixes https://github.com/microsoft/playwright/issues/29149
2024-01-25 11:35:17 -08:00
Pavel Feldman
f7fb1e4d4e
chore(ct): use sticky test server if available (#29136) 2024-01-25 08:36:13 -08:00
Dmitry Gozman
f5de6e5538
feat(codegen): generate multiple selectors to choose from (#29154)
When possible, "pick locator" generates:
- default locator;
- locator without any text;
- locator without css `#id`.

Fixes #27875, fixes #5178.
2024-01-25 07:35:58 -08:00
Dmitry Gozman
bc83d7084c
fix(chromium): emulate navigator.userAgentData along with UA (#29159)
Fixes #28989, fixes #29139.
2024-01-25 07:34:11 -08:00
Playwright Service
129f5bfdbe
feat(chromium): roll to r1100 (#29167)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-25 15:24:49 +01:00
Playwright Service
6a04ed6a1e
feat(chromium-tip-of-tree): roll to r1188 (#29169)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-25 15:24:33 +01:00
Yury Semikhatsky
f49426b006
docs: update browsers when updating playwright (#29128) 2024-01-24 21:54:03 -08:00
Playwright Service
86c881f206
feat(chromium-tip-of-tree): roll to r1187 (#29153)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-24 18:36:00 +01:00
Max Schmitt
ba8d141de8
chore: drop Ubuntu 18.04 (#29145)
This will now yield:

```
root@a85fb37f0c96:/work# npx playwright install
Failed to install browsers
Error: ERROR: Playwright does not support chromium on ubuntu18.04-x64
```

On Ubuntu 18.04.
2024-01-24 17:46:20 +01:00
Max Schmitt
d50479a76f
devops: switch to ISO date string for Canary versions (#29142)
Fixes https://github.com/microsoft/playwright/issues/28906
2024-01-24 17:13:00 +01:00
Yury Semikhatsky
0752f0202f
docs: teardown examples (#29134)
Fixes https://github.com/microsoft/playwright/issues/29068
2024-01-23 16:35:30 -08:00
Yury Semikhatsky
ea855e232e
docs: update note on filtering dependent projects (#29135)
Fixes https://github.com/microsoft/playwright/issues/29102
2024-01-23 16:10:43 -08:00
Yury Semikhatsky
9cd2916623
docs: add a new fruit when mocking response (#29137)
Strawberry is already in the original list.

Fixes https://github.com/microsoft/playwright/issues/29114
2024-01-23 16:10:33 -08:00
Pavel Feldman
cec2ff1772
chore: split cli processing into cli endpoint and program (#29131) 2024-01-23 15:22:09 -08:00
Dmitry Gozman
1ce3ca25a2
chore(role): cache element list by role (#29130) 2024-01-23 13:45:26 -08:00
Pavel Feldman
8898a537e0
chore: extract a dev variation of the ct plugin (#29126) 2024-01-23 12:55:28 -08:00
Dmitry Gozman
8e607d509f
fix(recorder): disallow external imports (#29129)
Previously, new `Recorder` instance was given an existing
`InjectedScript`. However, we built a separate source for
`InjectedScript` vs `Recorder`, and both bundles contain their own copy
of all helper modules, e.g. `roleUtils`.

This resulted in two copies of helper modules, which is troublesome for
any module-level globals like a top-level cache. Depending on whether
`Recorder` or `InjectedScript` called into the helper, they would access
the different value of a module global, which lead to bugs.

To prevent this, we force any external dependencies to be imported
through the `InjectedScript.utils`.
2024-01-23 11:29:40 -08:00
Dmitry Gozman
5bc5056a1f
chore(role): cache pseudo content calculation (#29115) 2024-01-23 10:09:23 -08:00
Pavel Feldman
41c15cb176
chore: move vite root dir into template folder (#29081) 2024-01-23 09:40:05 -08:00
Max Schmitt
d89ed88679
docs: do not recommend PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD anymore (#29121) 2024-01-23 09:12:47 -08:00
Playwright Service
3e2d7fe7e7
feat(chromium): roll to r1099 (#29120)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-23 13:34:59 +01:00
Dmitry Gozman
9b974e0026
chore: speedup frequent element text normalization (#29113)
We cache `ElementText` for frequent operations, but then call
`normalizeWhitespace` on it every time which burns a lot of CPU.
2024-01-22 21:33:56 -08:00
Yury Semikhatsky
fbf87ef904
fix: test.fail wrapper method (#29112)
Fixes https://github.com/microsoft/playwright/issues/29104
2024-01-22 19:47:27 -08:00
Yury Semikhatsky
b2de9bc865
fix: mock safari.pushNotification (#29107)
Fixes https://github.com/microsoft/playwright/issues/29032
2024-01-22 15:44:13 -08:00
Max Schmitt
db00aa7305
fix: remove unused TestInfo.stdout/stderr (#29076)
https://github.com/microsoft/playwright/issues/29062
2024-01-22 19:22:31 +01:00
Playwright Service
4e877f270d
feat(webkit): roll to r1970 (#29103)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-22 19:22:11 +01:00
Max Schmitt
c3566d259f
chore: better error messages when stable channel installations fail on Windows (#29077)
https://github.com/microsoft/playwright/issues/29004
2024-01-22 18:15:35 +01:00
Yury Semikhatsky
4b0e55abda
devops: make sure uploaded reports always contain directory (#29080)
* Before the change if if uploaded artifact path contained just one file
it would be [archived
directly](694cdabd8b/src/search.ts (L142-L151)),
but if there is a sister folder it would be an archive of the entire
dir. According to the action docs "If a wildcard pattern is used, the
path hierarchy will be preserved after the first wildcard pattern", so
hopefully it means that the directory is always compressed even if there
is a single file in it.
* Use `overwrite: true` to have only one artifact with pull request
number.
2024-01-19 17:23:22 -08:00
dependabot[bot]
c635fc9a19
chore(deps): bump vite from 5.0.11 to 5.0.12 (#29078) 2024-01-19 17:23:07 -08:00
Yury Semikhatsky
d7958ba4ad
chore: quote path only if contains whitespaces (#29079)
Otherwise we always quote as `trace.zip` matches \W.

This is a follow-up to 674988c633
Reference https://github.com/microsoft/playwright/issues/29039
2024-01-19 16:52:39 -08:00
Pavel Feldman
d61f99034a
fix(ct-react): do not reset mount hooks upon update (#29072)
Fixes https://github.com/microsoft/playwright/issues/29058
2024-01-19 12:55:36 -08:00
Dmitry Gozman
f3fac6f4e9
feat: page.handleLocator that closes any interstitial pages/dialogs (#29029) 2024-01-19 12:35:00 -08:00
Pavel Feldman
71a48c2562
chore: migrate ct to vite5 (#29033)
Closes https://github.com/microsoft/playwright/issues/28607
2024-01-19 11:13:03 -08:00
Sander
54c57fdebe
chore(ct): revert export mount result (#29070) 2024-01-19 11:11:23 -08:00
Max Schmitt
e551506c9e
Revert "feat(codegen): add range input recording support (#28767)" (#29069) 2024-01-19 19:47:59 +01:00
Yury Semikhatsky
674988c633
chore: add quotes to the path only when necessary (#29057)
This is a follow-up to c76f5294ce
Reference https://github.com/microsoft/playwright/issues/29039
2024-01-19 10:27:15 -08:00
Max Schmitt
6a15d43539
docs: rename example env var (#29061) 2024-01-19 17:43:37 +01:00
Playwright Service
057b0dd0ab
feat(firefox-beta): roll to r1438 (#29063)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-19 13:27:53 +01:00
Pavel Feldman
4010940315
chore: move off babel proposals to plugins (#29053) 2024-01-18 17:50:52 -08:00
Dmitry Gozman
b7d22b64e8
feat(merge): prepend bot name to global errors (#29055)
This way one can figure out where does the error come from.

An example merged report that exhibits the issue:
https://mspwblobreport.z1.web.core.windows.net/run-7563628632-1-2328b83af75801ab76bb06c214fee483cf5bc07c/index.html#?q=s%3Afailed%20s%3Aflaky
2024-01-18 15:11:32 -08:00
Yury Semikhatsky
c76f5294ce
fix: quote trace file path when printing error message (#29052)
Fixes https://github.com/microsoft/playwright/issues/29039
2024-01-18 14:23:12 -08:00
Max Schmitt
4a45724633
fix: open 0.0.0.0 as localhost (#29054)
Fixes https://github.com/microsoft/playwright/issues/29047
2024-01-18 22:21:49 +01:00