Skip to content

Removing noReload argument from WebDriverExtensions.Nagivate #55143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -26,9 +26,9 @@ public ServerTestBase(
_serverFixture = serverFixture;
}

public void Navigate(string relativeUrl, bool noReload = false)
public void Navigate(string relativeUrl)
{
Browser.Navigate(_serverFixture.RootUri, relativeUrl, noReload);
Browser.Navigate(_serverFixture.RootUri, relativeUrl);
}

protected override void InitializeAsyncCore()
Original file line number Diff line number Diff line change
@@ -22,14 +22,14 @@ public static void SignInAs(this IWebDriver browser, Uri baseUri, string usernam
// original page, but this adds several seconds of delay
var originalWindow = browser.CurrentWindowHandle;
browser.SwitchTo().NewWindow(WindowType.Tab);
browser.Navigate(baseUri, baseRelativeUri, noReload: false);
browser.Navigate(baseUri, baseRelativeUri);
browser.Exists(By.CssSelector("h1#authentication"));
browser.Close();
browser.SwitchTo().Window(originalWindow);
}
else
{
browser.Navigate(baseUri, baseRelativeUri, noReload: false);
browser.Navigate(baseUri, baseRelativeUri);
browser.Exists(By.CssSelector("h1#authentication"));
}
}
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest;

internal static class WebDriverExtensions
{
public static void Navigate(this IWebDriver browser, Uri baseUri, string relativeUrl, bool noReload)
public static void Navigate(this IWebDriver browser, Uri baseUri, string relativeUrl)
{
var absoluteUrl = new Uri(baseUri, relativeUrl);

Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public CircuitContextTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: false);
Navigate(ServerPathBase);
Browser.MountTestComponent<CircuitContextComponent>();
Browser.Equal("Circuit Context", () => Browser.Exists(By.TagName("h1")).Text);
}
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ public override async Task InitializeAsync()

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: false);
Navigate(ServerPathBase);
Browser.MountTestComponent<GracefulTermination>();
Browser.Equal("Graceful Termination", () => Browser.Exists(By.TagName("h1")).Text);

Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ public override async Task InitializeAsync()

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: false);
Navigate(ServerPathBase);
Browser.MountTestComponent<RenderOnHotReload>();
}

Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public ServerInteropTestDefaultExceptionsBehavior(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: true);
Navigate(ServerPathBase);
Browser.MountTestComponent<InteropComponent>();
}

Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ public ServerInteropTestJsInvocationsTimeoutsBehavior(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: true);
Navigate(ServerPathBase);
Browser.MountTestComponent<LongRunningInterop>();
}

Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ public ServerReconnectionTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: false);
Navigate(ServerPathBase);
Browser.MountTestComponent<ReconnectionComponent>();
Browser.Exists(By.Id("count"));
}
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ public BinaryHttpClientTest(

protected override void InitializeAsyncCore()
{
Browser.Navigate(_devHostServerFixture.RootUri, "/subdir", noReload: true);
Browser.Navigate(_devHostServerFixture.RootUri, "/subdir");
_appElement = Browser.MountTestComponent<BinaryHttpRequestsComponent>();
}

2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/BindTest.cs
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ public BindTest(
protected override void InitializeAsyncCore()
{
// On WebAssembly, page reloads are expensive so skip if possible
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
Browser.MountTestComponent<BindCasesComponent>();
Browser.Exists(By.Id("bind-cases"));
}
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/CascadingValueTest.cs
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ public CascadingValueTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
Browser.MountTestComponent<BasicTestApp.CascadingValueTest.CascadingValueSupplier>();
}

2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/CircuitTests.cs
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public CircuitTests(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: false);
Navigate(ServerPathBase);
}

[Theory]
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ public ComponentRenderingTestBase(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
}

