So, the following will work:
```
page.frameLocator('iframe').locator('span').or(page.frameLoactor('iframe').locator('div'))
```
The following will not work, because frame locators are not exactly the
same:
```
page.frameLocator('#iframe1').locator('span').or(page.frameLoactor('#iframe2').locator('div'))
```
Also improve the error message to be more readable and include the
locator.
Fixes#23697.
There is a breaking in change in the `MatcherContext` that is passed to
matcher functions, so we now have `!!this.isNot` in a few places. The
same could happen to custom matcher in the wild.
```ts
// Old
{
isNot: boolean;
promise: string;
}
```
```ts
// New
{
isNot?: boolean;
promise?: string;
}
```
Fixes#23612.
Closes https://github.com/microsoft/playwright/issues/23566
n.b., while that issue describes a fairly specific "use case", this
logging is simple and generic. It seems very plausible that it can help
diagnose all sorts of issues.
Cheers - V
When rendering snapshot, disregard earlier resources with the same url,
because it's most likely that the latest one was used for rendering.
An example would be reloading the page before the stylesheet has
finished loading. In this case, the stylesheet will be requested twice,
and the second copy that was not aborted should be used for the
snapshot.
Fixes#23709.
When generating a selector, we tend to match by role and call various
roleUtils methods multiple times.
Apply the usual pattern for "nested operations counter" and aggressively
cache the results.
In the process of completing the task -
https://github.com/microsoft/playwright/pull/23348, I didn't notice the
need to pass headers to the session deletion method. So I fixed it here.
And support headers for selenium@3.
For linux tests without tracing blob-report-1.zip takes 19M, while
unpacked size is 228 MB. That size is counted for GitHub artifact
billing:
<img width="434" alt="image"
src="https://github.com/microsoft/playwright/assets/9798949/5bc32511-6686-4581-a348-acb6a54cd99b">
We zip individual .jsonl reports so that they still have unique names
and can be easily uploaded into the same artifacts directory without
name collisions.
- properly annotate continued requests
- nest `attach` steps inside the related `expect` step
- fix primary-id-to-non-primary-id mapping
- make sure images in trace are not draggable
Fixes#23693
---------
Signed-off-by: Andrey Lushnikov <aslushnikov@gmail.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
This reverts commit a1cdae6bff.
The problem with this approach is that each job overwrites the zip
artifact whereas previously it was merging all reports in the same
directory. We are going to zip .jsonl files instead.
Chained selectors where the second part starts with a scope did not work
before:
```ts
page.locator('div').locator(':scope + span')
page.locator('div >> +span')
```
Compressed size for `tests 1` blob report is 19Mb whil uncompressed one
is 211Mb. Also according to [GitHub
policy](https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
) it is uncompressed size that is used for billing:
"Artifacts are uploaded during a workflow run, and you can view an
artifact's name and size in the UI. When an artifact is downloaded using
the GitHub UI, all files that were individually uploaded as part of the
artifact get zipped together into a single file. This means that billing
is calculated based on the size of the uploaded artifact and not the
size of the zip file."