Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@
"parameters": ["headful"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[emulation-focus.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["headful"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[eval-on-selector-all.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
Expand Down
7 changes: 6 additions & 1 deletion src/PlaywrightSharp.Tests/EmulationFocusTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ await TaskUtils.WhenAll(

var popup = popupTask.Result;

Assert.That(await Page.EvaluateAsync<bool>("document.hasFocus()"), Is.True);
Assert.That(await popup.EvaluateAsync<bool>("document.hasFocus()"), Is.True);
Assert.That(await Page.EvaluateAsync<bool>("document.hasFocus()"), Is.True);
}

[PlaywrightTest("emulation-focus.spec.ts", "should provide target for keyboard events")]
Expand Down Expand Up @@ -128,6 +128,11 @@ public void ShouldNotAffectScreenshots()
[Test, Timeout(TestConstants.DefaultTestTimeout)]
public async Task ShouldChangeFocusedIframe()
{
if (TestConstants.IsFirefox && !TestConstants.IsHeadless)
{
Assert.Ignore("Headed Firefox might lose focus");
}

await Page.GoToAsync(TestConstants.EmptyPage);

var (frame1, frame2) = await TaskUtils.WhenAll(
Expand Down
1 change: 1 addition & 0 deletions src/PlaywrightSharp.Tests/TestConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ internal static Task<IBrowser> LaunchDefaultHeadful(
internal static readonly bool IsChromium = Product.Equals(ChromiumProduct, StringComparison.OrdinalIgnoreCase);
internal static readonly bool IsMacOSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
internal static readonly bool IsWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
internal static readonly bool IsHeadless = Convert.ToBoolean(Environment.GetEnvironmentVariable("HEADLESS") ?? "true");

public static readonly IEnumerable<string> NestedFramesDumpResult = new List<string>()
{
Expand Down
Loading