Skip to content

Commit da646d1

Browse files
authored
Parent Readme Update
1 parent 4b784d7 commit da646d1

File tree

1 file changed

+57
-4
lines changed

1 file changed

+57
-4
lines changed

README.md

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,64 @@
11
# BrowserStack GitHub Actions
22

3-
This respository contains the GitHub Actions to help you integrate your test suite with BrowserStack cloud.
3+
This respository contains a library of GitHub Actions to help you integrate your test suite with the [BrowserStack](https://browserstack.com) device cloud.
4+
5+
You need a BrowserStack username and access-key to run your tests on the BrowserStack device cloud. You can [sign-up for free trial](https://www.browserstack.com/users/sign_up) if you do not have an existing account. We love open source projects. If you want to test your open source project on BrowserStack then [sign-up](https://www.browserstack.com/open-source) for your lifetime free access to all our products.
46

57
## Available Actions
6-
* [setup-env](./setup-env): This action helps in setting up of environment variables to be used in your test scripts for BrowserStack. The environment variables set up here shall be used by other BrowserStack actions as well for their functioning.
8+
* [setup-env](./setup-env): This Action helps in setting up the required environment variables that are to be used in your test scripts. The environment variables set up here shall be used by other BrowserStack actions as well for their functioning.
79

8-
* [setup-local](./setup-local): This actions sets up local binary for creating local tunnel connections from runner environment to BrowserStack cloud.
10+
* [setup-local](./setup-local): This actions sets up downloads and starts the appropriate BrowserStackLocal binary thereby creating a secure tunnel connection from the GitHub Actions runner environment to the BrowserStack device cloud. This secure tunnel will be used by the remote browsers in BrowserStack to access your web application hosted in the GitHub Actions runner machine. You do not need this Action, if the application to be tested is accessible over public internet.
11+
12+
## Pre-requisites
13+
* You should set your BrowserStack Username and Access-key as GitHub Secrets `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` respectively.
14+
15+
## Usage
16+
As this is actually a library of Actions, invoking only this Action will only invoke the `setup-env` Action internally. The following usage example will only set up the required environment variables:
17+
18+
```yaml
19+
- name: BrowserStack Action
20+
uses: 'browserstack/github-actions@master'
21+
with:
22+
username: ${{ secrets.BROWSERSTACK_USERNAME }}
23+
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
24+
build-name: BUILD_INFO
25+
project-name: REPO_NAME
26+
```
27+
We recommend you to invoke individual Actions from this library separately. A sample of two Actions being invoked back to back is shown below. You can additionally refer to the individual `README` ([setup-env](./setup-env), [setup-local](./setup-local)) of the Actions to know more about how they work, the inputs they support and their usage examples.
28+
29+
## Sample Workflow with usage of both Actions
30+
The workflow example below would be useful for anyone who wants to run their automated tests on the BrowserStack cloud when the web application to be tested, is hosted on a GitHub Actions runner i.e. not accessible from public Internet
31+
32+
```yaml
33+
name: 'BrowserStack Test'
34+
on: [push, pull_request]
35+
36+
jobs:
37+
ubuntu-job:
38+
name: 'BrowserStack Test on Ubuntu'
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: 'BrowserStack Env Setup'
42+
uses: 'browserstack/github-actions/setup-env@master'
43+
with:
44+
username: ${{ secrets.BROWSERSTACK_USERNAME }}
45+
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
46+
build-name: BUILD_INFO
47+
project-name: REPO_NAME
48+
- name: 'BrowserStackLocal Setup'
49+
uses: 'browserstack/github-actions/setup-local@master'
50+
with:
51+
local-testing: start
52+
local-identifier: random
53+
```
54+
Post these setup steps where both the Actions have been used, you have to build and run your application web server on the same machine, in daemon mode and thereafter invoke your test scripts. Your test scripts should use the environment variables that have been set by [`setup-env` Action](./setup-env). For more detailed steps on how to integrate your test suite with BrowserStack on GitHub Actions, visit [BrowserStack Documentation](http://browserstack.com/docs/automate/selenium/github-actions) for the same.
955

56+
After you are done running your tests, invoke the `setup-local` Action again with `local-testing: stop` as an input:
57+
```yaml
58+
- name: 'BrowserStackLocal Stop'
59+
uses: 'browserstack/github-actions/setup-local@master'
60+
with:
61+
local-testing: stop
62+
```
1063
## Feature requests and bug reports
11-
Please file feature requests and bug reports as [github issues](https://github.com/browserstack/github-actions/issues).
64+
Please file feature requests and bug reports as [github issues](https://github.com/browserstack/github-actions/issues).

0 commit comments

Comments
 (0)