-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest.js
More file actions
executable file
·41 lines (35 loc) · 1.08 KB
/
test.js
File metadata and controls
executable file
·41 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env node
const webdriver = require('selenium-webdriver')
const browserstack = require('browserstack-local')
const local = new browserstack.Local()
var capabilities = {
'build': 'Docker example',
'browserName': 'chrome',
'os': 'OS X',
'browserstack.local': true,
'browserstack.user': process.env.BROWSERSTACK_USERNAME,
'browserstack.key': process.env.BROWSERSTACK_ACCESS_KEY
}
var options = {
'key': process.env.BROWSERSTACK_ACCESS_KEY
}
console.log('Starting tunnel...')
local.start(options, function (error) {
if (error) {
console.error('Received error while starting tunnel', error)
process.exit(1)
}
console.log('Is Running', local.isRunning())
console.log('Started')
var driver = new webdriver.Builder().usingServer('http://hub.browserstack.com/wd/hub').withCapabilities(capabilities).build()
driver.get('http://www.browserstack.com').then(function () {
driver.getTitle().then(function (title) {
console.log(title)
})
driver.quit().then(function () {
local.stop(function () {
console.log('Stopped')
})
})
})
})