Skip to content

Include example on how to use this with Mocha/Se #26

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 1 commit 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: 33 additions & 0 deletions mocha-se-example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import assert from 'assert';
import test from 'selenium-webdriver/testing';
var browserstack = require('browserstack-local');
var local = new browserstack.Local();
let localOptions = {
'key': 'BrowserStack Access Key Goes Here!'
};

test.before(function(done) {
this.timeout(30000);
console.log('Starting BrowserStack-Local...');
local.start(localOptions, ()=>{
console.log("Started BrowserStack-Local.");
// ...Code to start WebDriver goes here...
done();
});
});

test.after(function() {
this.timeout(30000);
// ...Code to stop WebDriver goes here...
console.log('Stopping BrowserStack-Local...');
local.stop(()=>{
console.log("Stopped BrowserStack-Local");
});
});

test.describe('Example Test Suite 1', function() {
this.timeout(30000);
test.it('Example Test Case 1', function() {
// ...Test Case Code goes here...
});
});