/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Components/test/E2ETest/Tests/WebAssemblyConfigurationHostedTest.cs
52 строки
2 KB
dotnet-maestro[bot]
[main] Update dependencies from dotnet/efcore, dotnet/runtime (#60819)
13 мар 2025, 17:22
Не верифицирован
13 мар 2025, 17:22
3dbc559
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using BasicTestApp; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; using Microsoft.AspNetCore.E2ETesting; using OpenQA.Selenium; using Xunit.Abstractions; namespace Microsoft.AspNetCore.Components.E2ETest.Tests; public class WebAssemblyConfigurationHostedTest : ServerTestBase<BasicTestAppServerSiteFixture<TestServer.ClientStartup>> { private IWebElement _appElement; public WebAssemblyConfigurationHostedTest( BrowserFixture browserFixture, BasicTestAppServerSiteFixture<TestServer.ClientStartup> serverFixture, ITestOutputHelper output) : base(browserFixture, serverFixture, output) { } protected override void InitializeAsyncCore() { base.InitializeAsyncCore(); Navigate(ServerPathBase); _appElement = Browser.MountTestComponent<ConfigurationComponent>(); } [Fact(Skip = "We don't have a way to propagate AppEnvironment from server when using index.html fallback - https://github.com/dotnet/aspnetcore/issues/59456")] public void WebAssemblyConfiguration_Works() { // Verify values from the default 'appsettings.json' are read. Browser.Equal("Default key1-value", () => _appElement.FindElement(By.Id("key1")).Text); // Verify values overriden by an environment specific 'appsettings.$(Environment).json are read Assert.Equal("Prod key2-value", _appElement.FindElement(By.Id("key2")).Text); // Lastly for sanity, make sure values specified in an environment specific 'appsettings.$(Environment).json are read Assert.Equal("Prod key3-value", _appElement.FindElement(By.Id("key3")).Text); } [Fact(Skip = "We don't have a way to propagate AppEnvironment from server when using index.html fallback - https://github.com/dotnet/aspnetcore/issues/59456")] public void WebAssemblyHostingEnvironment_Works() { // Verify values from the default 'appsettings.json' are read. Browser.Equal("Production", () => _appElement.FindElement(By.Id("environment")).Text); } }