mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-28 16:08:38 +00:00
Fix website tests failing
This commit is contained in:
parent
b48f3df4e2
commit
3e031a342f
5 changed files with 36 additions and 6 deletions
|
@ -5,7 +5,7 @@ using Microsoft.OpenApi.Models;
|
||||||
|
|
||||||
namespace LBPUnion.ProjectLighthouse.Servers.API.Startup;
|
namespace LBPUnion.ProjectLighthouse.Servers.API.Startup;
|
||||||
|
|
||||||
public sealed class ApiStartup
|
public class ApiStartup
|
||||||
{
|
{
|
||||||
public ApiStartup(IConfiguration configuration)
|
public ApiStartup(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,7 @@ public sealed class ApiStartup
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
public virtual void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
|
|
15
ProjectLighthouse.Servers.API/Startup/ApiTestStartup.cs
Normal file
15
ProjectLighthouse.Servers.API/Startup/ApiTestStartup.cs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
using LBPUnion.ProjectLighthouse.Helpers.Middlewares;
|
||||||
|
|
||||||
|
namespace LBPUnion.ProjectLighthouse.Servers.API.Startup;
|
||||||
|
|
||||||
|
public class ApiTestStartup : ApiStartup
|
||||||
|
{
|
||||||
|
public ApiTestStartup(IConfiguration configuration) : base(configuration)
|
||||||
|
{}
|
||||||
|
|
||||||
|
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
|
{
|
||||||
|
app.UseMiddleware<FakeRemoteIPAddressMiddleware>();
|
||||||
|
base.Configure(app, env);
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,7 +4,7 @@ using Microsoft.AspNetCore.HttpOverrides;
|
||||||
|
|
||||||
namespace LBPUnion.ProjectLighthouse.Servers.Website.Startup;
|
namespace LBPUnion.ProjectLighthouse.Servers.Website.Startup;
|
||||||
|
|
||||||
public sealed class WebsiteStartup
|
public class WebsiteStartup
|
||||||
{
|
{
|
||||||
public WebsiteStartup(IConfiguration configuration)
|
public WebsiteStartup(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ public sealed class WebsiteStartup
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
public virtual void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
using LBPUnion.ProjectLighthouse.Helpers.Middlewares;
|
||||||
|
|
||||||
|
namespace LBPUnion.ProjectLighthouse.Servers.Website.Startup;
|
||||||
|
|
||||||
|
public class WebsiteTestStartup : WebsiteStartup
|
||||||
|
{
|
||||||
|
public WebsiteTestStartup(IConfiguration configuration) : base(configuration)
|
||||||
|
{}
|
||||||
|
|
||||||
|
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
|
{
|
||||||
|
app.UseMiddleware<FakeRemoteIPAddressMiddleware>();
|
||||||
|
base.Configure(app, env);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using LBPUnion.ProjectLighthouse.Servers.GameServer.Startup;
|
using LBPUnion.ProjectLighthouse.Servers.Website.Startup;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Hosting.Server.Features;
|
using Microsoft.AspNetCore.Hosting.Server.Features;
|
||||||
using OpenQA.Selenium;
|
using OpenQA.Selenium;
|
||||||
|
@ -15,7 +15,7 @@ public class LighthouseWebTest : IDisposable
|
||||||
public readonly string BaseAddress;
|
public readonly string BaseAddress;
|
||||||
|
|
||||||
public readonly IWebDriver Driver;
|
public readonly IWebDriver Driver;
|
||||||
public readonly IWebHost WebHost = new WebHostBuilder().UseKestrel().UseStartup<GameServerTestStartup>().UseWebRoot("StaticFiles").Build();
|
public readonly IWebHost WebHost = new WebHostBuilder().UseKestrel().UseStartup<WebsiteTestStartup>().UseWebRoot("StaticFiles").Build();
|
||||||
|
|
||||||
public LighthouseWebTest()
|
public LighthouseWebTest()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue