391 Commits

Author SHA1 Message Date
Adam Gastineau
6626bba937
fix(types): Properly format nested test type docstrings (#36126) 2025-05-29 04:40:58 -07:00
Adam Gastineau
2dee41910f
chore(reporter): normalize reporter option types (#35641) 2025-04-30 09:08:13 -07:00
Adam Gastineau
9b59a6aea6
feat(html): allow setting a title to display (#35659) 2025-04-28 10:30:25 -07:00
Dmitry Gozman
508b1ccdcb
feat: introduce kind option in TestInfo.snapshotPath() (#35734) 2025-04-24 21:21:57 +01:00
Adam Gastineau
a98ad6f071
chore: restore useful annotation types removed by #35620 (#35623) 2025-04-23 05:16:58 -07:00
Simon Knott
36a628d902
fix: expect.poll type with custom matcher (#35651) 2025-04-17 16:11:06 +02:00
Adam Gastineau
09529e9275
Revert "chore: add location named property to annotations (#35373)" (#35620) 2025-04-15 11:17:21 -07:00
Adam Gastineau
92c5d656ab
chore: add location named property to annotations (#35373) 2025-04-02 06:29:22 -07:00
Simon Knott
45fa3d17fc
feat: split up static and dynamic annotations (#35292)
Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2025-03-26 11:33:18 +01:00
Christopher Tangonan
c22c10f7d8
feat(json-reporter): added parallelIndex to TestResult (#34740) 2025-02-28 10:00:51 -08:00
Simon Knott
6dcb7d2bf5
chore: remove pageSnapshot option (#34962)
Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2025-02-28 13:16:58 +01:00
Pavel Feldman
d5adeb3cf4
chore: build a client bundle (#34847) 2025-02-19 15:27:00 -08:00
Simon Knott
8ed2f4319e
chore: add pageSnapshot option (#34669) 2025-02-11 11:04:57 -08:00
Yury Semikhatsky
a1451c75f8
feat: conditional step.skip() (#34578) 2025-01-31 15:45:57 -08:00
Yury Semikhatsky
275f334b58
chore(step): remove step.fail and step.fixme, add step.skip (#34326) 2025-01-14 17:43:47 -08:00
Yury Semikhatsky
7ed60ccf7f
feat(test): step.fail and step.fixme modifiers (#34042) 2024-12-17 11:17:22 -08:00
yangsisi
d029b03d9f
fix(defineConfig): fix type issue passing custom property in the seco… (#33774)
Signed-off-by: yangsisi <13655750+yangsisi0422@users.noreply.github.com>
2024-12-09 09:20:47 -08:00
Dmitry Gozman
0937d2f7b9
fix(types): update types for test.extend (#33784) 2024-12-09 08:59:01 -08:00
Simon Knott
fc19e6e7b4
fix(test): export TestDetailsAnnotation (#33698) 2024-11-20 17:28:56 +01:00
Yury Semikhatsky
5203c780ae
feat: step timeout option (#33560) 2024-11-13 11:17:54 -08:00
Dmitry Gozman
2e01154bb5
feat: screenshot:on-first-failure (#33266) 2024-10-24 04:41:35 -07:00
Dmitry Gozman
2d150eec25
fix: correct types for things like test.describe.only (#33142) 2024-10-17 03:34:05 -07:00
Pengoose
d10a5e5693
feat(testType): add support for test.fail.only method (#33001) 2024-10-16 06:47:23 -07:00
Dmitry Gozman
a395fb22c4
feat(routeWebSocket): address api review feedback (#32850) 2024-09-27 04:01:31 -07:00
Dmitry Gozman
59700aa9f1
chore: brush up documentation scripts (#32782)
References #32590.
2024-09-24 02:51:09 -07:00
Dmitry Gozman
cdcaa7fab6
feat: routeWebSocket (#32675)
This introduces `WebSocketRoute` class and
`page/context.routeWebSocket()` methods.
2024-09-20 03:20:06 -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
Pavel Feldman
6d5889a52c
chore: revert the matcherResult in API (#32524) 2024-09-09 16:44:32 -07:00
Pavel Feldman
a52eb0c9a0
chore: expose matcherResult on TestError (#32455) 2024-09-05 21:36:51 -07:00
Yury Semikhatsky
f0e13164d7
chore: split firefox and chromium bidi implementations (#32478) 2024-09-05 18:31:56 -07:00
Yury Semikhatsky
9a2c60a77c
chore: identify largest gaps in Bidi API (#32434)
This pull request introduces initial support for the WebDriver BiDi
protocol in Playwright. The primary goal of this PR is not to fully
implement BiDi but to experiment with the current state of the
specification and its implementation. We aim to identify the biggest
gaps and challenges that need to be addressed before considering BiDi as
the main protocol for Playwright.
2024-09-04 11:36:52 -07:00
Yury Semikhatsky
565aed6c39
Revert "chore: enforce tags format via typescript types (#32384)" (#32431)
After API review we decided to revert it:
* VSCode extension and UI mode users already get the (runtime) error if
the tag is not prefixed
* The typescript error message is not very nice
* The type change would break those clients that generate tests with
tags passed as string

This reverts commit 90e7b9ebacbd597b7380522001eb6d17ee9c3d86.
2024-09-03 10:07:08 -07:00
Simon Knott
f62f85ba51
fix(test runner): fix types to allow calling custom matchers on expect.poll (#32407)
The `'should support custom matchers'` test asserts that the
functionality works, but it was a type error. This PR updates the types
so that it's allowed.

Closes https://github.com/microsoft/playwright/issues/32408

---------

Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-09-02 13:42:15 +02:00
Yury Semikhatsky
90e7b9ebac
chore: enforce tags format via typescript types (#32384)
Leverage [template literal
types](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html).

Fixes https://github.com/microsoft/playwright/issues/32382
2024-08-29 14:16:49 -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
f24e46c367
fix(types): revert type changes made to support TS 5.5 (#32066)
Regressed in #31532. The TS5.5 changes broke chaining of `extend`s where
the first `extend` did not specify any type arguments.

Fixes #32056.
2024-08-08 05:21:48 -07:00
Pavel Feldman
3c87f217df
feat(events): allow waiting for removeAllListeners (#31941) 2024-08-05 21:14:35 -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
Matvey Chernyshov
ba62f83454
chore: add android keys for channels switching (#31619) 2024-07-10 13:15:45 -07:00
Max Schmitt
1132667ffe
chore: bump TypeScript to v5.5 (#31532) 2024-07-05 16:31:08 +02:00
Pavel Feldman
122818c62c
feat: allow boxing and titling fixtures, simulate context fixture deps (#31423)
Fixes https://github.com/microsoft/playwright/issues/31411
2024-06-24 21:43:43 -07:00
Yury Semikhatsky
f6972c1e23
docs: use long for time in milliseconds (#31369)
In Java and .NET int is not enough to store millis since epoch.
2024-06-18 10:47:29 -07:00
Dmitry Gozman
fce2874796
feat(types): export PageAssertionsToHaveScreenshotOptions type (#31319)
Fixes #31089.
2024-06-14 09:39:21 -07:00
Yury Semikhatsky
9884c851ff
feat(expect): expose expect timeout (#30969)
Fixes https://github.com/microsoft/playwright/issues/30583
2024-05-24 08:56:43 -07:00
Yury Semikhatsky
2cbd7b78ea
chore: change expect.getState() return type to unknown (#30989)
Eventually we would like to remove this method altogether.
2024-05-23 14:06:59 -07:00
Dmitry Gozman
b67b9634c1
chore: remove support for "experimental" from documentation (#30880)
Also add support for "hidden" and make `generate_types/index` actually
pass tsc checks.
2024-05-20 10:30:32 -07:00
Viktor Szépe
150cbcbdf3
chore: fix typos (#30645) 2024-05-08 19:40:03 +01:00
Rui Figueira
cf3ff6531a
chore: make NodeSnapshot type recursive and more (#30619)
Also, deviceDescriptors are now imported with ESM import instead of require()
2024-05-08 11:08:40 -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