Skip to content

Commit 18ee068

Browse files
committed
Try on CI if tests run with small or big window (toggle bar has problems locally because it runs in a small window).
1 parent 7ac455c commit 18ee068

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@page "/"
22

3-
<h1>Hello, world!</h1>
3+
<h1 id="session-storage-anchor">Hello, world!</h1>
44

55
Welcome to your new app.

src/Components/test/E2ETest/Infrastructure/ServerTestBase.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.AspNetCore.Components.E2ETests.ServerRenderingTests;
66
using Microsoft.AspNetCore.E2ETesting;
77
using OpenQA.Selenium;
8+
using OpenQA.Selenium.BiDi.Communication;
89
using Xunit.Abstractions;
910

1011
namespace Microsoft.AspNetCore.Components.E2ETest.Infrastructure;
@@ -14,17 +15,20 @@ public abstract class ServerTestBase<TServerFixture>
1415
IClassFixture<TServerFixture>
1516
where TServerFixture : ServerFixture
1617
{
17-
public string ServerPathBase => "/subdir";
18+
private string _serverPathBase;
19+
public string ServerPathBase => _serverPathBase;
1820

1921
protected readonly TServerFixture _serverFixture;
2022

2123
public ServerTestBase(
2224
BrowserFixture browserFixture,
2325
TServerFixture serverFixture,
24-
ITestOutputHelper output)
26+
ITestOutputHelper output,
27+
string serverPathBase = "/subdir")
2528
: base(browserFixture, output)
2629
{
2730
_serverFixture = serverFixture;
31+
_serverPathBase = serverPathBase;
2832
}
2933

3034
public void Navigate(string relativeUrl)

src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTestUtil.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private static void NavigateToOrigin<TServerFixture>(ServerTestBase<TServerFixtu
104104
{
105105
// Navigate to the test origin to ensure the browser is on the correct state to access sessionStorage
106106
fixture.Navigate($"{fixture.ServerPathBase}/");
107-
fixture.Browser.Equal("Hello", () => fixture.Browser.Exists(By.TagName("h1")).Text);
107+
fixture.Browser.Exists(By.Id("session-storage-anchor"));
108108
}
109109

110110
private static string GrantTestIdCore(IWebDriver browser)

src/Components/test/E2ETest/Tests/StandaloneAppTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public StandaloneAppTest(
1616
BrowserFixture browserFixture,
1717
BlazorWasmTestAppFixture<StandaloneApp.Program> serverFixture,
1818
ITestOutputHelper output)
19-
: base(browserFixture, serverFixture, output)
19+
: base(browserFixture, serverFixture, output, "")
2020
{
2121
}
2222

src/Components/test/testassets/BasicTestApp/Index.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@inject NavigationManager NavigationManager
44

55
<div id="test-selector">
6-
<h1 style="margin: 0; padding: 0; line-height: 1;">Hello</h1>
6+
<h1 id="session-storage-anchor" style="margin: 0; padding: 0; line-height: 1;">Hello</h1>
77
Select test:
88
<select id="test-selector-select" @bind=SelectedComponentTypeName>
99
<option value="none">Choose...</option>

src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Index.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
<PageTitle>Home</PageTitle>
44

5-
<h1>Hello</h1>
5+
<h1 id="session-storage-anchor">Hello</h1>
66

77
<p>This is a Razor Component endpoint.</p>

0 commit comments

Comments
 (0)