Fix and identify flaky components E2E Tests (#8690)

This commit is contained in:
Javier Calvarro Nelson 2019-03-21 07:39:47 +01:00 committed by GitHub
parent 69732c9ecc
commit 5f4be179e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 8 deletions

View File

@ -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");

View File

@ -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>();

View File

@ -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>

View File

@ -1,5 +1,5 @@
@page "/"
@page "/"
<h1>Hello, world!</h1>
<h1 id="index">Hello, world!</h1>
Welcome to your new app.