Skip to content

Test fixes #54825

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 4 commits into from
Mar 28, 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
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
<NewtonsoftJsonBsonVersion>1.0.2</NewtonsoftJsonBsonVersion>
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
<NSwagApiDescriptionClientVersion>13.0.4</NSwagApiDescriptionClientVersion>
<PhotinoNETVersion>2.4.0</PhotinoNETVersion>
<PhotinoNETVersion>2.5.2</PhotinoNETVersion>
<MicrosoftPlaywrightVersion>1.28.0</MicrosoftPlaywrightVersion>
<PollyExtensionsHttpVersion>3.0.0</PollyExtensionsHttpVersion>
<PollyVersion>7.2.4</PollyVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ public void SubmitButtonFormenctypeAttributeOverridesEnhancedFormEnctype()
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/54757")]
public void EnhancedFormThatCallsNavigationManagerRefreshDoesNotPushHistoryEntry()
{
GoTo("about:blank");
Navigate("about:blank");

var startUrl = Browser.Url;
GoTo("forms/form-that-calls-navigation-manager-refresh");
Expand All @@ -1492,7 +1492,7 @@ public void EnhancedFormThatCallsNavigationManagerRefreshDoesNotPushHistoryEntry
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/54757")]
public void EnhancedFormThatCallsNavigationManagerRefreshDoesNotPushHistoryEntry_Streaming()
{
GoTo("about:blank");
Navigate("about:blank");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GoTo was producing wrong results because only accepts relative URLs. Navigate works with about:blank.


var startUrl = Browser.Url;
GoTo("forms/form-that-calls-navigation-manager-refresh-streaming");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Microsoft.AspNetCore.Components.E2ETest.Tests;

public class ThreadingHostedAppTest
: ServerTestBase<ThreadingHostedAppTest.ThreadingAppServerSiteFixture>, IDisposable
: ServerTestBase<ThreadingHostedAppTest.ThreadingAppServerSiteFixture>
{
public class ThreadingAppServerSiteFixture : AspNetSiteServerFixture
{
Expand Down Expand Up @@ -110,11 +110,4 @@ private void WaitUntilLoaded()
var app = Browser.Exists(By.TagName("app"));
Browser.NotEqual("Loading...", () => app.Text);
}

public void Dispose()
{
// Make the tests run faster by navigating back to the home page when we are done
// If we don't, then the next test will reload the whole page before it starts
Browser.Exists(By.LinkText("Home")).Click();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the multithreading case, this happens too late and was trying to reach the DOM after the page is gone. Fortunately we just don't even need this optimization.

}
}
9 changes: 1 addition & 8 deletions src/Components/test/E2ETest/Tests/ThreadingAppTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Microsoft.AspNetCore.Components.E2ETest.Tests;

public class ThreadingAppTest
: ServerTestBase<BlazorWasmTestAppFixture<ThreadingApp.Program>>, IDisposable
: ServerTestBase<BlazorWasmTestAppFixture<ThreadingApp.Program>>
{
public ThreadingAppTest(
BrowserFixture browserFixture,
Expand Down Expand Up @@ -127,11 +127,4 @@ private void WaitUntilLoaded()
var app = Browser.Exists(By.TagName("app"));
Browser.NotEqual("Loading...", () => app.Text);
}

public void Dispose()
{
// Make the tests run faster by navigating back to the home page when we are done
// If we don't, then the next test will reload the whole page before it starts
Browser.Exists(By.LinkText("Home")).Click();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this no longer help?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the multithreading case, this happens too late and was trying to reach the DOM after the page is gone. Fortunately we just don't even need this optimization - it's fine to reload the page between tests, and makes them more isolated/robust anyway.

}
}
Loading