From 13af76f8ed5b952735facfa88fa7a84e5e28eec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Kondratiuk?= Date: Wed, 4 Nov 2026 21:19:20 -0300 Subject: [PATCH] Run the nested-frame role tests as normal tests (Refs #1060) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK --- .../LocatorFrame/LocatorFrameTests.cs | 26 ++++++++----------- .../SelectorsFrame/SelectorsFrameTests.cs | 10 +++---- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/tests/E2E.NUnit.Tests/LocatorFrame/LocatorFrameTests.cs b/tests/E2E.NUnit.Tests/LocatorFrame/LocatorFrameTests.cs index aeaed09b9..aeb324bf0 100644 --- a/tests/E2E.NUnit.Tests/LocatorFrame/LocatorFrameTests.cs +++ b/tests/E2E.NUnit.Tests/LocatorFrame/LocatorFrameTests.cs @@ -156,24 +156,20 @@ public async Task Click_should_survive_iframe_navigation() await navigated; } - // Known difference, hardkoded/e2e-dotnet#1066: a frame-scoped getByRole also matches the nested frame's button. [Test] public async Task GetBy_coverage_role_text_test_id_label_placeholder() { - await ExpectedToFailAsync("observed matched 2 nodes", async () => - { - await Browser.GotoAsync(Routed); - var button1 = Browser.FrameLocator("iframe").GetByRole("button"); - var button2 = Browser.FrameLocator("iframe").GetByText("Hello", exact: false); - var button3 = Browser.FrameLocator("iframe").GetByTestId("buttonId"); - await Expect.That(button1).ToHaveTextAsync("Hello iframe"); - await Expect.That(button2).ToHaveTextAsync("Hello iframe"); - await Expect.That(button3).ToHaveTextAsync("Hello iframe"); - var input1 = Browser.FrameLocator("iframe").GetByLabel("Name"); - await Expect.That(input1).ToHaveValueAsync(""); - var input2 = Browser.FrameLocator("iframe").GetByPlaceholder("Placeholder"); - await Expect.That(input2).ToHaveValueAsync(""); - }); + await Browser.GotoAsync(Routed); + var button1 = Browser.FrameLocator("iframe").GetByRole("button"); + var button2 = Browser.FrameLocator("iframe").GetByText("Hello", exact: false); + var button3 = Browser.FrameLocator("iframe").GetByTestId("buttonId"); + await Expect.That(button1).ToHaveTextAsync("Hello iframe"); + await Expect.That(button2).ToHaveTextAsync("Hello iframe"); + await Expect.That(button3).ToHaveTextAsync("Hello iframe"); + var input1 = Browser.FrameLocator("iframe").GetByLabel("Name"); + await Expect.That(input1).ToHaveValueAsync(""); + var input2 = Browser.FrameLocator("iframe").GetByPlaceholder("Placeholder"); + await Expect.That(input2).ToHaveValueAsync(""); } [Test] diff --git a/tests/E2E.NUnit.Tests/SelectorsFrame/SelectorsFrameTests.cs b/tests/E2E.NUnit.Tests/SelectorsFrame/SelectorsFrameTests.cs index 6e468c92f..94e5d06fa 100644 --- a/tests/E2E.NUnit.Tests/SelectorsFrame/SelectorsFrameTests.cs +++ b/tests/E2E.NUnit.Tests/SelectorsFrame/SelectorsFrameTests.cs @@ -85,16 +85,12 @@ public async Task DollarDollarEval_should_not_throw_for_missing_frame() Assert.That(await Browser.FrameLocator("iframe").Locator("canvas").AllTextContentsAsync(), Has.Count.EqualTo(0)); } - // Known difference, hardkoded/e2e-dotnet#1066: a frame-scoped getByRole also matches the nested frame's button. [Test] public async Task Should_work_for_DollarEval() { - await ExpectedToFailAsync("observed count 2", async () => - { - await Browser.GotoAsync(Routed); - await Expect.That(Browser.FrameLocator("iframe").GetByRole("button")).ToHaveCountAsync(1); - await Expect.That(Browser.FrameLocator("iframe").Locator("button")).ToHaveCountAsync(1); - }); + await Browser.GotoAsync(Routed); + await Expect.That(Browser.FrameLocator("iframe").GetByRole("button")).ToHaveCountAsync(1); + await Expect.That(Browser.FrameLocator("iframe").Locator("button")).ToHaveCountAsync(1); } [Test]