65 Commits
Author SHA1 Message Date
Mykola Mokhnach 5adf31c26c chore: Never apply automatic proxy config to JWProxy requests (#421) 2020-07-12 12:54:15 +02:00
Mykola Mokhnach 9015d4c80d fix: Properly assign connection pools for JW proxy (#416) 2020-06-05 14:24:34 +02:00
Mykola Mokhnach 2ff2270ad5 chore: Print a compact message for 'socket hang up' error (#415) 2020-05-28 18:55:00 +02:00
Mykola Mokhnach 36590282f5 chore: do not print full stack traces for connection errors (#412) 2020-05-21 07:43:33 +02:00
Mykola Mokhnach faf0fb2a7c refactor: Move common constants to a separate file to avoid unnecessary cross-imports (#411) 2020-05-20 20:06:04 +02:00
Mykola Mokhnach 5b5d6dde28 fix: Adjust the validation of proxied requests (#410) 2020-05-05 21:02:32 +02:00
Mykola Mokhnach aeffcd402d refactor: Use axios for the actual proxy implementation instead of the deprecated request module (#409)
BREAKING CHANGE: The request method of Proxy class now accepts and returns axios-specific values
BREAKING CHANGE: The default value of keepAlive setting has been changed to true
2020-05-05 16:52:14 +02:00
Mykola Mokhnach 02aeb179b9 chore: Simplify proxy logging flow (#389) 2020-02-26 11:45:19 +01:00
Mykola Mokhnach 168a01af69 fix: Fix the request options for different keepAlive values (#367) 2019-11-07 18:37:17 +01:00
Mykola Mokhnach e2b4fb3570 fix: Tune status presence verification for generic protocol (#355) 2019-09-05 20:09:15 +02:00
Mykola Mokhnach 9af62586f5 fix: Patch downstream responses for unknown upstream protocol (#353) 2019-09-03 07:25:12 +02:00
Jonathan Lipps cc8b879da2 feat: stop hardcoding /wd/hub and make route prefix configurable [BREAKING CHANGE] (#346) 2019-08-27 09:23:10 -07:00
Mykola Mokhnach 568671e90e fix: Do not print stack for request errors (#352) 2019-08-22 18:35:55 +02:00
Mykola Mokhnach 3af13feece fix: Fix session identifier retrieval for W3C protocol (#351) 2019-08-22 07:42:12 +02:00
Mykola Mokhnach f74d12dcc7 fix: Properly log request errors (#348) 2019-08-19 19:39:01 +02:00
Mykola Mokhnach f64d116e2c Update response handling for proxyReqRes call (#344) 2019-08-10 19:29:51 +02:00
Mykola Mokhnach 4472331cc0 Improve the logic of proxyReqRes method (#337) 2019-07-19 20:03:12 +02:00
Mykola Mokhnach ed16a689d3 Update the logic that determines the session protocol (#336) 2019-07-18 19:15:14 +02:00
Mykola Mokhnach 70fa8319f9 Optimize memory usage by proxy class (#334) 2019-07-03 22:41:00 +02:00
Dan-Maor b7b0a72b24 added keepalive option to JWProxy (#325) 2019-05-13 08:24:22 -04:00
Isaac A. Murchie b188ee9b20 Only get message from error (#324) 2019-05-07 16:37:12 -04:00
Jonathan Lipps 2fd5db2a34 add some logging to help follow proxy protocol translation logic 2019-04-04 07:53:31 -07:00
greenkeeper[bot] 4eab674f92 Update eslint-config-appium to the latest version 🚀 (#295)
* chore(package): update eslint-config-appium to version 4.0.1

* chore: fix linting
2019-01-07 13:11:57 -06:00
Jonathan Lipps 8d699e0359 rename the jsonwp proxy logger so it's less confusing in the logs (#291) 2018-12-10 15:00:59 -08:00
Isaac Murchie 2f4366187a Fix exports for new Babel 2018-10-03 09:17:26 -04:00
Isaac A. Murchie 04af064564 Update appium-gulp-plugins (#266) 2018-10-03 09:00:58 -04:00
Mykola Mokhnach f9581f1642 Limit the count of request agents in the proxy pool (#260) 2018-09-19 09:12:59 -07:00
Mykola Mokhnach deb775bd0c Properly handle POST /window conversion between protocols (#253)
* Properly handle POST /window conversion between protocols
2018-08-28 16:59:31 +02:00
Mykola Mokhnach f909201791 Add JSONWP<>W3C mapping for window/handles endpoint (#251) 2018-08-21 21:50:00 +02:00
Mykola Mokhnach 5231fae89b Apply additional fixes to timeouts handler (#250)
* Apply additional fixes to timeouts handler

* Address comments

* Update the rest of tests

* Remove unused import

* fix the unit test
2018-08-15 15:26:47 +02:00
Mykola Mokhnach b161cb9527 Tune arguments transformation for /timeouts API call (#248)
* Tune arguments transformation for /timeouts API call

* Tune number verification

* Remove unnecessary validator

* Remove obsolete tests
2018-08-14 10:48:19 +02:00
Isaac A. Murchie 855ebe15de Add method to check for unknown error (#242)
* Add method to check for unknown error

* Do not catch and re-throw proxied error

* Fix isUnknownError function and clean up handling
2018-07-26 13:11:47 -04:00
Isaac A. Murchie 42f64a87d9 Get message for MJSONWP error (#241)
* Get message for MJSONWP error

* Add comment

* Change parameter, and make work for espresso driver
2018-07-25 13:26:08 -04:00
Mykola Mokhnach dfae5caf62 Properly handle MJSONWP responses with non-zero status and return code < 400 (#240)
* Properly handle MJSONWP responses with non-zero status and return code < 400

* code 500 looks more appopriate

* Optimize downstream protocol detection

* Update the unit test

* Update errors handling inside proxyReqRes

* Improve the condition
2018-07-25 08:34:45 +02:00
Isaac A. Murchie 2bb0be7ad9 Fix handling of proxy url (#239)
* Fix handling of proxy url

* Allow no base in original proxy url
2018-07-24 15:45:22 -04:00
Mykola Mokhnach 6c81d550d9 Try to fix the destination URL if the upstream and downstream drivers operate different protocols (#238)
* Try to fix the destination URL if the upstream and downstream drivers operate different procotols

* detect route name in smarter manner

* Fix command name extraction

* consider the situation where url is equal to the endpoint

* Simplify helper functions

* Refactor command name extraction

* Refactor urls fixing

* Cache downstream procotol

* speed up downstream protocol detection

* Address comments

* Minor tunings
2018-07-24 15:25:31 +02:00
Isaac Murchie ff7320d355 Revert 0fd07f9332 2018-07-20 12:19:03 -04:00
Isaac A. Murchie 0fd07f9332 Add base to regexp for original proxy url (#236)
* Add base to regexp for original proxy url

* Add test
2018-07-19 09:26:31 -07:00
Dan Graham c6c56093f5 Handle /timeouts W3C + MJSONWP proxying (#231) 2018-07-11 09:05:01 -07:00
Jonathan Lipps 1b63101ca9 use safer error type check 2018-06-10 10:50:50 -07:00
Mykola Mokhnach 165543e16d Avoid throwing proxy request error inside command call (#220)
* Avoid throwing proxy request error inside command call

* Tune stacktrace handling for W3C

* Fix var name

* Apply safer check

* Tune the verification
2018-06-08 19:49:41 +02:00
Mykola Mokhnach bd398761dc Fix sending of commands by JWProxy class (#218) 2018-06-07 06:47:00 +02:00
Mykola Mokhnach 72dd453b9a Enforce UTF-8 encoding on request headers (#214)
* Enforce UTF-8 encoding on request headers

* Return all headers in lowercase as per HTTP/2 requirement
2018-05-29 07:15:23 +02:00
Isaac A. Murchie 2e0b162331 Check for proxied error (#212)
* Check for proxied error

* Fix issue
2018-05-22 09:00:02 -04:00
Dan Graham 7ffda66813 Fixed W3C error messaging (#182)
* Do proxying for W3C responses
  * If a W3C Response is provided by a proxy, map to the correct error
  * Checks if `value` is an object and `value.error` and maps it based on that (`value.error` is the W3C error code)
  * Broke off `errorFromCode` into `errorFromMJSONWPStatusCode` and `errorFromW3CJsonCode`
* Rename '.error' property to correct W3C property
  * The error property in the ProtocolError objects should match up with https://www.w3.org/TR/webdriver/#handling-errors under the 'JSON Error Code' column
  * Added tests for all of these
* Make ProxyRequestError work for W3C
  * Added an arg called `.w3c` that passes in the proxied W3C error
  * Fixed the `getActualError` function that looks for the .w3c variable and parses error from the code
2018-02-05 11:55:56 -08:00
Dan Graham 97c02c8af0 Rename 'mjsonwp' to 'protocol' (#178)
* Rename 'mjsonwp' to 'protocol'
  * Renamed folder from 'mjsonwp' to 'protocol' in `lib/` and `test/`
  * Renamed 'mjsonwp.js' to 'protocol.js'
  * Renamed any import statements that use 'mjsonwp'
  * _Possible breaking change_: MJSONWireProtocol class exposed in index was renamed to just Protocol.... checked Appium repo and found no libraries that use MJSONWireProtocol
* Lint fix
2018-01-29 12:41:14 -08:00
cschabetsberger-micro-focus b7b0b7b2f3 Detect a non-working chromedriver connection after androidDriver.closeApp() and androidDriver.launchApp() (#136)
* * Make sure to detect a non-working chromedriver connection after calling androidDriver.closeApp() and androidDriver.launchApp() by returning the result body (resBody) only if it does not contain a status code

* Adapted unit test to cover the case when chromedriver responds with http
200 but status code != 0 (which represents an error)
Also fixed a typo in another test description
2017-10-13 09:05:02 -04:00
Isaac A. Murchie 01e9914b66 Update linting and add coverage (#131) 2017-08-15 08:53:47 -04:00
Mykola Mokhnach dd084953b8 Add warning message for erroneous responses to make debugging easier (#119) 2017-05-16 09:47:09 -07:00
Mykola Mokhnach d5ffe5773a Add proxy method to verify whether it has a request in progress and to cancel active requests (#105) 2017-02-21 08:49:43 -05:00