Skip to content

Commit

Permalink
Merge pull request #221 from Lombiq/issue/OSOE-419
Browse files Browse the repository at this point in the history
OSOE-419: Fix that TestAdminAsMonkeyRecursivelyAsync() doesn't navigate anywhere by default
  • Loading branch information
dministro authored Oct 27, 2022
2 parents 80e1384 + 42502c4 commit da2c30d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static async Task TestFrontendAuthenticatedAsMonkeyRecursivelyAsync(
/// The username to sign in with directly. Defaults to <see cref="DefaultUser.UserName"/>.
/// </param>
/// <param name="startingRelativeUrl">
/// The relative URL to start monkey testing from. Defaults to <c>"/admin"</c>.
/// The relative URL to start monkey testing from. Defaults to <see cref="UITestContext.AdminUrlPrefix"/>.
/// </param>
public static async Task TestAdminAsMonkeyRecursivelyAsync(
this UITestContext context,
Expand All @@ -61,7 +61,9 @@ public static async Task TestAdminAsMonkeyRecursivelyAsync(
string startingRelativeUrl = null)
{
if (!string.IsNullOrEmpty(signInDirectlyWithUserName)) await context.SignInDirectlyAsync(signInDirectlyWithUserName);
if (!string.IsNullOrEmpty(startingRelativeUrl)) await context.GoToAdminRelativeUrlAsync(startingRelativeUrl);

if (string.IsNullOrEmpty(startingRelativeUrl)) await context.GoToDashboardAsync();
else await context.GoToAdminRelativeUrlAsync(startingRelativeUrl);

options ??= new MonkeyTestingOptions();
options.UrlFilters.Add(new AdminMonkeyTestingUrlFilter(context));
Expand Down

0 comments on commit da2c30d

Please sign in to comment.