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 @@ -215,12 +215,6 @@
"parameters": ["headful"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[frame-hierarchy.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["headful"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[page-check.spec.ts] *",
"platforms": ["darwin", "linux", "win32"],
Expand Down
2 changes: 1 addition & 1 deletion src/PlaywrightSharp.Tests/FrameHierarchyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ await Page.EvaluateAsync(@"() => {
Assert.That(frame1.IsDetached, Is.True);

var (frame2, _) = await TaskUtils.WhenAll(
Page.WaitForEventAsync(PageEvent.FrameNavigated),
Page.WaitForEventAsync(PageEvent.FrameAttached),
Page.EvaluateAsync("() => document.body.appendChild(window.frame)")
);

Expand Down
7 changes: 6 additions & 1 deletion src/PlaywrightSharp.Tests/FrameUtils.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

Expand Down Expand Up @@ -35,7 +37,10 @@ public static IEnumerable<string> DumpFrames(IFrame frame, string indentation =
description += $" ({frame.Name})";
}
var result = new List<string>() { description };
foreach (var child in frame.ChildFrames)
var childFrames = frame.ChildFrames.OrderBy(f => f.Url, StringComparer.Ordinal)
.ThenBy(f => f.Name, StringComparer.Ordinal)
.ToList();
foreach (var child in childFrames)
{
result.AddRange(DumpFrames(child, " " + indentation));
}
Expand Down
5 changes: 5 additions & 0 deletions src/PlaywrightSharp/PageEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public static class PageEvent
/// </summary>
public static PlaywrightEvent<IPage> Popup { get; } = new PlaywrightEvent<IPage>() { Name = "Popup" };

/// <summary>
/// <see cref="PlaywrightEvent{T}"/> representing a <see cref="IPage.FrameAttached"/>.
/// </summary>
public static PlaywrightEvent<IFrame> FrameAttached { get; } = new PlaywrightEvent<IFrame>() { Name = "FrameAttached" };

/// <summary>
/// <see cref="PlaywrightEvent{T}"/> representing a <see cref="IPage.FrameNavigated"/>.
/// </summary>
Expand Down
Loading