Skip to content
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 @@ -14,6 +14,8 @@ namespace Microsoft.AspNetCore.Components.E2ETests.Tests;

public class SectionsWithCascadingParametersTest : ServerTestBase<ToggleExecutionModeServerFixture<Program>>
{
private IWebElement _appElement;

public SectionsWithCascadingParametersTest
(BrowserFixture browserFixture,
ToggleExecutionModeServerFixture<Program> serverFixture,
Expand All @@ -25,7 +27,7 @@ public SectionsWithCascadingParametersTest
protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Browser.MountTestComponent<BasicTestApp.SectionsTest.SectionsWithCascadingParameters>();
_appElement = Browser.MountTestComponent<BasicTestApp.SectionsTest.SectionsWithCascadingParameters>();
}

[Fact]
Expand All @@ -35,7 +37,7 @@ public void RenderSectionContent_CascadingParameterForSectionOutletIsDeterminedB
Browser.FindElement(By.Id("render-section-outlet")).Click();
Browser.FindElement(By.Id("render-second-section-content")).Click();

Browser.Equal("Second Section with additional text for second section", () => Browser.Exists(By.TagName("p")).Text);
Browser.Equal("Second Section with additional text for second section", () => _appElement.FindElement(By.TagName("p")).Text);
}

[Fact]
Expand All @@ -46,7 +48,7 @@ public void ChangeCascadingValueForSectionContent_CascadingValueForSectionOutlet

Browser.FindElement(By.Id("change-cascading-value")).Click();

Browser.Equal("First Section with additional text for second section", () => Browser.Exists(By.TagName("p")).Text);
Browser.Equal("First Section with additional text for second section", () => _appElement.FindElement(By.TagName("p")).Text);
}

[Fact]
Expand All @@ -56,7 +58,7 @@ public void RenderTwoSectionContentsWithSameId_CascadingParameterForSectionOutle
Browser.FindElement(By.Id("render-first-section-content")).Click();
Browser.FindElement(By.Id("render-section-outlet")).Click();

Browser.Equal("First Section with additional text for first section", () => Browser.Exists(By.TagName("p")).Text);
Browser.Equal("First Section with additional text for first section", () => _appElement.FindElement(By.TagName("p")).Text);
}

[Fact]
Expand All @@ -68,7 +70,7 @@ public void SecondSectionContentIdChanged_CascadingParameterForSectionOutletIsDe

Browser.FindElement(By.Id("change-second-section-content-id")).Click();

Browser.Equal("First Section with additional text for first section", () => Browser.Exists(By.TagName("p")).Text);
Browser.Equal("First Section with additional text for first section", () => _appElement.FindElement(By.TagName("p")).Text);
}

[Fact]
Expand All @@ -80,7 +82,7 @@ public void SecondSectionContentDisposed_CascadingParameterForSectionOutletIsDet

Browser.FindElement(By.Id("dispose-second-section-content")).Click();

Browser.Equal("First Section with additional text for first section", () => Browser.Exists(By.TagName("p")).Text);
Browser.Equal("First Section with additional text for first section", () => _appElement.FindElement(By.TagName("p")).Text);
}

[Fact]
Expand All @@ -92,7 +94,7 @@ public void FirstSectionContentDisposedThenRenderSecondSectionContent_CascadingP
Browser.FindElement(By.Id("dispose-first-section-content")).Click();
Browser.FindElement(By.Id("render-second-section-content")).Click();

Browser.Equal("Second Section with additional text for second section", () => Browser.Exists(By.TagName("p")).Text);
Browser.Equal("Second Section with additional text for second section", () => _appElement.FindElement(By.TagName("p")).Text);
}

[Fact]
Expand All @@ -105,6 +107,6 @@ public void SectionOutletIdChanged_CascadingParameterForSectionOutletIsDetermine

Browser.FindElement(By.Id("change-section-outlet-id")).Click();

Browser.Equal("Second Section with additional text for second section", () => Browser.Exists(By.TagName("p")).Text);
Browser.Equal("Second Section with additional text for second section", () => _appElement.FindElement(By.TagName("p")).Text);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace Microsoft.AspNetCore.Components.E2ETests.Tests;

public class SectionsWithErrorBoundaryTest : ServerTestBase<ToggleExecutionModeServerFixture<Program>>
{
private IWebElement _appElement;

public SectionsWithErrorBoundaryTest
(BrowserFixture browserFixture,
ToggleExecutionModeServerFixture<Program> serverFixture,
Expand All @@ -25,7 +27,7 @@ public SectionsWithErrorBoundaryTest
protected override void InitializeAsyncCore()
{
Navigate(ServerPathBase, noReload: _serverFixture.ExecutionMode == ExecutionMode.Client);
Browser.MountTestComponent<BasicTestApp.SectionsTest.SectionsWithErrorBoundary>();
_appElement = Browser.MountTestComponent<BasicTestApp.SectionsTest.SectionsWithErrorBoundary>();
}

[Fact]
Expand All @@ -37,7 +39,7 @@ public void RenderSectionContent_ErrorBoundaryForSectionOutletContentIsDetermine

Browser.FindElement(By.Id("error-button")).Click();

Browser.Equal("Sorry!", () => Browser.Exists(By.TagName("p")).Text);
Browser.Equal("Sorry!", () => _appElement.FindElement(By.TagName("p")).Text);
}

[Fact]
Expand Down Expand Up @@ -88,7 +90,7 @@ public void FirstSectionContentDisposedThenRenderSecondSectionContent_ErrorBound
Browser.FindElement(By.Id("render-second-section-content")).Click();
Browser.FindElement(By.Id("error-button")).Click();

Browser.Equal("Sorry!", () => Browser.Exists(By.TagName("p")).Text);
Browser.Equal("Sorry!", () => _appElement.FindElement(By.TagName("p")).Text);
}

[Fact]
Expand All @@ -102,6 +104,6 @@ public void SectionOutletIdChanged_ErrorBoundaryForSectionOutletIsDeterminedByMa
Browser.FindElement(By.Id("change-section-outlet-id")).Click();
Browser.FindElement(By.Id("error-button")).Click();

Browser.Equal("Sorry!", () => Browser.Exists(By.TagName("p")).Text);
Browser.Equal("Sorry!", () => _appElement.FindElement(By.TagName("p")).Text);
}
}
Loading