This repository has been archived by the owner on Oct 10, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: support custom loopback hostname
- Loading branch information
Showing
2 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
var Zuul = require('../../'); | ||
|
||
var auth = require('../auth'); | ||
var assert = require('assert'); | ||
var URL = require('url'); | ||
|
||
test('sauce connect without loopback option', function(done) { | ||
var config = { | ||
ui: 'mocha-bdd', | ||
sauce_connect: true, | ||
username: auth.username, | ||
key: auth.key | ||
}; | ||
|
||
var zuul = Zuul(config); | ||
|
||
zuul.browser({ | ||
name: 'internet explorer', | ||
version: '11' | ||
}); | ||
|
||
var browser = zuul._browsers[0]; | ||
|
||
browser.on('init', function(browserConfig, url) { | ||
assert.equal(zuul._config.sauce_connect, true) | ||
assert.equal(zuul._config.tunnel, false) | ||
assert.equal(URL.parse(url).hostname, 'localhost') | ||
|
||
browser.shutdown(); | ||
}); | ||
|
||
browser.on('done', function(/*stats*/) { | ||
done(); | ||
}); | ||
|
||
browser.on('error', done); | ||
|
||
browser.start(); | ||
}); | ||
|
||
test('sauce connect with loopback option', function(done) { | ||
var config = { | ||
ui: 'mocha-bdd', | ||
sauce_connect: true, | ||
loopback: 'test.local', | ||
username: auth.username, | ||
key: auth.key | ||
}; | ||
|
||
var zuul = Zuul(config); | ||
|
||
zuul.browser({ | ||
name: 'internet explorer', | ||
version: '11' | ||
}); | ||
|
||
var browser = zuul._browsers[0]; | ||
|
||
browser.on('init', function(browserConfig, url) { | ||
assert.equal(zuul._config.sauce_connect, true) | ||
assert.equal(zuul._config.tunnel, false) | ||
assert.equal(URL.parse(url).hostname, 'test.local') | ||
|
||
browser.shutdown(); | ||
}); | ||
|
||
browser.on('done', function(/*stats*/) { | ||
done(); | ||
}); | ||
|
||
browser.on('error', done); | ||
|
||
browser.start(); | ||
}); |