microsoft / microsoft/playwright

[Bug]: frame with `visibility: hidden` is incorrectly treated as visible

Open
#42,719 2 comments 2 reactions 1 assignee View on GitHub

@dgozman is already working on this.

Since Sep 16, 2026.

needs-triage-win
Dominant language
TypeScript
Stars
96.3k
Forks
6.5k
Avg merge
1d 6h
Merged PRs (30d)
180

Description

### Version

1.63.0

### Steps to reproduce

```ts
import { expect, test } from "@playwright/test";

// fails
test("visibility: hidden", async ({ page }) => {
await page.setContent(`


`);
await expect(page.frameLocator("[name='asdf']").locator("p")).toBeHidden();
});

// passes
test("display: none", async ({ page }) => {
await page.setContent(`


`);
await expect(page.frameLocator("[name='asdf']").locator("p")).toBeHidden();
});
```

### Expected behavior

the locator is considered hidden in both tests

### Actual behavior

the locator is considered visible in the `visibility: hidden` test even though it's not actually visible

### Additional context

_No response_

### Environment

```shell
System:
OS: Windows 11 10.0.22631
CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11500H @ 2.90GHz
Memory: 6.48 GB / 31.20 GB
Binaries:
Node: 26.3.1 - C:\Users\user\AppData\Roaming\node\node.EXE
npm: 11.16.0 - C:\Users\user\AppData\Roaming\node\npm.CMD
IDEs:
VSCode: 1.134.0 - C:\Users\user\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
Languages:
Bash: 5.2.21 - C:\WINDOWS\system32\bash.EXE
npmPackages:
@playwright/test: 1.63.0 => 1.63.0
playwright: 1.63.0 => 1.63.0
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.