// 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 Microsoft.AspNetCore.E2ETesting; using Microsoft.Extensions.CommandLineUtils; using OpenQA.Selenium; using ProjectTemplates.Tests.Helpers; using System.IO; using System.Net; using System.Threading; using Templates.Test.Helpers; using Xunit; using Xunit.Abstractions; namespace Templates.Test { public class RazorComponentsTemplateTest : BrowserTestBase { public RazorComponentsTemplateTest(ProjectFactoryFixture projectFactory, BrowserFixture browserFixture, ITestOutputHelper output) : base(browserFixture, output) { Project = projectFactory.CreateProject(output); } public Project Project { get; } [Fact(Skip = "https://github.com/aspnet/AspNetCore/issues/8244")] public void RazorComponentsTemplateWorks() { Project.RunDotNetNew("razorcomponents"); TestApplication(publish: false); TestApplication(publish: true); } private void TestApplication(bool publish) { using (var aspNetProcess = Project.StartAspNetProcess(publish)) { aspNetProcess.AssertStatusCode("/", HttpStatusCode.OK, "text/html"); if (BrowserFixture.IsHostAutomationSupported()) { aspNetProcess.VisitInBrowser(Browser); TestBasicNavigation(); } } } private void TestBasicNavigation() { // Give components.server enough time to load so that it can replace // the prerendered content before we start making assertions. Thread.Sleep(5000); Browser.WaitForElement("ul"); //