From 8c5ac47a6ac454b295777d99dc3f8059e7df4265 Mon Sep 17 00:00:00 2001 From: Rohan Chougule Date: Tue, 18 Aug 2020 14:11:03 +0530 Subject: [PATCH 01/16] draft: setup-env readme added --- setup-env/README.md | 60 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/setup-env/README.md b/setup-env/README.md index 30b4cec..aa7625e 100644 --- a/setup-env/README.md +++ b/setup-env/README.md @@ -1 +1,59 @@ -README for Setup BrowserStack Test Environment \ No newline at end of file +# setup-env + +This action sets up the following environment variables in the runner environment. These environment variables shall be used in the tests for BrowserStack: + +1. `BROWSERSTACK_BUILD_NAME`: This environment variable is set on the basis of the input to `build-name` field. By default, the value will be decided based on the event, i.e. push, pull_request etc for the workflow: + 1. `push` event: `[] Commit : [Workflow: ]` + 2. `pull_request` event: `[] PR : [Workflow-number]` + 3. `release` event: `[] Release : [Workflow-number]` + 4. Other events: ` [Workflow: ]` + +2. `BROWSERSTACK_PROJECT_NAME`: This environment variable is set one basis of the input to `project-name` field. By default, i.e. if any input is not provided, the value will be set as the Repository Name. +3. `BROWSERSTACK_USERNAME`: This environment variable's value is taken from the input to `username` field. Ideal way would be to pass the GitHub Secret as the input, i.e. `username: ${{ secrets.BROWSERSTACK_USERNAME }}`. +4. `BROWSERSTACK_ACCESS_KEY`: This environment variable's value is taken from the input to `access-key` field. Ideal way would be to pass the GitHub Secret as the input, i.e. `access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}`. + +## Prerequisites +* This action does not have any prerequisites. + +## Usage +``` +- name: 'BrowserStack Env Setup' + uses: 'browserstack/github-actions/setup-env@master' + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + build-name: BUILD_INFO + project-name: REPO_NAME +``` + +or + +``` +- name: 'BrowserStack Env Setup' + uses: 'browserstack/github-actions/setup-env@master' + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} +``` + +## Inputs +* `username`: (**Mandatory**) This is your BrowserStack Username. This should ideally be passed via a GitHub Secret as shown in the sample workflow above. +* `access-key`: (**Mandatory**) This is your BrowserStack Access key that is required to access the BrowserStack device cloud. This should also ideally be passed via a GitHub Secret as shown in the sample workflow above. +* `build-name`: (**Optional**) + * You can pass any string that you want to set as the `BROWSERSTACK_BUILD_NAME`. E.g. `build-name: My Build Name Goes Here`. + * You can also include your personalized string along with the keyword `BUILD_INFO` in the input: + * `build-name: My String Goes Here - BUILD_INFO` + * `build-name: BUILD_INFO - My String at the end` + * `build-name: String at the Beginning - BUILD_INFO - String at the end` + * The keyword `BUILD_INFO` will be replaced by the information based on the event of the workflow as described above for `BROWSERSTACK_BUILD_NAME` environment variable. +* `project-name`: (**Optional**) + * You can pass any string that you want to set as the `BROWSERSTACK_PROJECT_NAME`. E.g. `project-name: My Project Name Goes Here`. + * You can also pass the keywork `REPO_NAME` as the input. This will set the Repository Name for the `BROWSERSTACK_PROJECT_NAME` environment variable. + * If no input is provided, `REPO_NAME` will be considered as the default input. + +--- +**NOTE** +* This action is a prerequisite for any other BrowserStack related actions. +* This action should be invoked prior to the execution of tests on BrowserStack to be able to utilise the environment variables in your tests. +* You have to use the environment variables set by this action in your test script. +--- \ No newline at end of file From b0c9ce50ab2a7e17aa1426308fa5eb4772499ec3 Mon Sep 17 00:00:00 2001 From: Rohan Chougule Date: Tue, 18 Aug 2020 14:17:23 +0530 Subject: [PATCH 02/16] fix: spelling in readme --- setup-env/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-env/README.md b/setup-env/README.md index aa7625e..a9a2b6b 100644 --- a/setup-env/README.md +++ b/setup-env/README.md @@ -48,7 +48,7 @@ or * The keyword `BUILD_INFO` will be replaced by the information based on the event of the workflow as described above for `BROWSERSTACK_BUILD_NAME` environment variable. * `project-name`: (**Optional**) * You can pass any string that you want to set as the `BROWSERSTACK_PROJECT_NAME`. E.g. `project-name: My Project Name Goes Here`. - * You can also pass the keywork `REPO_NAME` as the input. This will set the Repository Name for the `BROWSERSTACK_PROJECT_NAME` environment variable. + * You can also pass the keyword `REPO_NAME` as the input. This will set the Repository Name for the `BROWSERSTACK_PROJECT_NAME` environment variable. * If no input is provided, `REPO_NAME` will be considered as the default input. --- From 28e8282390c048c26bfdd4acb56dffe3a0fb976e Mon Sep 17 00:00:00 2001 From: Rohan Chougule Date: Tue, 18 Aug 2020 14:21:29 +0530 Subject: [PATCH 03/16] fix: readme build name values --- setup-env/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup-env/README.md b/setup-env/README.md index a9a2b6b..9bda3e0 100644 --- a/setup-env/README.md +++ b/setup-env/README.md @@ -4,8 +4,8 @@ This action sets up the following environment variables in the runner environmen 1. `BROWSERSTACK_BUILD_NAME`: This environment variable is set on the basis of the input to `build-name` field. By default, the value will be decided based on the event, i.e. push, pull_request etc for the workflow: 1. `push` event: `[] Commit : [Workflow: ]` - 2. `pull_request` event: `[] PR : [Workflow-number]` - 3. `release` event: `[] Release : [Workflow-number]` + 2. `pull_request` event: `[] PR : [Workflow: ]` + 3. `release` event: `[] Release : [Workflow: ]` 4. Other events: ` [Workflow: ]` 2. `BROWSERSTACK_PROJECT_NAME`: This environment variable is set one basis of the input to `project-name` field. By default, i.e. if any input is not provided, the value will be set as the Repository Name. From 0f6c28f95fc4014af96bdd5c575e05c38e80ae14 Mon Sep 17 00:00:00 2001 From: Rohan Chougule Date: Tue, 18 Aug 2020 14:22:48 +0530 Subject: [PATCH 04/16] fix: readme --- setup-env/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-env/README.md b/setup-env/README.md index 9bda3e0..5107860 100644 --- a/setup-env/README.md +++ b/setup-env/README.md @@ -8,7 +8,7 @@ This action sets up the following environment variables in the runner environmen 3. `release` event: `[] Release : [Workflow: ]` 4. Other events: ` [Workflow: ]` -2. `BROWSERSTACK_PROJECT_NAME`: This environment variable is set one basis of the input to `project-name` field. By default, i.e. if any input is not provided, the value will be set as the Repository Name. +2. `BROWSERSTACK_PROJECT_NAME`: This environment variable is set on the basis of the input to `project-name` field. By default, i.e. if any input is not provided, the value will be set as the Repository Name. 3. `BROWSERSTACK_USERNAME`: This environment variable's value is taken from the input to `username` field. Ideal way would be to pass the GitHub Secret as the input, i.e. `username: ${{ secrets.BROWSERSTACK_USERNAME }}`. 4. `BROWSERSTACK_ACCESS_KEY`: This environment variable's value is taken from the input to `access-key` field. Ideal way would be to pass the GitHub Secret as the input, i.e. `access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}`. From 0710e17ead2813dac50624e205da87c116a720ae Mon Sep 17 00:00:00 2001 From: Rohan Chougule Date: Tue, 18 Aug 2020 21:01:53 +0530 Subject: [PATCH 05/16] add: readme for setup-local. Fix: readme for setup-env --- setup-env/README.md | 20 +++++++-------- setup-local/README.md | 58 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 11 deletions(-) diff --git a/setup-env/README.md b/setup-env/README.md index 5107860..c1e0d07 100644 --- a/setup-env/README.md +++ b/setup-env/README.md @@ -18,22 +18,22 @@ This action sets up the following environment variables in the runner environmen ## Usage ``` - name: 'BrowserStack Env Setup' - uses: 'browserstack/github-actions/setup-env@master' - with: - username: ${{ secrets.BROWSERSTACK_USERNAME }} - access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} - build-name: BUILD_INFO - project-name: REPO_NAME + uses: 'browserstack/github-actions/setup-env@master' + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + build-name: BUILD_INFO + project-name: REPO_NAME ``` or ``` - name: 'BrowserStack Env Setup' - uses: 'browserstack/github-actions/setup-env@master' - with: - username: ${{ secrets.BROWSERSTACK_USERNAME }} - access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + uses: 'browserstack/github-actions/setup-env@master' + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} ``` ## Inputs diff --git a/setup-local/README.md b/setup-local/README.md index 2668f02..5e0919d 100644 --- a/setup-local/README.md +++ b/setup-local/README.md @@ -1 +1,57 @@ -README for Setup BrowserStack Local Binary \ No newline at end of file +# setup-local +This action fulfils the following objectives in your runner environment: +* It will download the appropriate type of BrowserStackLocal binary in your runner environment depending on the environment, i.e. Linux/Darwin/Win32. +* 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. +* The action provides the functionality to specify the logging level of the binary and then upload the logs as artifacts in GitHub workflow. +* 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). + +## Prerequisites +The **browserstack/github-actions/setup-env@master** action should have been invoked prior to invoking this Action as a part of the same job. + +## Inputs +* `local-testing`: (**Mandatory**) + * Valid inputs: + * `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. + * `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.** +* `local-logging-level`: (**Optional**) + * Valid inputs: + * `false`: No local binary logs will be captured. + * `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`. + * `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`. + * `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`. + * Default: `false`. +* `local-identifier`: (**Optional**) + * Valid inputs: + * `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. + * ``: 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. + * 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. +* `local-args`: (**Optional**) + * 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). + * E.g. `local-args: --force-local --proxy-host --proxy-port --proxy-user --proxy-pass ` + * **NOTE**: Do not include the following arguments as a part of this input string (they will be ignored if passed): + * `--key` or `-k` + * `--local-identifier` + * `--daemon` + * `--only-automate` + * `--verbose` + * `--log-file` + * 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. + +## Usage +Use the code snippet below in your workflow to start the BrowserStackLocal binary and establish the tunnel connection: +``` +- name: 'Start BrowserStackLocal Tunnel' + uses: 'browserstack/github-actions/setup-local@master' + with: + local-testing: start + local-logging-level: all-logs + local-identifier: random +``` + +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): +``` +- name: 'Stop BrowserStackLocal' + uses: 'browserstack/github-actions/setup-local@master' + with: + local-testing: stop +``` \ No newline at end of file From 4b784d769564b31352e665a57fcb25fc38250207 Mon Sep 17 00:00:00 2001 From: Rohan Chougule Date: Tue, 18 Aug 2020 21:21:12 +0530 Subject: [PATCH 06/16] add: parent readme --- README.md | 13 ++++++++++--- setup-local/README.md | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b5c6239..0b88e83 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,11 @@ -BrowserStack Actions +# BrowserStack GitHub Actions -1. Setup Test Environment: [Readme](./setup-env/README.md) -2. Local Binary Setup: [Readme](./setup-local/README.md) +This respository contains the GitHub Actions to help you integrate your test suite with BrowserStack cloud. + +## Available Actions +* [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. + +* [setup-local](./setup-local): This actions sets up local binary for creating local tunnel connections from runner environment to BrowserStack cloud. + +## Feature requests and bug reports +Please file feature requests and bug reports as [github issues](https://github.com/browserstack/github-actions/issues). \ No newline at end of file diff --git a/setup-local/README.md b/setup-local/README.md index 5e0919d..7e122b5 100644 --- a/setup-local/README.md +++ b/setup-local/README.md @@ -6,7 +6,7 @@ This action fulfils the following objectives in your runner environment: * 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). ## Prerequisites -The **browserstack/github-actions/setup-env@master** action should have been invoked prior to invoking this Action as a part of the same job. +The **browserstack/github-actions/setup-env@master** action should have been invoked prior to invoking this action as a part of the same job. ## Inputs * `local-testing`: (**Mandatory**) From da646d133c6638e714dfc035b1ec7c3cb07846c0 Mon Sep 17 00:00:00 2001 From: Sourav Kundu <66624530+sourav-kundu@users.noreply.github.com> Date: Thu, 20 Aug 2020 11:35:23 +0530 Subject: [PATCH 07/16] Parent Readme Update --- README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0b88e83..6447aba 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,64 @@ # BrowserStack GitHub Actions -This respository contains the GitHub Actions to help you integrate your test suite with BrowserStack cloud. +This respository contains a library of GitHub Actions to help you integrate your test suite with the [BrowserStack](https://browserstack.com) device cloud. + +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. ## Available Actions -* [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. +* [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. -* [setup-local](./setup-local): This actions sets up local binary for creating local tunnel connections from runner environment to BrowserStack cloud. +* [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. + +## Pre-requisites +* You should set your BrowserStack Username and Access-key as GitHub Secrets `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` respectively. + +## Usage +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: + +```yaml +- name: BrowserStack Action + uses: 'browserstack/github-actions@master' + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + build-name: BUILD_INFO + project-name: REPO_NAME +``` +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. + +## Sample Workflow with usage of both Actions +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 + +```yaml +name: 'BrowserStack Test' +on: [push, pull_request] + +jobs: + ubuntu-job: + name: 'BrowserStack Test on Ubuntu' + runs-on: ubuntu-latest + steps: + - name: 'BrowserStack Env Setup' + uses: 'browserstack/github-actions/setup-env@master' + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + build-name: BUILD_INFO + project-name: REPO_NAME + - name: 'BrowserStackLocal Setup' + uses: 'browserstack/github-actions/setup-local@master' + with: + local-testing: start + local-identifier: random +``` +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. +After you are done running your tests, invoke the `setup-local` Action again with `local-testing: stop` as an input: +```yaml + - name: 'BrowserStackLocal Stop' + uses: 'browserstack/github-actions/setup-local@master' + with: + local-testing: stop +``` ## Feature requests and bug reports -Please file feature requests and bug reports as [github issues](https://github.com/browserstack/github-actions/issues). \ No newline at end of file +Please file feature requests and bug reports as [github issues](https://github.com/browserstack/github-actions/issues). From 1d1e955304de176740de25c87da885c558dcb019 Mon Sep 17 00:00:00 2001 From: Sourav Kundu <66624530+sourav-kundu@users.noreply.github.com> Date: Thu, 20 Aug 2020 12:08:32 +0530 Subject: [PATCH 08/16] Open source wording change Co-authored-by: Rohan Chougule --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6447aba..a0c5973 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ This respository contains a library of GitHub Actions to help you integrate your test suite with the [BrowserStack](https://browserstack.com) device cloud. -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. +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. +If you want to test your open source project on BrowserStack then [sign-up here](https://www.browserstack.com/open-source) for lifetime free access to all our products. ## Available Actions * [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. From 071ef80b15abd44ba4789c7dc31db5395ea84236 Mon Sep 17 00:00:00 2001 From: Sourav Kundu <66624530+sourav-kundu@users.noreply.github.com> Date: Thu, 20 Aug 2020 12:09:06 +0530 Subject: [PATCH 09/16] [Chore] grammer correction Co-authored-by: Rohan Chougule --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0c5973..1659bad 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you want to test your open source project on BrowserStack then [sign-up here] ## Available Actions * [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. -* [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. +* [setup-local](./setup-local): This Action 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. ## Pre-requisites * You should set your BrowserStack Username and Access-key as GitHub Secrets `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` respectively. From 55db7eb41a9e746beccad07175a289a11c5eb5dd Mon Sep 17 00:00:00 2001 From: Sourav Kundu <66624530+sourav-kundu@users.noreply.github.com> Date: Thu, 20 Aug 2020 12:10:22 +0530 Subject: [PATCH 10/16] [chore] remove `-` Co-authored-by: Rohan Chougule --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1659bad..5a167a3 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you want to test your open source project on BrowserStack then [sign-up here] * [setup-local](./setup-local): This Action 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. ## Pre-requisites -* You should set your BrowserStack Username and Access-key as GitHub Secrets `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` respectively. +* You should set your BrowserStack Username and Access Key as GitHub Secrets `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` respectively. ## Usage 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: From ceca66c0a9e18f4a4d5181072294a315952fae65 Mon Sep 17 00:00:00 2001 From: Sourav Kundu <66624530+sourav-kundu@users.noreply.github.com> Date: Thu, 20 Aug 2020 12:10:55 +0530 Subject: [PATCH 11/16] wording change Co-authored-by: Rohan Chougule --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a167a3..690336d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ If you want to test your open source project on BrowserStack then [sign-up here] * You should set your BrowserStack Username and Access Key as GitHub Secrets `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` respectively. ## Usage -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: +As this is a library of Actions, invoking this Action will trigger the `setup-env` Action internally. The following usage example will **only** set up the required environment variables: ```yaml - name: BrowserStack Action From 787f69e0ffbce1f44a8796cce3a68d2656a749a8 Mon Sep 17 00:00:00 2001 From: Sourav Kundu <66624530+sourav-kundu@users.noreply.github.com> Date: Thu, 20 Aug 2020 12:39:52 +0530 Subject: [PATCH 12/16] Update README.md Co-authored-by: Rohan Chougule --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 690336d..a74f15c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you want to test your open source project on BrowserStack then [sign-up here] ## Available Actions * [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. -* [setup-local](./setup-local): This Action 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. +* [setup-local](./setup-local): This Action 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 environment. **You do not need this Action if the application to be tested is accessible over the public internet.** ## Pre-requisites * You should set your BrowserStack Username and Access Key as GitHub Secrets `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` respectively. From 4217638536b8d720566e4a32504a90a9ed697af1 Mon Sep 17 00:00:00 2001 From: Sourav Kundu <66624530+sourav-kundu@users.noreply.github.com> Date: Thu, 20 Aug 2020 12:47:55 +0530 Subject: [PATCH 13/16] Update README.md Co-authored-by: Rohan Chougule --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a74f15c..e7aa3be 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ As this is a library of Actions, invoking this Action will trigger the `setup-en 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. ## Sample Workflow with usage of both Actions -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 +The workflow example below would be useful when the web application to be tested is hosted on the GitHub Actions runner environment, i.e. not accessible from the public Internet. ```yaml name: 'BrowserStack Test' From 49eb3cdd21eade1bc664e4c2e904bc6ecf94298d Mon Sep 17 00:00:00 2001 From: Sourav Kundu <66624530+sourav-kundu@users.noreply.github.com> Date: Thu, 20 Aug 2020 12:49:33 +0530 Subject: [PATCH 14/16] Update README.md Co-authored-by: Rohan Chougule --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7aa3be..a5e8951 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you want to test your open source project on BrowserStack then [sign-up here] * [setup-local](./setup-local): This Action 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 environment. **You do not need this Action if the application to be tested is accessible over the public internet.** ## Pre-requisites -* You should set your BrowserStack Username and Access Key as GitHub Secrets `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` respectively. +* You should set your BrowserStack Username and Access Key as GitHub Secrets, i.e. `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` respectively. ## Usage As this is a library of Actions, invoking this Action will trigger the `setup-env` Action internally. The following usage example will **only** set up the required environment variables: From 41ab5858c0495f5d48d631eef1058569de0fd208 Mon Sep 17 00:00:00 2001 From: Rohan Chougule Date: Thu, 20 Aug 2020 13:14:20 +0530 Subject: [PATCH 15/16] add: parent action readme. Fix: yaml snippet prettier in readme. --- README.md | 12 ++++++++---- setup-env/README.md | 4 ++-- setup-local/README.md | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a5e8951..5a9e9df 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ This respository contains a library of GitHub Actions to help you integrate your test suite with the [BrowserStack](https://browserstack.com) device cloud. -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. +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. + If you want to test your open source project on BrowserStack then [sign-up here](https://www.browserstack.com/open-source) for lifetime free access to all our products. ## Available Actions @@ -25,7 +26,7 @@ As this is a library of Actions, invoking this Action will trigger the `setup-en build-name: BUILD_INFO project-name: REPO_NAME ``` -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. +We recommend you to invoke the Actions individually depending on the use case. A sample workflow for the same 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. ## Sample Workflow with usage of both Actions The workflow example below would be useful when the web application to be tested is hosted on the GitHub Actions runner environment, i.e. not accessible from the public Internet. @@ -52,9 +53,12 @@ jobs: local-testing: start local-identifier: random ``` -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. -After you are done running your tests, invoke the `setup-local` Action again with `local-testing: stop` as an input: +### Note +--- +Post these steps, you will have to build and run your application web server on the same runner environment. Further, invoke your test scripts by utilizing the environment variables that have been set by actions. 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. + +After you are done running your tests, invoke the `setup-local` Action again with `local-testing: stop` as the input: ```yaml - name: 'BrowserStackLocal Stop' uses: 'browserstack/github-actions/setup-local@master' diff --git a/setup-env/README.md b/setup-env/README.md index c1e0d07..950a259 100644 --- a/setup-env/README.md +++ b/setup-env/README.md @@ -16,7 +16,7 @@ This action sets up the following environment variables in the runner environmen * This action does not have any prerequisites. ## Usage -``` +```yaml - name: 'BrowserStack Env Setup' uses: 'browserstack/github-actions/setup-env@master' with: @@ -28,7 +28,7 @@ This action sets up the following environment variables in the runner environmen or -``` +```yaml - name: 'BrowserStack Env Setup' uses: 'browserstack/github-actions/setup-env@master' with: diff --git a/setup-local/README.md b/setup-local/README.md index 7e122b5..83263c5 100644 --- a/setup-local/README.md +++ b/setup-local/README.md @@ -39,7 +39,7 @@ The **browserstack/github-actions/setup-env@master** action should have been inv ## Usage Use the code snippet below in your workflow to start the BrowserStackLocal binary and establish the tunnel connection: -``` +```yaml - name: 'Start BrowserStackLocal Tunnel' uses: 'browserstack/github-actions/setup-local@master' with: @@ -49,7 +49,7 @@ Use the code snippet below in your workflow to start the BrowserStackLocal binar ``` 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): -``` +```yaml - name: 'Stop BrowserStackLocal' uses: 'browserstack/github-actions/setup-local@master' with: From 1c541023ddd5d66c673a133fd7ae5ecb9d79a63e Mon Sep 17 00:00:00 2001 From: Rohan Chougule Date: Thu, 20 Aug 2020 13:18:46 +0530 Subject: [PATCH 16/16] add: missing comma in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a9e9df..8878773 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This respository contains a library of GitHub Actions to help you integrate your 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. -If you want to test your open source project on BrowserStack then [sign-up here](https://www.browserstack.com/open-source) for lifetime free access to all our products. +If you want to test your open source project on BrowserStack, then [sign-up here](https://www.browserstack.com/open-source) for lifetime free access to all our products. ## Available Actions * [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.