cd
into the project directory and install the package using
npm install --save-dev "DevExpress/testcafe-browser-provider-browserstack#master"
- This will update the
package.json
and will build the package directly from github.
$ cat package.json
...
"testcafe-browser-provider-browserstack": "github:DevExpress/testcafe-browser-provider-browserstack#master"
...
- Clone the browserstack provider repository
git clone https://github.com/DevExpress/testcafe-browser-provider-browserstack.git
- Install the dependencies
cd testcafe-browser-provider-browserstack
npm install
- Build the package, using gulp
./node_modules/.bin/gulp build
- Link the package globally
npm link
- This should link the package globally.
Spawn the BrowserStackLocal
binary in a new window and pass a local-identifier to identify the tunnel connection.
This is required by testcafe to identify the tunnel through which data has to be sent.
./BrowserStackLocal --key <access-key> --local-identifier <local-identifier-string> --verbose 3
If we want to use the already running local binary for the tests, we need to pass an environment variable to set the
identifier for testcafe. This can be done using export BROWSERSTACK_LOCAL_IDENTIFIER=<local-indentifier-string>;
.
Sample command using this environment variable to start an automate testcafe session:
export BROWSERSTACK_BUILD_ID='<build-name>'; export BROWSERSTACK_USE_AUTOMATE=1; export BROWSERSTACK_LOCAL_IDENTIFIER='<local-identifier-string>'; testcafe 'browserstack:chrome' simple_fixture.testcafe.js
To use the locally built testcafe plugin in your code. We have to first link the package globally and install that package
from filesystem into the respective projects package.json
. This can be easily done by using npm install <path-to-testcafe-browser-provider-browserstack-foler>
.
This will link the global package to your local dependencies.