Skip to content

Commit 0710e17

Browse files
committed
add: readme for setup-local. Fix: readme for setup-env
1 parent 0f6c28f commit 0710e17

File tree

2 files changed

+67
-11
lines changed

2 files changed

+67
-11
lines changed

setup-env/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ This action sets up the following environment variables in the runner environmen
1818
## Usage
1919
```
2020
- name: 'BrowserStack Env Setup'
21-
uses: 'browserstack/github-actions/setup-env@master'
22-
with:
23-
username: ${{ secrets.BROWSERSTACK_USERNAME }}
24-
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
25-
build-name: BUILD_INFO
26-
project-name: REPO_NAME
21+
uses: 'browserstack/github-actions/setup-env@master'
22+
with:
23+
username: ${{ secrets.BROWSERSTACK_USERNAME }}
24+
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
25+
build-name: BUILD_INFO
26+
project-name: REPO_NAME
2727
```
2828

2929
or
3030

3131
```
3232
- name: 'BrowserStack Env Setup'
33-
uses: 'browserstack/github-actions/setup-env@master'
34-
with:
35-
username: ${{ secrets.BROWSERSTACK_USERNAME }}
36-
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
33+
uses: 'browserstack/github-actions/setup-env@master'
34+
with:
35+
username: ${{ secrets.BROWSERSTACK_USERNAME }}
36+
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
3737
```
3838

3939
## Inputs

setup-local/README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,57 @@
1-
README for Setup BrowserStack Local Binary
1+
# setup-local
2+
This action fulfils the following objectives in your runner environment:
3+
* It will download the appropriate type of BrowserStackLocal binary in your runner environment depending on the environment, i.e. Linux/Darwin/Win32.
4+
* It will start (or stop) the binary and establish (or end) the Local tunnel connection from the runner machine to the BrowserStack cloud as per the input for `local-testing` field.
5+
* The action provides the functionality to specify the logging level of the binary and then upload the logs as artifacts in GitHub workflow.
6+
* The action allows you to pass any combination of arguments for the invocation of the BrowserStackLocal binary as given [here](https://www.browserstack.com/local-testing/binary-params).
7+
8+
## Prerequisites
9+
The **browserstack/github-actions/setup-env@master** action should have been invoked prior to invoking this Action as a part of the same job.
10+
11+
## Inputs
12+
* `local-testing`: (**Mandatory**)
13+
* Valid inputs:
14+
* `start`: This will download the BrowserStackLocal binary (if it wasn't downloaded earlier by this action in the same runner environment) and start the binary with additional inputs that you might provide. The `local-identifier` that is used to start the binary will be set in the environment variable `BROWSERSTACK_LOCAL_IDENTIFIER`. The same will be used for stopping the binary when using the `stop` input.
15+
* `stop`: This will ensure that a previously running binary will be stopped and if any log-level was set by `local-logging-level`, then the logs will be uploaded as artifacts. **If you do not stop the binary after the completion of your tests, the logs will not be uploaded as artifacts.**
16+
* `local-logging-level`: (**Optional**)
17+
* Valid inputs:
18+
* `false`: No local binary logs will be captured.
19+
* `setup-logs`: Local logs to debug issues related to setting up of connections will be saved. They will be uploaded as artifacts only if the action is again invoked with `local-testing: stop`.
20+
* `network-logs`: Local logs related to network information will be saved. They will be uploaded as artifacts only if the action is again invoked with `local-testing: stop`.
21+
* `all-logs`: Local logs related to all communication to local servers for each request and response will be saved. They will be uploaded as artifacts only if the action is again invoked with `local-testing: stop`.
22+
* Default: `false`.
23+
* `local-identifier`: (**Optional**)
24+
* Valid inputs:
25+
* `random`: This is the recommended value for this input. A randomly generated string will be used to start the local tunnel connection and the string will be saved in the environment variable `BROWSERSTACK_LOCAL_IDENTIFIER`. You must use the same environment variable in your test script to specify the tunnel identifier in capabilities.
26+
* `<string>`: You can choose any value for the `string`. The same will be saved in the environment variable `BROWSERSTACK_LOCAL_IDENTIFIER` which you must use in your test script to specify the tunnel identifier in capabilities.
27+
* Default: If you do not provide any input, then no tunnel identifier will be used. This option is not recommended because if multiple tunnels are created without any identifier (or with same identifier) for the same access-key, then tests might behave abnormally. It is strongly advised not to choose this option.
28+
* `local-args`: (**Optional**)
29+
* Valid input: You can choose to pass any additional arguments to start the local binary through this option. All your arguments must be a part of this single string. You can find the complete list of supported local-binary arguments [here](https://www.browserstack.com/local-testing/binary-params).
30+
* E.g. `local-args: --force-local --proxy-host <HOST> --proxy-port <PORT> --proxy-user <USER> --proxy-pass <PASSWORD>`
31+
* **NOTE**: Do not include the following arguments as a part of this input string (they will be ignored if passed):
32+
* `--key` or `-k`
33+
* `--local-identifier`
34+
* `--daemon`
35+
* `--only-automate`
36+
* `--verbose`
37+
* `--log-file`
38+
* The above arguments are already being included in the invocation of the local binary and hence, if you include any of the above again in the `local-args` string, they will be ignored. `local-args` is an optional argument and under normal circumstances, if the application is not hosted behind any proxy, this input would not be required. Visit [this page](https://www.browserstack.com/local-testing/binary-params) to see if any additional argument is applicable to your test scenario.
39+
40+
## Usage
41+
Use the code snippet below in your workflow to start the BrowserStackLocal binary and establish the tunnel connection:
42+
```
43+
- name: 'Start BrowserStackLocal Tunnel'
44+
uses: 'browserstack/github-actions/setup-local@master'
45+
with:
46+
local-testing: start
47+
local-logging-level: all-logs
48+
local-identifier: random
49+
```
50+
51+
Use the code snippet below at the end of your workflow after the tests have completed. This will stop the BrowserStackLocal binary and upload the local binary logs (if any):
52+
```
53+
- name: 'Stop BrowserStackLocal'
54+
uses: 'browserstack/github-actions/setup-local@master'
55+
with:
56+
local-testing: stop
57+
```

0 commit comments

Comments
 (0)