Background
When testing real iOS devices on BrowserStack, URLs that have the localhost domain get redirected to bs-local.com. At the time of this writing, it appears as though BrowserStack drops the port and the query string from URLs that are redirected this way. I have filed a support request with BrowserStack to discuss this issue.
Problem
It is possible to specify a per-browser URL when configuration BrowserStack browsers in Karma. For example, I might configure a real iOS device like this:
{
base: 'BrowserStack',
os: 'iOS',
os_version: '12',
device: 'iPhone 8',
browser: 'iPhone',
real_mobile: 'true',
// BrowserStack seems to drop the port when redirecting to this special
// domain so we go there directly instead:
url: 'http://bs-local.com:9876'
}
Unfortunately, when configuring browsers this way, the browser ID provided by Karma is overwritten during this Object.assign call, where args contains our original browser configuration:
|
var settings = Object.assign( |
|
{ |
|
url: url + '?id=' + id, |
|
'browserstack.tunnel': true |
|
}, |
|
globalSettings, |
|
args |
|
) |
Request
Despite what BrowserStack is doing (which seems like a bug on their side), it seems as though the browser id should be appended after this Object.assign call so that a custom URL can be safely provided (such as in our example above).
I would be willing to submit a pull request for consideration if you find this request agreeable.
Background
When testing real iOS devices on BrowserStack, URLs that have the
localhostdomain get redirected tobs-local.com. At the time of this writing, it appears as though BrowserStack drops the port and the query string from URLs that are redirected this way. I have filed a support request with BrowserStack to discuss this issue.Problem
It is possible to specify a per-browser URL when configuration BrowserStack browsers in Karma. For example, I might configure a real iOS device like this:
Unfortunately, when configuring browsers this way, the browser ID provided by Karma is overwritten during this
Object.assigncall, whereargscontains our original browser configuration:karma-browserstack-launcher/index.js
Lines 143 to 150 in 76dbfd0
Request
Despite what BrowserStack is doing (which seems like a bug on their side), it seems as though the browser
idshould be appended after thisObject.assigncall so that a custom URL can be safely provided (such as in our example above).I would be willing to submit a pull request for consideration if you find this request agreeable.