Reformatting to be a NunityPlaywright : PageTest

This commit is contained in:
Kira 2023-09-19 12:56:31 -07:00
parent a5b1b40e63
commit 5c127f8f6c
24 changed files with 55 additions and 35 deletions

View File

@ -1,38 +1,28 @@
using Microsoft.Playwright; using Microsoft.Playwright;
using Microsoft.Playwright.NUnit;
using NUnit.Framework; using NUnit.Framework;
namespace PlaywrightDotNetDemo; namespace PlaywrightDotNetDemo;
public class Tests public class NunitPlaywright : PageTest
{ {
[SetUp] [SetUp]
public void Setup() public async Task Setup()
{ {
await Page.GotoAsync("http://eaapp.somee.com");
} }
[Test] [Test]
public async Task Test1() public async Task Test1()
{ {
// Launch Settings await Page.ClickAsync("text=Login");
var launchSettings = new BrowserTypeLaunchOptions
{
Headless = false,
};
// Playwright await Page.FillAsync("#UserName", "admin");
using var playwright = await Playwright.CreateAsync(); await Page.FillAsync("#Password", "password");
// Browser await Page.ClickAsync("text=Log in");
await using var browser = await playwright.Chromium.LaunchAsync(launchSettings);
// Page
var page = await browser.NewPageAsync();
await page.GotoAsync("http://eaapp.somee.com"); await Expect(Page.Locator("text='Employee Details'")).ToBeVisibleAsync();
await page.ClickAsync("text=Login");
await page.ScreenshotAsync(new PageScreenshotOptions
{
Path = "EAapp.jpg"
});
} }
} }

View File

@ -370,12 +370,6 @@
"System.Text.Json/7.0.3": { "System.Text.Json/7.0.3": {
"dependencies": { "dependencies": {
"System.Text.Encodings.Web": "7.0.0" "System.Text.Encodings.Web": "7.0.0"
},
"runtime": {
"lib/net7.0/System.Text.Json.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.723.27404"
}
} }
} }
} }

View File

@ -1 +1 @@
593456585 297669024

View File

@ -1 +1 @@
eb91f97af1d018bd621125691c2f4d4b6b58c683 744970be6cb4cee776ad8f6a61ff4b0a447a00d23f2ad2682d852e2a2e265374

View File

@ -323,7 +323,6 @@ D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0
D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\Newtonsoft.Json.dll D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\Newtonsoft.Json.dll
D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\NuGet.Frameworks.dll D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\NuGet.Frameworks.dll
D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\nunit.framework.dll D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\nunit.framework.dll
D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\System.Text.Json.dll
D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\cs\Microsoft.TestPlatform.CoreUtilities.resources.dll D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\cs\Microsoft.TestPlatform.CoreUtilities.resources.dll
D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\cs\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\cs\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\de\Microsoft.TestPlatform.CoreUtilities.resources.dll D:\Repos\Code\Playwright\Playwright_DotNet\PlaywrightDotNetDemo\bin\Debug\net7.0\de\Microsoft.TestPlatform.CoreUtilities.resources.dll

View File

@ -1 +1 @@
540fa3584d1dbd256ddeec0161dcfcb9997e32cf 490fc1587a314ff5fc874c5815aa1b3fdaad133c04120a7537628d7868d757bb

View File

@ -39,6 +39,9 @@
"warnAsError": [ "warnAsError": [
"NU1605" "NU1605"
] ]
},
"restoreAuditProperties": {
"enableAudit": "default"
} }
}, },
"frameworks": { "frameworks": {
@ -81,12 +84,26 @@
], ],
"assetTargetFallback": true, "assetTargetFallback": true,
"warn": true, "warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[7.0.9, 7.0.9]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[7.0.9, 7.0.9]"
},
{
"name": "Microsoft.WindowsDesktop.App.Ref",
"version": "[7.0.9, 7.0.9]"
}
],
"frameworkReferences": { "frameworkReferences": {
"Microsoft.NETCore.App": { "Microsoft.NETCore.App": {
"privateAssets": "all" "privateAssets": "all"
} }
}, },
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.102\\RuntimeIdentifierGraph.json" "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.100-preview.7.23376.3\\RuntimeIdentifierGraph.json"
} }
} }
} }

View File

