Skip to content

Commit

Permalink
test: install Playwright within NUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
mu88 committed Nov 5, 2023
1 parent a346b13 commit bb02cce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ jobs:
dotnet sonarscanner begin /k:mu88_ScreenshotCreator /o:mu88 /d:sonar.token=${{ secrets.SONAR_TOKEN }} /d:sonar.host.url=https://sonarcloud.io /d:sonar.cs.opencover.reportsPaths=tests/Tests/coverage.opencover.xml
- name: Build
run: dotnet build --no-restore ScreenshotCreator.sln
- name: Install Playwright for tests
run: 'src/ScreenshotCreator.Api/bin/Debug/net7.0/playwright.ps1 install chromium'
shell: pwsh
- name: Test and collect coverage
run: dotnet test --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover '/p:ExcludeByFile=\"**/Log.Prefix.cs\"'
- name: End Sonar scan
Expand Down
2 changes: 1 addition & 1 deletion tests/Tests/Integration/Api/ProgramTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Tests.Integration.Api;

[TestFixture]
[Category("Integration")]
public class ProgramTests
public class ProgramTests : PlaywrightTests
{
private HttpClient _clientForAny = null!;

Expand Down
11 changes: 11 additions & 0 deletions tests/Tests/PlaywrightTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Diagnostics;

namespace Tests;

public class PlaywrightTests
{
[SetUp]
public void InstallPlaywright() =>
Process.Start(new ProcessStartInfo("pwsh", "playwright.ps1 install chromium") { CreateNoWindow = true, UseShellExecute = false })
?.WaitForExit();
}

0 comments on commit bb02cce

Please sign in to comment.