Commit graph

104 commits

Author SHA1 Message Date
Pengoose 7f141b2c42
feat: expect(locator).toHaveAccessibleErrorMessage (#33904) 2024-12-27 09:54:16 +00:00
Pavel Feldman a25bda6950
chore: allow storing aria snapshots in files (#33919) 2024-12-10 11:45:16 -08:00
Max Schmitt 92436518ff
docs(python): add LocatorAssertions.NotToMatchAriaSnapshot (#33712) 2024-11-21 15:53:37 +01:00
Dmitry Gozman d3ffdefd50
docs: release notes for languages v1.49 (#33706) 2024-11-21 05:45:00 -08:00
aairiian 7f054ef8c6
feat(aria): extend toHaveAccessibleName() to accept an array of expected accessible names (#33277) 2024-11-18 07:46:47 -08:00
Amaechi Hope e61cea597a
docs(dotnet): fix assertion snippets (#33622) 2024-11-15 15:02:40 +01:00
Yury Semikhatsky f5477d9051
docs: add ariaSnapshot.timeout for language ports (#33614) 2024-11-14 12:23:42 -08:00
Pavel Feldman a655b0bfb3
chrome: aria api review (#33458) 2024-11-05 15:23:38 -08:00
Pavel Feldman 8b49d568de
docs: start adding the aria snapshot documentation (#33407) 2024-11-04 10:53:46 -08:00
Pavel Feldman b421bd8b0d
chore: add a basic snapshot generator test (#33123) 2024-10-15 15:21:45 -07:00
Pavel Feldman a38ff6e0d8
chore: experimental toMatchAriaSnapshot (#33014) 2024-10-14 14:07:19 -07:00
Max Schmitt 895be9f8de
chore: lint java docs snippets (#32945) 2024-10-04 11:34:04 +02:00
Max Schmitt f95b4e0ac8
docs(dotnet): recommend MSTest over NUnit (#31245) 2024-06-11 15:06:03 +02:00
Viktor Szépe 150cbcbdf3
chore: fix typos (#30645) 2024-05-08 19:40:03 +01:00
Max Schmitt 5babb37f19
docs(python): roll fixes (#30708) 2024-05-08 08:44:28 -07:00
Dmitry Gozman 6d20da568e
feat: expect(locator).toHaveRole(role) (#30555)
References #13517. Fixes #18332.
2024-04-25 15:26:10 -07:00
Dmitry Gozman 4a275b8eca
feat: expect(locator).toHaveAccessibleDescription (#30463)
References #18332.
2024-04-22 12:33:30 -07:00
Dmitry Gozman eea1f9984f
feat: expect(locator).toHaveAccessibleName (#30420)
References #18332.
2024-04-18 12:28:55 -07:00
Dmitry Gozman 90665ef056
docs: update auto-waiting doc (#28960)
- Replace action names with links to `Locator.click`.
- Remove "Attached" check in favor of "locator resolves to a single
element".
- Replace getter methods in assertion section with auto-retriying
assertions.
- Add missing actions.

---

<img width="837" alt="Screenshot 2024-01-11 at 1 02 34 PM"
src="https://github.com/microsoft/playwright/assets/9881434/1946678d-6a7e-45cf-a299-2f18cb3fb5a5">
2024-01-12 09:33:42 -08:00
geke-scottlogic 6bd61cd8c6
docs: Improve clarity on toHaveText and toContainText assertions (#28623)
This closes https://github.com/microsoft/playwright/issues/28058.
2024-01-05 09:20:50 -08:00
Pavel Feldman d242ff67ef
chore: follow up to the stylePath review (#28636) 2023-12-14 08:19:24 -08:00
Pavel Feldman 0a7a10d0f6
feat(vrt): allow providing screenshot style (#28229) 2023-11-30 17:42:45 -08:00
Max Schmitt d7d1c80cf7
docs(python): add ignoreCase to NotToHaveAttribute (#28267)
https://github.com/microsoft/playwright-python/issues/2078
2023-11-21 08:54:23 -08:00
Yury Semikhatsky ec2c7024b6
docs: fix ignoreCase description (#28121) 2023-11-14 10:18:04 -08:00
Yury Semikhatsky 35aeace476
docs(assertions): note on whitespace normalization (#28110)
Fixes https://github.com/microsoft/playwright-java/issues/1419
2023-11-13 12:28:50 -08:00
Yury Semikhatsky 0ade5aa9ad
fix: ignoreCase in toHaveAttribute (#27809)
Fixes #27795
2023-10-25 19:22:13 -07:00
AlexKomanov 117f3f1298
docs: Fixing a release version of a method toHaveAttribute (#27559)
There is a mistake in the release version of the `toHaveAttribute`
method. It was released in the 1.39 version and not in the 1.40 like was
mentioned in the documentation.
2023-10-12 08:30:40 +02:00
Yury Semikhatsky ac48a47d33
feat: toHaveAttribute without value (#27418)
This time not doing it in other languages due to unjustified generator
complexity.

Fixes #27341
2023-10-04 09:27:28 -07:00
Dmitry Gozman 7bd8032439
docs: mention Locator.first in toBeVisible (#27292)
Fixes #26842.
2023-09-25 10:59:39 -07:00
Max Schmitt 6ab6cde929
docs(python): remove await in sync code snippet (#24124) 2023-07-10 16:08:39 +02:00
Max Schmitt 9980f054bc
docs: align Node.js code snippets with ESLint (#23916) 2023-06-27 11:53:53 +02:00
Max Schmitt 69ae8c1a28
docs(dotnet): fix syntactically incorrect code snippets (#23900) 2023-06-26 18:21:14 +02:00
Andrey Lushnikov 0f4090472c
feat: add maskColor option to the toHaveScreenshot method (#23555) 2023-06-06 17:15:55 -07:00
Dmitry Gozman 6929214dbf
feat(expect): expect(locator).toBeAttached() (#22067)
Fixes #13467.
2023-03-29 11:09:17 -07:00
Dmitry Gozman 6fbb265a58
chore: release notes for 1.31 for java, python, csharp (#20969) 2023-02-16 18:11:01 -08:00
Dmitry Gozman 0b7f9055a3
chore: fix docs for python and java (#20962) 2023-02-16 11:48:38 -08:00
Dmitry Gozman ffc2477a00
chore: 1.31 release notes for js (#20933) 2023-02-16 09:35:01 -08:00
Andrey Lushnikov 72942e81d5
chore: fixes to toBeInViewport (#20870) 2023-02-13 15:21:40 -08:00
Andrey Lushnikov fdcd7b549d
chore: mark comparator option back as experimental (#20816)
This reverts commit 303c5998f8.

Reason for revert: I tried enabling `ssim-cie94` by default on
ionic-framework test suite, and it proves to be overly strict for their
usecase.
2023-02-13 11:11:44 -08:00
Andrey Lushnikov 68e170ef89
feat: implement expect(locator).toBeInViewport() (#20668)
The method accepts a `ratio` option to assert the ratio
of the element in viewport. `ratio` defaults to `Number.MIN_VALUE`.

NOTE: this reverts commit d950f5b6ee and
adds `ratio` option support + does the rename.

Fixes #8740
2023-02-10 04:33:22 -08:00
Dmitry Gozman 59121a3c37
chore: remove unnecessary extra options from docs (#20785)
Python-only methods should not reference js-only options.
2023-02-09 08:57:44 -08:00
Andrey Lushnikov 303c5998f8
feat: release "comparator" option from experiment (#20720)
The option defines a comparator to be used to compare images.
Possible values are `"pixelmatch"` and `"ssim-cie94"`.

Note: This reverts commit 8167f8bf54.
2023-02-07 08:51:48 -08:00
Dmitry Gozman d950f5b6ee
chore: remove toIntersectViewport for the next release (#20232)
Mostly reverts #19901.
2023-01-19 15:04:09 -08:00
Andrey Lushnikov 2a49c5e498
feat(expect): introduce expect(locator).toIntersectViewport() (#19901)
This is a new web-first assertion that should be used like this:

```ts
test('should work', async ({ page }) => {
  const locator = page.locator('body');
  // New web-first assertion.
  await expect(locator).toIntersectViewport();
  // The same functionality.
  await expect.poll(() => locator.viewportRatio()).toBeGreaterThan(0);
});
```

Fixes #8740
2023-01-06 16:56:24 -08:00
Andrey Lushnikov 8167f8bf54
chore: hide "comparator" option from documentation and types (#19441) 2022-12-14 09:58:19 -08:00
Andrey Lushnikov 6d82460a02
feat: implement a new image comparison function (#19166)
This patch implements a new image comparison function, codenamed
"ssim-cie94". The goal of the new comparison function is to cancel out
browser non-determenistic rendering.

To use the new comparison function:

```ts
await expect(page).toHaveScreenshot({
  comparator: 'ssim-cie94',
});
```

As of Nov 30, 2022, we identified the following sources of
non-determenistic rendering for Chromium:
- Anti-aliasing for certain shapes might be different due to the
  way skia rasterizes certain shapes.
- Color blending might be different on `x86` and `aarch64`
architectures.

The new function employs a few heuristics to fight these
differences.

Consider two non-equal image pixels `(r1, g1, b1)` and `(r2, g2, b2)`:
1. If the [CIE94] metric is less then 1.0, then we consider these pixels
   **EQUAL**. (The value `1.0` is the [just-noticeable difference] for
   [CIE94].). Otherwise, proceed to next step.
1. If all the 8 neighbors of the first pixel match its color, or
   if the 8 neighbors of the second pixel match its color, then these
   pixels are **DIFFERENT**. (In case of anti-aliasing, some of the
   direct neighbors have to be blended up or down.) Otherwise, proceed
   to next step.
1. If SSIM in some locality around the different pixels is more than
   0.99, then consider this pixels to be **EQUAL**. Otherwise, mark them
   as **DIFFERENT**. (Local SSIM for anti-aliased pixels turns out to be
   very close to 1.0).

[CIE94]: https://en.wikipedia.org/wiki/Color_difference#CIE94
[just-noticeable difference]:
https://en.wikipedia.org/wiki/Just-noticeable_difference
2022-12-02 15:22:05 -08:00
Max Schmitt 62b28c89b4
docs(assertions): fix wrong toHaveText param description (#19213)
Fixes https://github.com/microsoft/playwright/issues/19202
2022-12-01 09:14:06 -08:00
Dmitry Gozman 6721ea4d3a
docs: fix string AriaRole in java/csharp (#19183) 2022-11-30 13:46:33 -08:00
Dmitry Gozman 65b0fb055d
docs: note assertion methods that only work with playwright test runner (#19116)
Fixes #18963.
2022-11-28 10:32:48 -08:00
Pavel Feldman be2139f0ac
docs: split assertions list into langs (#19039) 2022-11-24 08:25:24 -08:00