Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Browser ID not appended when specifying browser-specific URL #172

Open
cdata opened this issue Mar 10, 2020 · 0 comments
Open

Browser ID not appended when specifying browser-specific URL #172

cdata opened this issue Mar 10, 2020 · 0 comments

Comments

@cdata
Copy link

cdata commented Mar 10, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant