Skip to content

Commit

Permalink
Merge pull request #140 from Lombiq/issue/OSOE-85
Browse files Browse the repository at this point in the history
OSOE-85: Making TriggerAfterPageChangeEventAsync and TriggerAfterPageChangeEventAndRefreshAtataContextAsync public so custom page change logic can also trigger them
  • Loading branch information
Piedone authored Mar 4, 2022
2 parents acd58f3 + 00ef216 commit c0a9b60
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Lombiq.Tests.UI/Services/UITestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ public async Task AssertCurrentBrowserLogAsync()
Configuration.AssertBrowserLog?.Invoke(browserLog);
}

internal async Task TriggerAfterPageChangeEventAsync()
/// <summary>
/// Invokes the registered <see cref="PageChangeEventHandler"/>s. Should be called when the browser loads a new
/// page in the app.
/// </summary>
/// <exception cref="PageChangeAssertionException">
/// Thrown when any of the event handlers throws an exception.
/// </exception>
public async Task TriggerAfterPageChangeEventAsync()
{
if (IsNoAlert())
{
Expand All @@ -161,7 +168,12 @@ internal async Task TriggerAfterPageChangeEventAsync()
}
}

internal async Task TriggerAfterPageChangeEventAndRefreshAtataContextAsync()
/// <summary>
/// Invokes the registered <see cref="PageChangeEventHandler"/>s and refreshes the Atata context with <see
/// cref="NavigationUITestContextExtensions.RefreshCurrentAtataContext(UITestContext)"/>. Should be called when
/// the browser loads a new page in the app.
/// </summary>
public async Task TriggerAfterPageChangeEventAndRefreshAtataContextAsync()
{
await TriggerAfterPageChangeEventAsync();
this.RefreshCurrentAtataContext();
Expand Down

0 comments on commit c0a9b60

Please sign in to comment.