admc / wd

A node.js client for webdriver/selenium 2.
Other
1.53k stars 404 forks source link

promiseChainRemote does not allow https #618

Open roelandvanbatenburg opened 4 years ago

roelandvanbatenburg commented 4 years ago

We are using kobiton to test our app. When upgrading wd from 1.11.4 to 1.12.1 we get the following error:

 FAIL  e2e/kobitonAndroid.test.e2e.ts
  ● Test suite failed to run

    TypeError: [quit()] Protocol "https:" not supported. Expected "http:"

      at Request.start (node_modules/request/request.js:751:32)
      at Request.end (node_modules/request/request.js:1511:10)
      at end (node_modules/request/request.js:564:14)
      at node_modules/request/request.js:578:7
      at Immediate._onImmediate (node_modules/@jest/fake-timers/build/jestFakeTimers.js:516:20)

This is caused by how we call promiseChainRemote:

const kobitonServerConfig = {
  protocol: 'https',
  host: 'api.kobiton.com',
  auth: `${username}:${apiKey}`,
};

const driver = wd.promiseChainRemote(kobitonServerConfig);

I'm not sure where to look for a fix. If you need any additional information I'm happy to provide it. Thanks!

roelandvanbatenburg commented 4 years ago

Just noticed this is picked up in https://github.com/admc/wd/pull/617