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
Show file tree
Hide file tree
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
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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

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

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

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

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

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

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

protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: false);
Navigate(ServerPathBase);
Browser.MountTestComponent<ReconnectionComponent>();
Browser.Exists(By.Id("count"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/BindTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/CascadingValueTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public CascadingValueTest(

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

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

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

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

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/ErrorBoundaryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/EventBubblingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/EventCallbackTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/EventCustomArgsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
}

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

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

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

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

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/FormsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public HeadModificationTest(

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

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/HttpClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/InputActionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/InputFileTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
}

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

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/test/E2ETest/Tests/KeyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public MultipleHostedAppTest(

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

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

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

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

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

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

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

Expand Down
Loading
Loading