Skip to content

browserstack/csharp-playwright-browserstack

Repository files navigation

csharp-playwright-browserstack

Creating a sample repo for CSharp Playwright

This sample elaborates the NUnit Integration with BrowserStack.

BrowserStack Logo

Run Sample Build

  • Clone the repo
  • Open the solution CSharp-Playwright-BrowserStack.sln in Visual Studio
  • Build the solution
  • Update browserstack.yml file with your BrowserStack Username and Access Key

Running your tests from CLI

  • To run the test suite having cross-platform with parallelization, dotnet test --filter "Category=sample-test"
  • To run local tests, dotnet test --filter "Category=sample-local-test"

Running your tests from Test Explorer

  • To run a parallel tests, run test with fixture sample-test
  • To run local tests, run test with fixture sample-local-test

Understand how many parallel sessions you need by using our Parallel Test Calculator

Integrate your test suite

This repository uses the BrowserStack SDK to run tests on BrowserStack. Follow the steps below to install the SDK in your test suite and run tests on BrowserStack:

  • Create sample browserstack.yml file with the browserstack related capabilities with your BrowserStack Username and Access Key and place it in your root folder.
  • Add nuget library BrowserStack.TestAdapter
dotnet add BrowserStack.TestAdapter
  • Build project dotnet build

Notes

  • You can view your test results on the BrowserStack automate dashboard

  • To test on a different set of browsers, check out our platform configurator

  • You can export the environment variables for the Username and Access Key of your BrowserStack account

    • For Unix-like or Mac machines:
    export BROWSERSTACK_USERNAME=<browserstack-username> &&
    export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
    
    • For Windows Cmd:
    set BROWSERSTACK_USERNAME=<browserstack-username>
    set BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
    
    • For Windows Powershell:
    $env:BROWSERSTACK_USERNAME=<browserstack-username>
    $env:BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
    

Additional Resources

About

Creating a sample repo for different Playwright languages and runners

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6

Languages