Skip to content

Fix example #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,40 @@ var bs_local = new browserstack.Local();
// replace <browserstack-accesskey> with your key. You can also set an environment variable - "BROWSERSTACK_ACCESS_KEY".
var bs_local_args = { 'key': '<browserstack-accesskey>' };


function yourTest(callback) {

// your test goes here

callback()
}


// starts the Local instance with the required arguments
bs_local.start(bs_local_args, function() {
console.log("Started BrowserStackLocal");
});

// check if BrowserStack local instance is running
console.log(bs_local.isRunning());
// check if running
if (bs_local.isRunning()) {

// run your test here
yourTest(function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe using a much more contextual name like testScenario or something on these lines?

bs_local.stop(function() {
console.log("Stopped BrowserStackLocal");
});
});

} else {

// Error
console.log("BrowserStack Local didn't run properly");

}

// stop the Local instance
bs_local.stop(function() {
console.log("Stopped BrowserStackLocal");
});



```

## Arguments
Expand Down