Skip to content

Elements inside a visibility:hidden iframe are not found instead of hidden (locator-frame, #1060) #1067

Closed

Description

@kblok

Found while porting upstream's locator-frame.e2e.ts (tester-army/e2e bdf769b, #1060).

Upstream marks two tests fail: 'the visibility read does not count an element inside a visibility: hidden iframe as hidden':

  • should treat elements inside hidden iframe as hidden
  • should treat elements inside hidden cross-origin iframe as hidden

In the port both fail earlier, because the web engine does not list a visibility: hidden iframe in the observation at all:

  • expect(frameLocator("[name=hidden]") >> locator("button")).toBeAttached failed: expected attached; observed no node (match count 0)
  • frame iframe is not in the observation: it is hidden, or the page changed after it: frameLocator("iframe") >> locator("div")

So an element inside a hidden frame is not "attached and hidden" but "not found". This is the same family as upstream's known difference, with a different first symptom. The third upstream fail test of the file (should wait for hidden iframe to become visible) passes in the port, so the port runs it as a normal test.

Next step: decide whether the port should match Playwright (list a hidden frame's content as hidden) or keep upstream's behavior. Until then the port keeps both upstream tests behind the ExpectedToFailAsync helper.

Activity

  1. kblok commented on Nov 4, 2026

    @kblok
    MemberAuthor

    Fixed by #1063 (hidden iframe content reads hidden). The two tests in #1070 now pass without ExpectedToFailAsync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions