Last active
January 18, 2017 21:04
-
-
Save jankcat/2e5fa29fdf92443857097076191c5c66 to your computer and use it in GitHub Desktop.
Example Mocha/BrowserStack-Local combo, that works now!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import assert from 'assert'; | |
import test from 'selenium-webdriver/testing'; | |
var browserstack = require('browserstack-local'); | |
var local = new browserstack.Local(); | |
let localOptions = { | |
'key': '...accessKeyHere...' | |
}; | |
test.before(function(done) { | |
this.timeout(30000); | |
console.log('Starting BrowserStack-Local...'); | |
local.start(localOptions, ()=>{ | |
console.log("Started BrowserStack-Local."); | |
// ...Code here to start WebDriver... | |
done(); | |
}); | |
}); | |
test.after(function() { | |
this.timeout(30000); | |
// ...Code here to stop WebDriver... | |
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... | |
assert.equal(1,1); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment