Fixes the UI testing wwwroot
This commit is contained in:
parent
e83ef7730b
commit
e137c3e2ff
10 changed files with 35 additions and 14 deletions
|
|
@ -1,16 +1,35 @@
|
|||
using System;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Chrome;
|
||||
using OpenQA.Selenium.Firefox;
|
||||
using Xunit.Abstractions;
|
||||
using yavscTests;
|
||||
using yavscTests.ServerFixtures;
|
||||
|
||||
namespace SeleniumDocs.GettingStarted;
|
||||
|
||||
public static class FirstScript
|
||||
{
|
||||
public static void DoTestSeleniumWebSite()
|
||||
{
|
||||
IWebDriver driver = new ChromeDriver();
|
||||
|
||||
driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/web-form.html");
|
||||
[Collection("Yavsc Server")]
|
||||
public class FirstScript : BaseTestContext
|
||||
{
|
||||
public readonly WebServerFixture _serverFixture;
|
||||
readonly ITestOutputHelper _output;
|
||||
|
||||
public FirstScript(ITestOutputHelper output, WebServerFixture fixture) : base(output, fixture)
|
||||
{
|
||||
_serverFixture = fixture;
|
||||
this._output = output;
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void DoTestSeleniumWebSite()
|
||||
{
|
||||
var firefoxOptions = new FirefoxOptions();
|
||||
firefoxOptions.AcceptInsecureCertificates = true;
|
||||
|
||||
var driver = new FirefoxDriver(firefoxOptions);
|
||||
driver.Navigate().GoToUrl(_serverFixture.Addresses.FirstOrDefault(u => u.StartsWith("https:")));
|
||||
|
||||
var title = driver.Title;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Yavsc.Models;
|
|||
using Xunit.Abstractions;
|
||||
using Yavsc.Server.Models.IT.SourceCode;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using isnd.tests;
|
||||
using yavscTests.ServerFixtures;
|
||||
using Yavsc.Server.Models.IT;
|
||||
|
||||
namespace yavscTests
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Net.Security;
|
||||
using isnd.tests;
|
||||
using yavscTests.ServerFixtures;
|
||||
using Xunit.Abstractions;
|
||||
using IdentityModel.Client;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using isnd.tests;
|
||||
using yavscTests.ServerFixtures;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace yavscTests.Mandatory;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using isnd.tests;
|
||||
using yavscTests.ServerFixtures;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace yavscTests.Mandatory
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using isnd.tests;
|
||||
using yavscTests.ServerFixtures;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Xunit.Abstractions;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ using Yavsc.Extensions;
|
|||
using Yavsc.Models;
|
||||
using Client = IdentityServer8.EntityFramework.Entities.Client;
|
||||
|
||||
namespace isnd.tests
|
||||
namespace yavscTests.ServerFixtures
|
||||
{
|
||||
|
||||
[CollectionDefinition("Web server collection")]
|
||||
|
|
@ -120,8 +120,10 @@ namespace isnd.tests
|
|||
var builder = WebApplication.CreateBuilder();
|
||||
builder.Environment.EnvironmentName = "Development";
|
||||
// Set ContentRoot to the Yavsc.Org project directory so WebRootPath resolves correctly
|
||||
var testAssemblyLocation = AppDomain.CurrentDomain.BaseDirectory;
|
||||
var yavscOrgPath = Path.GetFullPath(Path.Combine(testAssemblyLocation, "../../src/Yavsc.Org"));
|
||||
var cwd = System.IO.Directory.GetCurrentDirectory();
|
||||
var yavscOrgPath = Path.GetFullPath(
|
||||
Path.Combine(cwd,
|
||||
"../../../../../src/Yavsc.Org"));
|
||||
builder.Environment.ContentRootPath = yavscOrgPath;
|
||||
|
||||
builder.Configuration
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue