mayank1004 / Test-PlaywrightDotNet-RestSharp

This is sample automation testing project on C# using Playwright and Restsharp.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test Automation Project using .Net

Status

Build


Testing app:

Conduit App


Description:

  • This is skeleton work E2E Test automation project built using Playwright for .Net
  • This also has skeleton work for the API testing using RestSharp

Note: Playwright does not support API testing on .Net with current version 1.22, known issue


Test case folder


Installation Guide:

Pre-requisite:

Once you have .Net Core 3.1 installed, and cloned the repo, follow the below instruction to run tests thru CLI:

Steps to execute tests:

  1. Run dotnet build from the root of the repo

  2. Run pwsh bin\Debug\netcoreapp3.1\playwright.ps1 install

  • *NOTE: This command Installs required browsers - replace netcoreapp3.1 with actual output folder name, f.ex. net6.0.
  • *If the pwsh command does not work (throws TypeNotFound), make sure to use an up-to-date version of PowerShell. dotnet tool update --global PowerShell
  • **If you don't have powershell installed on mac os, please refer this official page.
  • Other link for the Reference
  1. Run dotnet test

Hints: To run BadExamples test on Headed browser, run the following command:

IDE Setup:

Visual Studio

  • Please open the project solution file in VS
  • Once the project files and folder shows up, click on Build -> Build All
  • Now click on View -> Tests and it may display all the tests folder as below Test Run Image
  • Right click on the Test or folder and select Run test

Hint: To run the BadExample tests on headed browser, run following command:


Window:

set HEADED=1
dotnet test --filter Name~Bad

Linux & Mac

HEADED=1 dotnet test --filter Name~Bad

About

This is sample automation testing project on C# using Playwright and Restsharp.


Languages

Language:C# 100.0%