You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# BrowserStack Examples SpecflowPlus <ahref="https://specflow.org/"><imgsrc="https://www.specflow.org/wp-content/uploads/2016/07/SF_Logo.png"alt="Specflow"height="22"alt="Behavior Driven Development for .NET" /></a>
3
+
# BrowserStack Examples Specflow <ahref="https://specflow.org/"><imgsrc="https://www.specflow.org/wp-content/uploads/2016/07/SF_Logo.png"alt="Specflow"height="22"alt="Behavior Driven Development for .NET" /></a>
4
4
5
5
## Introduction
6
6
7
-
SpecFlow is the #1 .NET open source framework for Behavior Driven Development, Acceptance Test Driven Development and Specification by Example. With over 10m downloads on NuGet, SpecFlow is trusted by teams around the world.
7
+
SpecFlow is an open source framework for Behavior Driven Development, Acceptance Test Driven Development and Specification by Example.
8
8
9
-
This BrowserStack Example repository demonstrates a #{ Selenium test / Cypress / Puppeteer / Other } framework written in Cucumber and Junit 5 with parallel testing capabilities. The #{ Selenium test / Cypress / Puppeteer / Other } test scripts are written for the open source [BrowserStack Demo web application](https://bstackdemo.com) ([Github](https://github.com/browserstack/browserstack-demo-app)). This BrowserStack Demo App is an e-commerce web application which showcases multiple real-world user scenarios. The app is bundled with offers data, orders data and products data that contains everything you need to start using the app and run tests out-of-the-box.
10
-
11
-
The #{ Selenium test / Cypress / Puppeteer / Other } tests are run on different platforms like on-prem, docker and BrowserStack using various run configurations and test capabilities.
9
+
This BrowserStack Example repository demonstrates a Selenium test framework written in Cucumber and NUnit with parallel testing capabilities. The Selenium test scripts are written for the open source [BrowserStack Demo web application](https://bstackdemo.com) ([Github](https://github.com/browserstack/browserstack-demo-app)). This BrowserStack Demo App is an e-commerce web application which showcases multiple real-world user scenarios. The app is bundled with offers data, orders data and products data that contains everything you need to start using the app and run tests out-of-the-box.
12
10
13
11
---
14
12
@@ -42,124 +40,6 @@ This repository contains the following #{ Selenium test} tests:
42
40
| User | Login as User with existing Orders | This test verifies that existing orders are shown for user: "existing_orders_user" .It is executed in Mobile profile. |
43
41
44
42
---
45
-
46
-
## Test infrastructure environments
47
-
48
-
- [On Prem](#on-premise-self-hosted)
49
-
- [Docker](#docker)
50
-
- [BrowserStack](#browserstack)
51
-
52
-
---
53
-
54
-
# On Premise / Self Hosted
55
-
56
-
This infrastructure points to running the tests on your own machine using a browser (e.g. Chrome) using the browser's driver executables (e.g. ChromeDriver for Chrome). #{ Selenium enables this functionality using WebDriver for many popular browsers.}
57
-
58
-
## Prerequisites
59
-
60
-
- For this infrastructure configuration (i.e on-premise), ensure that the ChromeDriver executable is available in the path.
61
-
- ChromeDriver can be downloaded from https://chromedriver.chromium.org/downloads
62
-
63
-
Note: The ChromeDriver version must match the Chrome browser version on your machine.
64
-
65
-
## Running Your Tests
66
-
67
-
### Run a specific test on your own machine
68
-
69
-
- How to run the test?
70
-
71
-
To run the default test scenario (e.g. Login Scenario) on your own machine, use the following command:
72
-
73
-
.Net Core:
74
-
75
-
```
76
-
set CAPABILITIES_FILENAME=capabilities-driver.yml
77
-
dotnet test --filter Category=single
78
-
```
79
-
80
-
- Output
81
-
82
-
This run profile executes a specific test scenario on a single browser instance on your own machine.
83
-
84
-
- To run a specific test scenario use the filter tagged to that feature file.
85
-
86
-
.Net Core:
87
-
88
-
```
89
-
set CAPABILITIES_FILENAME=capabilities-driver.yml
90
-
dotnet test --filter Category=<tag>
91
-
```
92
-
93
-
where, the argument 'Tag' can be any profile configured with filters in feature files for this repository.
94
-
95
-
E.g. "single", "e2e", "login", "offers", "product" and "user"
96
-
97
-
- Output
98
-
99
-
This run profile executes the test Feature file sequentially on a single browser, on your own machine.
100
-
101
-
---
102
-
103
-
# Docker
104
-
105
-
[Docker](https://docs.docker.com/get-started/overview/) is an open source platform that provides the ability to package and test applications in an isolated environment called containers.
106
-
107
-
## Prerequisites
108
-
109
-
- Install and start [Docker](https://docs.docker.com/get-docker/).
110
-
- Note: Docker should be running on the test machine. Ensure Docker Compose is installed as well.
111
-
- Run `docker-compose pull` from the current directory of the repository.
112
-
113
-
## Running Your Tests
114
-
115
-
### Run a specific test on the docker infrastructure
116
-
117
-
- How to run the test?
118
-
119
-
- Start the Docker by running the following command:
120
-
121
-
```
122
-
docker-compose up -d
123
-
```
124
-
125
-
To run the default test scenario (e.g. Login Scenario) on your own machine, use the following command:
126
-
127
-
.Net Core:
128
-
129
-
```
130
-
set CAPABILITIES_FILENAME=capabilities-driver.yml
131
-
dotnet test --filter Category=single
132
-
```
133
-
134
-
- Output
135
-
136
-
This run profile executes a specific test scenario on a single browser instance on your personal selenium grid.
137
-
138
-
- To run a specific test scenario use the filter tagged to that feature file.
139
-
140
-
.Net Core:
141
-
142
-
```
143
-
set CAPABILITIES_FILENAME=capabilities-driver.yml
144
-
dotnet test --filter Category=<Tag>
145
-
```
146
-
147
-
where, the argument 'Tag' can be any profile configured with filters in feature files for this repository.
148
-
149
-
E.g. "single", "e2e", "login", "user", "offers" and "product"
150
-
151
-
- Output
152
-
153
-
This run profile executes the test Feature file sequentially on a single browser, on your personal selenium grid.
154
-
155
-
- After tests are complete, you can stop the Docker by running the following command:
156
-
157
-
```
158
-
docker-compose down
159
-
```
160
-
161
-
---
162
-
163
43
# BrowserStack
164
44
165
45
[BrowserStack](https://browserstack.com) provides instant access to 2,000+ real mobile devices and browsers on a highly reliable cloud infrastructure that effortlessly scales as testing needs grow.
@@ -183,21 +63,19 @@ Note: The ChromeDriver version must match the Chrome browser version on your mac
183
63
set BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
184
64
```
185
65
186
-
Alternatively, you can also hardcode username and access_key objects in the [capabilities.yml](browserstack_examples_specflowplus/BrowserStack/Webdriver/Resources/capabilities.yml) file.
66
+
Alternatively, you can also hardcode username and access_key objects in the [browserstack.yml](browserstack_examples_specflowplus/browserstack.yml) file.
187
67
188
68
Note:
189
69
190
70
- The exact test capability values can be easily identified using the [Browserstack Capability Generator](https://browserstack.com/automate/capabilities)
191
71
192
72
## Running Your Tests
193
73
194
-
### Run a specific test on BrowserStack
195
-
196
-
In this section, we will run a single test on Chrome browser on Browserstack. To change test capabilities for this configuration, please refer to the `PlatformOptions` object in `capabilities.yml` file.
74
+
In this section, we will run tests on Browserstack. To change test capabilities for this configuration, please refer to the `platforms` object in `browserstack.yml` file.
197
75
198
76
- How to run the test?
199
77
200
-
To run the default test scenario (e.g. Login Scenario) on your own machine, use the following command:
78
+
To run a test scenario (e.g. Login Scenario) on your own machine, use the following command:
201
79
202
80
.Net Core:
203
81
@@ -215,64 +93,21 @@ In this section, we will run a single test on Chrome browser on Browserstack. To
215
93
216
94
E.g. "single", "e2e", "login", "user", "offers" and "product"
217
95
218
-
-Output
96
+
---
219
97
220
-
This run profile executes a single test on a single browser on BrowserStack. Please refer to your [BrowserStack dashboard](https://automate.browserstack.com/) for test results.
221
-
222
-
### Running entire suite in parallel on BrowserStack
223
-
224
-
- In this section, we will run the tests in parallel on a single browser OS combination on Browserstack.
225
-
226
-
How to run the test?
227
-
228
-
To run the entire test suite in parallel on a single BrowserStack browser, just run:
229
-
230
-
```
231
-
dotnet test
232
-
```
233
-
234
-
By default, the NUnit runner will only run 10 tests in parallel. This can changed from [AssemblyInfo.cs](browserstack_examples_specflowplus/Properties/AssemblyInfo.cs). You can change the `[assembly: LevelOfParallelism(10)]` tag where you can replace the number 10 with anny number you find appropriate
235
-
236
-
### [Web application hosted on internal environment] Running your tests on BrowserStack using BrowserStackLocal
237
-
238
-
#### Prerequisites
239
-
240
-
- Clone the [BrowserStack demo application](https://github.com/browserstack/browserstack-demo-app) repository.
- Please follow the README.md on the BrowserStack demo application repository to install and start the dev server on localhost.
245
-
- In this section, we will run a single test case to test the BrowserStack Demo app hosted on your local machine i.e. localhost. Refer to the `Local` object in `conf.json` file to change test capabilities for this configuration.
246
-
- Note: You may need to provide additional BrowserStackLocal arguments to successfully connect your localhost environment with BrowserStack infrastructure. (e.g if you are behind firewalls, proxy or VPN).
247
-
- Further details for successfully creating a BrowserStackLocal connection can be found here:
248
-
249
-
- [Local Testing with Automate](https://www.browserstack.com/local-testing/automate)
eg tags are "single", "e2e", "login", "user", "offers" and "product"
106
+
The number of prallels per platform can be configured by changing the value of `parallelsPerPlatform` property in the `browserstack.yml` file.
272
107
273
108
- Output
274
109
275
-
This run profile executes a single test on an internally hosted web application on a single browser on BrowserStack. Please refer to your BrowserStack dashboard(https://automate.browserstack.com/) for test results.
110
+
This run profile executes a single test on a single browser on BrowserStack. Please refer to your [BrowserStack dashboard](https://automate.browserstack.com/) for test results.
276
111
277
112
## Additional Resources
278
113
@@ -282,13 +117,4 @@ In this section, we will run a single test on Chrome browser on Browserstack. To
282
117
- [List of Browsers & mobile devices](https://www.browserstack.com/list-of-browsers-and-platforms?product=automate) for automation testing on BrowserStack #{ Replace link for non-Selenium frameworks. }
283
118
- [Using Automate REST API](https://www.browserstack.com/automate/rest-api) to access information about your tests via the command-line interface
284
119
- Understand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github)
285
-
- For testing public web applications behind IP restriction, [Inbound IP Whitelisting](https://www.browserstack.com/local-testing/inbound-ip-whitelisting) can be enabled with the [BrowserStack Enterprise](https://www.browserstack.com/enterprise) offering
286
-
287
-
## Observations
288
-
289
-
- If Test are skipped, please check for other instances of .Net Host & BrowserstackLocal running in background and terminate the running instances explicity.
290
-
291
-
## Open Issues
292
-
293
-
- When running all the tests together, there is some flakiness observed and some Test might get fail.
294
-
- Please specify the binary path to the local options when using BrowserStack Local. You can find more details about it [here](https://www.nuget.org/packages/BrowserStackLocal/)
120
+
- For testing public web applications behind IP restriction, [Inbound IP Whitelisting](https://www.browserstack.com/local-testing/inbound-ip-whitelisting) can be enabled with the [BrowserStack Enterprise](https://www.browserstack.com/enterprise) offering
0 commit comments