[Fact]
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/CustomElementsTest.cs
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ public CustomElementsTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: false);
Navigate(ServerPathBase);
app = Browser.MountTestComponent<CustomElementsComponent>();
}

Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ public DynamicComponentRenderingTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
app = Browser.MountTestComponent<DynamicComponentRendering>();
testCasePicker = new SelectElement(app.FindElement(By.Id("dynamic-component-case-picker")));
}
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/ErrorBoundaryTest.cs
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ public ErrorBoundaryTest(BrowserFixture browserFixture, ToggleExecutionModeServe
protected override void InitializeAsyncCore()
{
// Many of these tests trigger fatal exceptions, so we always have to reload
Navigate(ServerPathBase, noReload: false);
Navigate(ServerPathBase);
Browser.MountTestComponent<ErrorBoundaryContainer>();
}

Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ public ErrorNotificationTest(
protected override void InitializeAsyncCore()
{
// On WebAssembly, page reloads are expensive so skip if possible
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
Browser.MountTestComponent<ErrorComponent>();
Browser.Exists(By.Id("blazor-error-ui"));
Browser.Exists(By.Id("throw-simple-exception"));
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/EventBubblingTest.cs
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ public EventBubblingTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
Browser.MountTestComponent<EventBubblingComponent>();
Browser.Exists(By.Id("event-bubbling"));
}
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/EventCallbackTest.cs
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ public EventCallbackTest(
protected override void InitializeAsyncCore()
{
// On WebAssembly, page reloads are expensive so skip if possible
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
Browser.MountTestComponent<BasicTestApp.EventCallbackTest.EventCallbackCases>();
}

2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/EventCustomArgsTest.cs
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public EventCustomArgsTest(
protected override void InitializeAsyncCore()
{
// Always do a full page reload because these tests need to start with no custom event registrations
Navigate(ServerPathBase, noReload: false);
Navigate(ServerPathBase);
Browser.MountTestComponent<EventCustomArgsComponent>();
}

2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/EventTest.cs
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ public EventTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: true);
Navigate(ServerPathBase);
}

[Fact]
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/FormsInputDateTest.cs
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ public FormsInputDateTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
}

[Fact]
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/FormsTest.cs
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ public FormsTest(
protected override void InitializeAsyncCore()
{
// On WebAssembly, page reloads are expensive so skip if possible
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
}

protected virtual IWebElement MountSimpleValidationComponent()
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ public HeadModificationTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
}

[Fact]
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public HostedInAlternativeBasePathTest(

protected override void InitializeAsyncCore()
{
Navigate("/app/", noReload: true);
Navigate("/app/");
WaitUntilLoaded();
}

2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/HostedInAspNetTest.cs
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ public HostedInAspNetTest(

protected override void InitializeAsyncCore()
{
Navigate("/", noReload: true);
Navigate("/");
WaitUntilLoaded();
}

2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/HttpClientTest.cs
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ protected override void InitializeAsyncCore()
{
base.InitializeAsyncCore();

Browser.Navigate(_serverFixture.RootUri, "/subdir", noReload: true);
Browser.Navigate(_serverFixture.RootUri, "/subdir");
_appElement = Browser.MountTestComponent<HttpRequestsComponent>();
}

2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/InputActionsTest.cs
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public InputFocusTest(
protected override void InitializeAsyncCore()
{
// On WebAssembly, page reloads are expensive so skip if possible
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
}

protected virtual IWebElement MountInputActionsComponent()
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/InputFileTest.cs
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ protected override void InitializeAsyncCore()
_tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(_tempDirectory);

Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
Browser.MountTestComponent<InputFileComponent>();
}

2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/InteropTest.cs
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ public InteropTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: true);
Navigate(ServerPathBase);
Browser.MountTestComponent<InteropComponent>();
}

Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ public JSRootComponentsTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: false);
Navigate(ServerPathBase);
app = Browser.MountTestComponent<JavaScriptRootComponents>();
}

Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ public JsonSerializationTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
Browser.MountTestComponent<JsonSerializationCases>();
Browser.Exists(By.Id("json-serialization-cases"));
}
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/KeyTest.cs
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ public KeyTest(
protected override void InitializeAsyncCore()
{
// On WebAssembly, page reloads are expensive so skip if possible
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
}

[Fact]
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public MultipleHostedAppTest(

protected override void InitializeAsyncCore()
{
Navigate("/", noReload: true);
Navigate("/");
WaitUntilLoaded();
}

2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/PerformanceTest.cs
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ public PerformanceTest(

protected override void InitializeAsyncCore()
{
Navigate("/", noReload: true);
Navigate("/");
}

public override Task InitializeAsync() => base.InitializeAsync(Guid.NewGuid().ToString());
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public PropertyInjectionTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: false);
Navigate(ServerPathBase);
Browser.MountTestComponent<PropertyInjectionComponent>();
}

Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ public ProtectedBrowserStorageInjectionTest(

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Navigate(ServerPathBase);
Browser.MountTestComponent<ProtectedBrowserStorageInjectionComponent>();
}

Loading