Fix and identify flaky components E2E Tests (#8690)
This commit is contained in:
parent
69732c9ecc
commit
5f4be179e3
|
|
@ -1,14 +1,13 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure;
|
||||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
|
||||
using Microsoft.AspNetCore.E2ETesting;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Support.UI;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
|
|
@ -41,7 +40,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests
|
|||
[Fact]
|
||||
public void HasHeading()
|
||||
{
|
||||
Assert.Equal("Hello, world!", Browser.FindElement(By.TagName("h1")).Text);
|
||||
Browser.Equal("Hello, world!", () => Browser.FindElement(By.CssSelector("h1#index")).Text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -96,7 +95,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests
|
|||
{
|
||||
// Navigate to "Fetch Data"
|
||||
Browser.FindElement(By.LinkText("Fetch data")).Click();
|
||||
Browser.Equal("Weather forecast", () => Browser.FindElement(By.TagName("h1")).Text);
|
||||
Browser.Equal("Weather forecast", () => Browser.FindElement(By.CssSelector("h1#fetch-data")).Text);
|
||||
|
||||
// Wait until loaded
|
||||
var tableSelector = By.CssSelector("table.table");
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using BasicTestApp;
|
|||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure;
|
||||
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
|
||||
using Microsoft.AspNetCore.E2ETesting;
|
||||
using Microsoft.AspNetCore.Testing.xunit;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Interactions;
|
||||
using Xunit;
|
||||
|
|
@ -133,6 +134,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1987")]
|
||||
public void InputEvent_RespondsOnKeystrokes()
|
||||
{
|
||||
MountTestComponent<InputEventComponent>();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
@page "/fetchdata/{StartDate:datetime}"
|
||||
@inject WeatherForecastService ForecastService
|
||||
|
||||
<h1>Weather forecast</h1>
|
||||
<h1 id="fetch-data">Weather forecast</h1>
|
||||
|
||||
<p>This component demonstrates fetching data from the server.</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
@page "/"
|
||||
@page "/"
|
||||
|
||||
<h1>Hello, world!</h1>
|
||||
<h1 id="index">Hello, world!</h1>
|
||||
|
||||
Welcome to your new app.
|
||||
|
|
|
|||
Loading…
Reference in New Issue