The project is in C#.Net, with the help of Appium/Selenium(.net version), NUnit, Specflow and Allure.
- C#.Net Target: 4.7.1
- Specflow: 2.4.1
<!-- You could config Driver and timeout in App.config -->
<TestSettings>
<Driver PlatformName="Android" BrowserName="Chrome" DeviceName="Android Emulator" ServerUrl="http://localhost:4723/wd/hub"></Driver>
<!-- You also could add SauceLabsDriver / BrowserStackDriver -->
</TestSettings>
Support Mobile Web | Support Desktop Web | |
---|---|---|
LocalDriver | ✓ | ✓ |
SauceLabsDriver | ✓ | |
BrowserStackDriver | ✓ |
- Run with SauceLabs Real Device (TestObject)
export SERVER_PROVIDER=SauceLabs
export SAUCE_KEY=<Your Sauce API Key>
nuget restore Spec.Web.sln
nuget install NUnit.Console -Version 3.9.0 -OutputDirectory testrunner
msbuild /p:Configuration=Release Spec.Web.sln
./testrunner/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe ./Spec.Web.Mobile/bin/Release/Spec.Web.Mobile.dll
- Run with local Appium and Android
# Ensure you start Appium locally and has conntected Android or Android emulator
nuget restore Spec.Web.sln
nuget install NUnit.Console -Version 3.9.0 -OutputDirectory testrunner
msbuild /p:Configuration=Release Spec.Web.sln
./testrunner/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe ./Spec.Web.Mobile/bin/Release/Spec.Web.Mobile.dll
- Run with BrowserStack Desktop Browser
export SERVER_PROVIDER=BrowserStack
export BS_USER=<Your BrowserStack User>
export BS_KEY=<Your BrowserStack Key>
nuget restore Spec.Web.sln
nuget install NUnit.Console -Version 3.9.0 -OutputDirectory testrunner
msbuild /p:Configuration=Release Spec.Web.sln
./testrunner/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe ./Spec.Web.Desktop/bin/Release/Spec.Web.Desktop.dll
- Run with local Chrome Desktop browser
# Ensure you start selenium standalone server with related chrome driver
nuget restore Spec.Web.sln
nuget install NUnit.Console -Version 3.9.0 -OutputDirectory testrunner
msbuild /p:Configuration=Release Spec.Web.sln
./testrunner/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe ./Spec.Web.Desktop/bin/Release/Spec.Web.Desktop.dll
It will generate Allure test report in allure-results folder where the assemly located. Please kindly noticed I do not really properly configured the Allure report, you could extend it such as adding screenshots or recorded videos into report.
- Spec.Web.Core: The core library that could be shared by all test assembly
- Spec.Web.Mobile: The mobile web test project for both Android and iOS.
- Spec.Web.Desktop: The desktop browser test project
- Spec.Web.Bindings: Specflow common bindings(Hook & StepDefinitions) and PageObjects
Please kindly notice this project is only could be used for LEARNING usage of Appium / Selenium / Specflow in C#.Net environment.