Skip to content

Commit

Permalink
test: get rid of separate TestServer package
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Nov 5, 2024
1 parent 70d67ad commit ca8abf6
Show file tree
Hide file tree
Showing 220 changed files with 18 additions and 141 deletions.
3 changes: 0 additions & 3 deletions src/Playwright.Examples/Playwright.Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<ReleaseVersion>0.0.0</ReleaseVersion>
</PropertyGroup>

<!-- Required since we're not actually referencing Playwright -->
<Import Project="../Playwright.Tests/build/Playwright.Tests.targets" />

<ItemGroup>
<ProjectReference Include="..\Playwright\Playwright.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
</PropertyGroup>
<Import Project="../Common/SignAssembly.props" />

<!-- Required since we're not actually referencing Playwright -->
<Import Project="../Playwright.Tests/build/Playwright.Tests.targets" />

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
Expand All @@ -19,6 +16,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Playwright\Playwright.csproj" />
<ProjectReference Include="..\Playwright.MSTest\Playwright.MSTest.csproj" />
<ProjectReference Include="..\Playwright.NUnit\Playwright.NUnit.csproj" />
</ItemGroup>
Expand Down
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
10 changes: 7 additions & 3 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,7 +11,12 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<Import Project="../Common/SignAssembly.props" />
<Import Project="build/Playwright.Tests.targets" />
<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 @@ -28,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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ca8abf6

Please sign in to comment.