Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andreasneuber/csharp-cucumber-selenium-example
A sample implementation of BDD UI tests with C# and SpecFlow
https://github.com/andreasneuber/csharp-cucumber-selenium-example
bdd csharp end-to-end-testing specflow testautomation
Last synced: 22 days ago
JSON representation
A sample implementation of BDD UI tests with C# and SpecFlow
- Host: GitHub
- URL: https://github.com/andreasneuber/csharp-cucumber-selenium-example
- Owner: andreasneuber
- License: mit
- Created: 2022-10-01T05:56:05.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-26T16:42:35.000Z (6 months ago)
- Last Synced: 2024-07-26T18:33:44.711Z (6 months ago)
- Topics: bdd, csharp, end-to-end-testing, specflow, testautomation
- Language: C#
- Homepage:
- Size: 68.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# csharp-cucumber-selenium-example
A sample implementation of BDD UI tests with C# / SpecFlow## Application under test
The feature files, step definitions and page objects were written for https://github.com/andreasneuber/automatic-test-sample-site.
Readme in that repo has further details how to set it up.### IDE used
Microsoft Visual Studio Community 2022 (with .NET desktop development workload)### Setup
- git clone
- Double-click file `csharp-cucumber-selenium-framework.sln`
- Solution opens in Visual Studio
- Go to "Extensions" > "Manage Extensions" and get "SpecFlow for Visual Studio 2022"
- Right-click on solution, build solution
- Go to "View" and open the "Test Explorer" window
- Click green "Run All Tests In View" button### Updating
Especially ChromeDriver needs frequent updating.
- Go to "Tools > NuGet Package Manager > Manage NuGet Packages for Solution..."
- Go to tab "Updates"
- Update
- Right-click on solution, build solution
- Close and reopen solution### Set Browser
Open file `app.config` and find key "Browser". You can choose between:
- chrome
- chrome_headless
- firefox
- edge
- safari
After changing the browser, rebuild the solution.### SpecFlow LivingDocs reports locally
[Step-by-step guide for LivingDoc Generator](https://docs.specflow.org/projects/specflow-livingdoc/en/latest/sbsguides/sbscli.html)### SpecFlow LivingDocs reports on Azure DevOps
To view the "SpecFlow LivingDocs" comfortably [an extension is required](https://docs.specflow.org/projects/specflow-livingdoc/en/latest/Installation/Installation.html).Step `SpecFlow+ build step.` in file `azure-pipelines.yml` will generate and upload the report.
Report will appear under menu item "Overview > SpecFlow+ LivingDoc".
### Helpful VS keyboard shortcuts
- Duplicate line: `CTRL + E + V`
- Go to definition: `F12`
- Quick code formatting: `Ctrl + K , Ctrl + D`### FAQ
#### Where can I change the Base Url?
See app.config > appSettings#### How can I switch browser to "headless"?
See app.config > appSettings#### Error "csharp-cucumber-selenium-framework\bin\Debug\chromedriver.exe". Access to the path 'csharp-cucumber-selenium-framework\bin\Debug\chromedriver.exe' is denied.
- Run `taskkill /f /im chromedriver.exe`
- Clean solution