Skip to content

Commit 0eac04d

Browse files
First tests added
1 parent abd3aff commit 0eac04d

4 files changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<LangVersion>latest</LangVersion>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<EnableMSTestRunner>true</EnableMSTestRunner>
9+
<OutputType>Exe</OutputType>
10+
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
11+
<!--
12+
Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
13+
For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
14+
-->
15+
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
16+
</PropertyGroup>
17+
18+
<ItemGroup>
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
20+
<PackageReference Include="Microsoft.Playwright.MSTest" Version="1.52.0" />
21+
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.12.6" />
22+
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="1.4.3" />
23+
<PackageReference Include="MSTest" Version="3.6.4" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
28+
</ItemGroup>
29+
30+
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Microsoft.Playwright;
2+
using Microsoft.Playwright.MSTest;
3+
4+
namespace AudioCuesheetEditor.End2EndTests.Pages
5+
{
6+
[TestClass]
7+
public class AboutTest : PageTest
8+
{
9+
[TestMethod]
10+
public async Task HasTitle()
11+
{
12+
await Page.GotoAsync("https://localhost:7132/about");
13+
await Expect(Page).ToHaveTitleAsync("AudioCuesheetEditor");
14+
await Expect(Page.GetByRole(AriaRole.Heading, new() { Name = "About AudioCuesheetEditor" })).ToBeVisibleAsync();
15+
}
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Microsoft.Playwright;
2+
using Microsoft.Playwright.MSTest;
3+
4+
namespace AudioCuesheetEditor.End2EndTests.Pages
5+
{
6+
[TestClass]
7+
public class IndexTest : PageTest
8+
{
9+
[TestMethod]
10+
public async Task HasTitle()
11+
{
12+
await Page.GotoAsync("https://localhost:7132/");
13+
await Expect(Page).ToHaveTitleAsync("AudioCuesheetEditor");
14+
await Expect(Page.GetByRole(AriaRole.Button, new() { Name = "AudioCuesheetEditor" })).ToBeVisibleAsync();
15+
}
16+
}
17+
}

AudioCuesheetEditor.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AudioCuesheetEditor", "Audi
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AudioCuesheetEditor.Tests", "AudioCuesheetEditor.Tests\AudioCuesheetEditor.Tests.csproj", "{12CA5D1F-D758-4016-85D0-A045AC06CFE6}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AudioCuesheetEditor.End2EndTests", "AudioCuesheetEditor.End2EndTests\AudioCuesheetEditor.End2EndTests.csproj", "{7297DF58-3F83-49E9-B714-B2BE29D08180}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1214
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +23,10 @@ Global
2123
{12CA5D1F-D758-4016-85D0-A045AC06CFE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
2224
{12CA5D1F-D758-4016-85D0-A045AC06CFE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
2325
{12CA5D1F-D758-4016-85D0-A045AC06CFE6}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{7297DF58-3F83-49E9-B714-B2BE29D08180}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{7297DF58-3F83-49E9-B714-B2BE29D08180}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{7297DF58-3F83-49E9-B714-B2BE29D08180}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{7297DF58-3F83-49E9-B714-B2BE29D08180}.Release|Any CPU.Build.0 = Release|Any CPU
2430
EndGlobalSection
2531
GlobalSection(SolutionProperties) = preSolution
2632
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)