Commit Graph
13 Commits
Author SHA1 Message Date
Isaac A. Murchie 04af064564 Update appium-gulp-plugins (#266) 2018-10-03 09:00:58 -04:00
Mykola Mokhnach d80a78a615 Fix protocol detection inside the routing function (#257) 2018-09-08 20:39:08 +02:00
Mykola Mokhnach e50ef5e6aa Remove the redundant logging from getResponseForW3CError helper (#252) 2018-08-24 16:25:56 +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 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
Dan Graham a74d25cb1e Fix: Throw error after parsing protocol from proxied response (#211)
* Before it was throwing immediately which meant we weren't parsing the protocol and weren't showing the proper error responses
* If proxied W3C error doesn't have an error, make it `Unknown Error`
2018-05-14 08:36:49 -07:00
Mykola Mokhnach e42e77a19e Sync w3c codes with the recent spec (#193) 2018-03-05 19:19:45 +01:00
Mykola Mokhnach d62cb5a471 Add missing error codes (#192)
* Add missing error codes

* Add more logging

* Fix sime unit tests

* Add NoSuchFrameError W3C error

* Address comments

* Fix the unit test
2018-03-05 07:41:50 +01:00
Dan Graham a14aa5f428 Convert JSONWP proxy errors (#188)
* Convert JSONWP proxy errors
  * Previously, if a proxied response has a status code >= 0 but http status code 200, the error is thrown but it's an unknown error because the 'getResponseForW3CError' function doesn't translate the error
  * Now, it translates the JSONWP error using logic we already have that accomplishes this
  * Added E2E test that tests a proxy that returns 200 but status 7 to check that it throws the correct ElementNotFoundError
  * Added unit test to handle the new case in 'getResponseForW3CError'
2018-02-19 09:22:01 -08:00
Dan Graham b00cc4489b Parse strings for W3C and JSON (#184) 2018-02-07 10:39:15 -08: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