Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: get rid of separate TestServer package #3035

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions src/Playwright.Tests.TestServer/Playwright.Tests.TestServer.csproj

This file was deleted.

27 changes: 0 additions & 27 deletions src/Playwright.Tests.TestServer/Properties/launchSettings.json

This file was deleted.

2 changes: 0 additions & 2 deletions src/Playwright.Tests/Assertions/APIResponseAssertionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* SOFTWARE.
*/

using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests.Assertions;

public class APIResponseAssertionsTests : PageTestEx
Expand Down
2 changes: 1 addition & 1 deletion src/Playwright.Tests/BaseTests/HttpService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static Task<HttpService> Register(WorkerAwareTest test)
var workerIndex = test.WorkerIndex;
return test.RegisterService("Http", async () =>
{
var assetDir = Path.Combine(TestUtils.FindParentDirectory("Playwright.Tests.TestServer"), "assets");
var assetDir = Path.Combine(TestUtils.FindParentDirectory("Playwright.Tests"), "assets");
var http = new HttpService
{
Server = SimpleServer.Create(8907 + workerIndex * 2, assetDir),
Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/BrowserContextBasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/

using System.Net;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
2 changes: 0 additions & 2 deletions src/Playwright.Tests/BrowserContextEventsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* SOFTWARE.
*/

using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

public class BrowserContextEventsTests : PageTestEx
Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/BrowserContextFetchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/BrowserTypeConnectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
using System.Diagnostics;
using System.IO.Compression;
using System.Text;
using Microsoft.AspNetCore.Http;
using Microsoft.Playwright.Helpers;

namespace Microsoft.Playwright.Tests;
Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/CapabilitiesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

using System.Globalization;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
3 changes: 0 additions & 3 deletions src/Playwright.Tests/ClientCertficatesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

using System.Net;
using System.Security.Cryptography.X509Certificates;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.Kestrel.Https;

namespace Microsoft.Playwright.Tests;
Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/DefaultBrowserContext1Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

using System.Net;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
2 changes: 0 additions & 2 deletions src/Playwright.Tests/DownloadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* SOFTWARE.
*/

using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

///<playwright-file>download.spec.ts</playwright-file>
Expand Down
2 changes: 0 additions & 2 deletions src/Playwright.Tests/DownloadsPathTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* SOFTWARE.
*/

using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

public class DownloadsPathTests : PlaywrightTestEx
Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/FrameGoToTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/

using System.Net;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/GlobalFetchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
using System.Globalization;
using System.Text;
using System.Text.Json;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/IgnoreHttpsErrorsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/

using System.Net;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
2 changes: 0 additions & 2 deletions src/Playwright.Tests/PageAutoWaitingBasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* SOFTWARE.
*/

using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

public class PageAutoWaitingBasicTests : PageTestEx
Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/PageClockTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

using System.Text.Json;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/PageGotoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

using System.Globalization;
using System.Net;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
2 changes: 0 additions & 2 deletions src/Playwright.Tests/PageNavigationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* SOFTWARE.
*/

using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

public class PageNavigationTests : PageTestEx
Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/PageNetworkIdleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Net;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/PageNetworkRequestTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

using System.Text.Json;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/PageNetworkResponseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
using System.Net;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;

namespace Microsoft.Playwright.Tests;
Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/PageRequestFulfillTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

using System.Net;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/PageRequestInterceptTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

using System.Text.Json;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/PageRouteTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
using System.Globalization;
using System.Net;
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives;

namespace Microsoft.Playwright.Tests;
Expand Down
2 changes: 0 additions & 2 deletions src/Playwright.Tests/PageWaitForLoadStateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
* SOFTWARE.
*/

using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

///<playwright-file>page-wait-for-load-state.ts</playwright-file>
Expand Down
1 change: 0 additions & 1 deletion src/Playwright.Tests/PageWaitForUrlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
9 changes: 7 additions & 2 deletions src/Playwright.Tests/Playwright.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<LangVersion>12</LangVersion>
Expand All @@ -11,6 +11,12 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<Import Project="../Common/SignAssembly.props" />
<ItemGroup>
<None Update="TestServer/key.pfx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Folder Include="assets\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -27,7 +33,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Playwright\Playwright.csproj" />
<ProjectReference Include="..\Playwright.Tests.TestServer\Playwright.Tests.TestServer.csproj" />
<ProjectReference Include="..\Playwright.NUnit\Playwright.NUnit.csproj" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion src/Playwright.Tests/ProxyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

using System.Text;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

Expand Down
2 changes: 0 additions & 2 deletions src/Playwright.Tests/ResourceTimingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* SOFTWARE.
*/

using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests;

///<playwright-file>resource-timing.spec.ts</playwright-file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,16 @@
* SOFTWARE.
*/

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Net.WebSockets;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NUnit.Framework.Internal;

namespace Microsoft.Playwright.Tests.TestServer;
Expand Down Expand Up @@ -155,7 +145,7 @@ public SimpleServer(int port, string contentRoot, bool isHttps)
{
if (isHttps)
{
var cert = new X509Certificate2("key.pfx", "aaaa");
var cert = new X509Certificate2("TestServer/key.pfx", "aaaa");
options.Listen(IPAddress.Loopback, port, listenOptions => listenOptions.UseHttps(cert));
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
* SOFTWARE.
*/

using System;
using System.Net.WebSockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;

namespace Microsoft.Playwright.Tests.TestServer;

Expand Down
2 changes: 1 addition & 1 deletion src/Playwright.Tests/TestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ internal static async Task RegisterEngineWithPathAsync(IPlaywright playwright, s
}
}

internal static string GetAsset(string path) => Path.Combine(FindParentDirectory("Playwright.Tests.TestServer"), "assets", path);
internal static string GetAsset(string path) => Path.Combine(FindParentDirectory("Playwright.Tests"), "assets", path);

internal static async Task VerifyViewportAsync(IPage page, int width, int height)
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading