Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into issue/NEST-538
Browse files Browse the repository at this point in the history
  • Loading branch information
DemeSzabolcs committed May 18, 2024
2 parents ce4c06d + 4b5f97e commit 19c83aa
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using OpenQA.Selenium;
using OrchardCore.Abstractions.Setup;
using OrchardCore.Admin;
Expand Down Expand Up @@ -602,6 +603,28 @@ public interface IShortcutsApi
return eventUrl;
}

/// <summary>
/// Retrieves the options of the given type from the current tenant's shell scope.
/// </summary>
public static async Task<IOptions<T>> GetTenantOptionsAsync<T>(
this UITestContext context,
string tenant = null,
bool activateShell = true)
where T : class
{
IOptions<T> options = null;
await UsingScopeAsync(
context,
serviceProvider =>
{
options = serviceProvider.GetRequiredService<IOptions<T>>();
return Task.CompletedTask;
},
tenant,
activateShell);
return options;
}

/// <summary>
/// Switches to an interactive mode where control from the test is handed over and you can use the web app as an
/// ordinary user from the browser or access its web APIs. To switch back to the test, click the button
Expand Down

0 comments on commit 19c83aa

Please sign in to comment.