/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Components/test/E2ETest/Tests/InputActionsTest.cs
49 строк
2 KB
Matthew Leslie
Removing noReload argument from WebDriverExtensions.Nagivate (#55143)
22 апр 2024, 16:11
Не верифицирован
22 апр 2024, 16:11
199ea73
Код
Авторство
О чём код?
// 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 BasicTestApp.FormsTest; 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 InputFocusTest : ServerTestBase<ToggleExecutionModeServerFixture<Program>> { public InputFocusTest( BrowserFixture browserFixture, ToggleExecutionModeServerFixture<Program> serverFixture, ITestOutputHelper output) : base(browserFixture, serverFixture, output) { } protected override void InitializeAsyncCore() { // On WebAssembly, page reloads are expensive so skip if possible Navigate(ServerPathBase); } protected virtual IWebElement MountInputActionsComponent() => Browser.MountTestComponent<InputFocusComponent>(); [Fact] public void InputElementsGetFocusedSuccessfully() { var appElement = MountInputActionsComponent(); Browser.Exists(By.ClassName("input-group")); var inputGroups = appElement.FindElements(By.ClassName("input-group")); foreach (var group in inputGroups) { var expected = group.FindElement(By.ClassName("input-control")); var button = group.FindElement(By.TagName("button")); button.Click(); Browser.Equal(expected, () => Browser.SwitchTo().ActiveElement()); } } }