Skip to content

Commit 3efc6ed

Browse files
committed
[Issue #11] Support for localIdentifier capability
1 parent dce5caa commit 3efc6ed

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ This will create a sample `browserstack.json` file. This file can be used to con
6060
"customBuildName": "build 1"
6161
},
6262
"connection_settings": {
63-
"local": false
63+
"local": false,
64+
"localIdentifier": ""
6465
}
6566
}
6667
```
@@ -80,6 +81,7 @@ The following table provides a reference for all the options that can be provide
8081
| `project` | Name of your project. This will be displayed in your Automate dashboard, and you'll be able to search & filter your tests based on the project name. | A string providing the name of the project |
8182
| `customBuildName` | Helps in providing a custom name for the build. This will be displayed in your Automate dashboard, and you'll be able to search & filter your tests based on the build name. | A string providing the name of the build |
8283
| `local` | Helps in testing websites that cannot be accessed in public network. If you set this to `true`, please download the Local binary and establish a local connection first (you can learn how to do so [here](https://www.browserstack.com/local-testing/automate#command-line)) | Boolean: `true` / `false`. Set this to `true` if you need to test a local website. Set this to `false` if the website is accessible publicly. |
84+
| `localIdentifier` | Configure the test script to run through a specific connection. To do so, set the value of localIdentifier capability to be a unique connection name. | Set this when `local` is set to `true`. |
8385

8486
### Running the tests
8587
You can start running your test build using the following command.

bin/helpers/capabilityHelper.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ const caps = (bsConfig, zip) => {
3333
if (bsConfig.connection_settings.local === true) obj.local = true;
3434
logger.log(`Local is set to: ${obj.local}`);
3535

36+
// Local Identifier
37+
obj.localIdentifier = bsConfig.connection_settings.localIdentifier;
38+
if (obj.localIdentifier) logger.log(`Local Identifier is set to: ${obj.localIdentifier}`);
39+
3640
// Project name
3741
obj.project = bsConfig.run_settings.project
3842
if (!obj.project) logger.log(`Project name is: ${obj.project}`);

bin/templates/configTemplate.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ module.exports = function () {
1717
"customBuildName": "build-name"
1818
},
1919
"connection_settings": {
20-
"local": false
20+
"local": false,
21+
"localIdentifier": null
2122
}
2223
}
2324
var EOL = require('os').EOL

0 commit comments

Comments
 (0)