@ -7,7 +7,7 @@
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot> <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">D:\Users\Kira\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders> <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">D:\Users\Kira\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle> <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.4.0</NuGetToolVersion> <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.8.0</NuGetToolVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> <ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="D:\Users\Kira\.nuget\packages\" /> <SourceRoot Include="D:\Users\Kira\.nuget\packages\" />

View File

@ -1706,6 +1706,9 @@
"warnAsError": [ "warnAsError": [
"NU1605" "NU1605"
] ]
},
"restoreAuditProperties": {
"enableAudit": "default"
} }
}, },
"frameworks": { "frameworks": {
@ -1748,12 +1751,26 @@
], ],
"assetTargetFallback": true, "assetTargetFallback": true,
"warn": true, "warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[7.0.9, 7.0.9]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[7.0.9, 7.0.9]"
},
{
"name": "Microsoft.WindowsDesktop.App.Ref",
"version": "[7.0.9, 7.0.9]"
}
],
"frameworkReferences": { "frameworkReferences": {
"Microsoft.NETCore.App": { "Microsoft.NETCore.App": {
"privateAssets": "all" "privateAssets": "all"
} }
}, },
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.102\\RuntimeIdentifierGraph.json" "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.100-preview.7.23376.3\\RuntimeIdentifierGraph.json"
} }
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"version": 2, "version": 2,
"dgSpecHash": "U1x+SN4bnyXXcHeQTViSuNBaJmxAD5iBY66IwVDfx4wUNjHSb3ycRXEoTFHSyJZl0DEYHwoPeeGgjSYT5AbBxg==", "dgSpecHash": "2g4DAgnxfvvqOZso+89Kzi0frz4JLJDfJ12izZN8wua2hn+kr4gZ477Vs1ccjB5IzRmm6N/3bCJ1b41YbA2rUw==",
"success": true, "success": true,
"projectFilePath": "D:\\Repos\\Code\\Playwright\\Playwright_DotNet\\PlaywrightDotNetDemo\\PlaywrightDotNetDemo.csproj", "projectFilePath": "D:\\Repos\\Code\\Playwright\\Playwright_DotNet\\PlaywrightDotNetDemo\\PlaywrightDotNetDemo.csproj",
"expectedPackageFiles": [ "expectedPackageFiles": [
@ -23,7 +23,10 @@
"D:\\Users\\Kira\\.nuget\\packages\\system.componentmodel.annotations\\5.0.0\\system.componentmodel.annotations.5.0.0.nupkg.sha512", "D:\\Users\\Kira\\.nuget\\packages\\system.componentmodel.annotations\\5.0.0\\system.componentmodel.annotations.5.0.0.nupkg.sha512",
"D:\\Users\\Kira\\.nuget\\packages\\system.reflection.metadata\\1.6.0\\system.reflection.metadata.1.6.0.nupkg.sha512", "D:\\Users\\Kira\\.nuget\\packages\\system.reflection.metadata\\1.6.0\\system.reflection.metadata.1.6.0.nupkg.sha512",
"D:\\Users\\Kira\\.nuget\\packages\\system.text.encodings.web\\7.0.0\\system.text.encodings.web.7.0.0.nupkg.sha512", "D:\\Users\\Kira\\.nuget\\packages\\system.text.encodings.web\\7.0.0\\system.text.encodings.web.7.0.0.nupkg.sha512",
"D:\\Users\\Kira\\.nuget\\packages\\system.text.json\\7.0.3\\system.text.json.7.0.3.nupkg.sha512" "D:\\Users\\Kira\\.nuget\\packages\\system.text.json\\7.0.3\\system.text.json.7.0.3.nupkg.sha512",
"D:\\Users\\Kira\\.nuget\\packages\\microsoft.netcore.app.ref\\7.0.9\\microsoft.netcore.app.ref.7.0.9.nupkg.sha512",
"D:\\Users\\Kira\\.nuget\\packages\\microsoft.windowsdesktop.app.ref\\7.0.9\\microsoft.windowsdesktop.app.ref.7.0.9.nupkg.sha512",
"D:\\Users\\Kira\\.nuget\\packages\\microsoft.aspnetcore.app.ref\\7.0.9\\microsoft.aspnetcore.app.ref.7.0.9.nupkg.sha512"
], ],
"logs": [] "logs": []
} }