221 Commits
Author SHA1 Message Date
Isaac A. Murchie 5f318b4eef Remove list of valid automation names (#229) 2018-06-29 11:02:08 -04:00
Mykola Mokhnach 94522d13be Log errors, which happens during caps merging (#228) 2018-06-27 22:04:04 +02:00
flyofsky 89da842132 Add Tizen tag in desired-caps.js for supporting Tizen (#1) (#227) 2018-06-25 12:52:18 -04:00
Kazuaki Matsuo f4b89448d6 add format in deviveTime as a parameter (#225) 2018-06-12 07:59:39 +09: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
Dan Graham f72dc5a3ac Fix: Make 'reset' re-use same protocol (#219)
* Before, reset was creating a new session and using the processed caps
* The problem with is, if it was W3C it would create a MJSONWP
* Now it checks the protocol before resetting and passes in the appropriate args to createSession depending on the protocol type
2018-06-07 13:15:28 -07:00
Mykola Mokhnach bd398761dc Fix sending of commands by JWProxy class (#218) 2018-06-07 06:47:00 +02:00
greenkeeper[bot] 8439803500 Update dependencies to enable Greenkeeper 🌴 (#216)
* chore(package): update dependencies

* docs(readme): add Greenkeeper badge

* chore: adapt code to updated dependencies
2018-06-04 14:48:50 -04: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 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
Dan Graham 8890bef9f1 Use protocol-specific logger (#209) 2018-05-12 11:20:21 -07:00
Mykola Mokhnach 0765c92d7b Add an optional flags parameter to press_key_code endpoint (#208) 2018-05-07 18:29:21 +02:00
Mykola Mokhnach 700017fccf Add missing await (#207) 2018-05-06 08:03:05 +02:00
Isaac A. Murchie 1f87d0e289 Update dependencies (#206)
* Update deps

* Fix a couple of tests

* Fix protocol tests

* Fix timeout in helper and protocol tests
2018-04-27 11:08:08 -04:00
Mykola Mokhnach 6311b34615 Add an universal endpoint for images comparison (#203)
* Add an universal endpoint for images comparison

* Rename arguments

* Add documentation

* Raise appium-support version
2018-04-19 15:53:15 +02:00
Isaac Murchie 3b17f6a7ed Remove query string from attempt to find route 2018-04-19 06:53:01 -04:00
Isaac Murchie 8937df19fe Get route name for / 2018-04-12 11:54:55 -05:00
Dan Graham 7bf5a3e6d7 Fix protocol parsing (#201)
* Some problems with parsing `{protocol: <protocol>, value: <value>}`
  * `(!_.isNil(driverRes.value)` was incorrect check because `value` can be undefined or null; replaced it with `_.has(driverRes, 'value')` to check that the `value` property was set
  *  ```
       if (driverRes.value) {
          driverRes = driverRes.value;
        } 
      ``` 

      was also incorrect because `driverRes.value` may be false-y

* Moved logic into it's own function and then added tests to cover the problem cases
2018-04-04 09:54:21 -07:00
Mykola Mokhnach 2cb6695446 Send request along with websocket instance (#200) 2018-03-29 14:29:22 +02:00
Dan Graham f7f822611c Parse protocol from executeCommand (#195)
* If`executeCommand` returns an object that has a property 'protocol' and either a 'value' property or an 'error' property, respond with the provided protocol
* If the object is of this form, than it came from another driver that knows what protocol is being used so we re-assign the protocol to whatever was reported
* Added to delay in the 'unexpected exits' test because I was getting a race condition
2018-03-27 14:00:36 -07:00
Mykola Mokhnach 59235da587 Add endpoints for system clipboard interaction (#199)
* Add endpoints for system clipboard interaction

* Fix get endpoint
2018-03-26 14:46:37 +02:00
Mykola Mokhnach 8a48eb3f94 Tune prefix handling for web socket pathnames (#198) 2018-03-23 18:44:33 +01:00
Mykola Mokhnach b1648467dc Add common websocket handlers (#196)
* Add common websocket handlers

* tune the default prefix

* Add integration test

* Tune the test

* Fix the functional test

* Tune socket import

* Address review comments

* Tune some expectations
2018-03-22 16:21:02 +01:00
Dan Graham da4f28f7d9 Fix: Determine protocol in createSession (#194)
* Previously, we were only checking the HTTP payload to see what protocol should be
* This is inadequate, in the case of drivers that don't proxy W3C Capabilities yet
* The fix now is to set the protocol in `createSession` to see if the W3C caps were proxied through, if they're not, set protocol to MJSONWP
* Added unit test and one e2e test to confirm that this works
2018-03-14 15:44:50 -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
Isaac A. Murchie b143cff884 Add logging commands to the base driver (#191)
* Add logging commands to the base driver

* Address comments
2018-02-23 12:02:20 -05:00
Linda_pp bd5b5379a0 fix the default value of payload parameters (#190) 2018-02-23 05:53:28 -05:00
Mykola Mokhnach c0bb5166c8 Print more advanced error message for non-supported protocols (#189) 2018-02-21 17:20:48 +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
Mykola Mokhnach d47d597731 Add urls caching logic (#187)
* Add urls caching logic

* Tune date verification

* Fix dictionary access

* tune try/catch scope

* simplify the condition
2018-02-16 14:51:16 +01:00
Mykola Mokhnach d9ee071707 Properly handle unexpected socket errors (#186) 2018-02-13 16:21:57 -08:00
Mykola Mokhnach c679d534e4 Change the request type of queryAppState to POST (#185)
* Change the request type of queryAppState to POST

* Keep GET template
2018-02-08 14:38:26 +01: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
Mykola Mokhnach c8d1a1f7da Add an endpoint for application activation (#181) 2018-01-31 14:47:40 +01:00
Isaac Murchie 074697f061 More readable caps in docs 2018-01-30 07:22:20 -05:00
Dan Graham dc662f5181 Update protocol documentation (#180) 2018-01-29 12:44:23 -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
Dan Graham 85c0085292 Renamed MJSONWPError to ProtocolError (#177)
* Changed the logger to be 'W3C' when it's W3C protocol and 'MJSONWP' when it's MJSONWP protocol
2018-01-29 11:34:33 -08:00
Mykola Mokhnach 240961ecdd Tune application management endpoints (#179)
* Tune endpoints for applications management

* Add options param to terminateApp
2018-01-29 14:44:08 +01:00
Dan Graham b2a7c5e73f Add W3C Error Response (#176)
* Fixed HTTPResponseBody for W3C error
  * Refactored `getResponseForW3CError` into errors.js file
  * Changed method so that it returns `{value: {stack: '...', message: '...', error: '...'}}`
    * Message is the same as the JSONWP error message
    * Error is a static message indicating the type of error
    * 'stack' is the callstack provided in the error
  * Added W3C 'error' messages to all of the errors
* Make 'getResponseForW3CError' handle BadParametersError
* Refactor 'getResponseForJsonwpError' to errors.js
2018-01-25 10:50:50 -08:00
Dan Graham 129dd86976 Rename ELEMENT key to W3C format (#175)
* If server encounters a response that has the wrong key name (ELEMENT when it should be 'element-6066-11e4-a52e-4f735466cecf'), rename all instances of that key
* Added a helper method (with tests) that recursively finds instances of a 'key' and renames it
* Added e2e test that mocks `findElements`, calls `/elements` endpoint and verifies that the payload was correctly renamed
2018-01-19 11:43:24 -08:00
Dan Graham 9ac3bdd634 Consolidate non-prefixed caps warnings (#174)
* Previously, it was going through alwaysMatch and all of the firstMatch caps and individually logging when any of them had unprefixed, non-standard caps
* Now it does them all at once
  * Made a helper function that takes a caps object ({alwaysMatch, firstMatch}) and finds all of the non-prefixed caps in all of them
  * Calls that function and logs warning
2018-01-18 12:50:57 -08:00
Mykola Mokhnach 5308c4a47e Assume a file is located on SMB server if the path starts with double backslash (#172)
* Assume a file is located on SMB server if the path starts with double backslash

* Add more logging

* Update the test
2018-01-18 07:27:54 +01:00
Dan Graham a9650d7c19 Fix broken Proxy logic for W3C (#170)
* Moved 'ProxyRequestError' handling outside of the MJSONWP block.
  * When it's a proxy error, Appium translates the error (based on statusCode) to it's proper Error
  * W3C weren't doing this when ProxyRequestError was being used
  * Now W3C translates proxy errors
* Added tests in `mjsonwp-e2e-specs` that test JWProxy
  * Test successful 200 proxies
  * Tested unsuccessful responses to see that a JSONWP response with status = 6 would return the correct 'NoSuchDriverError' with statusCode = 404
2018-01-16 08:43:00 -08:00
Dan Graham 98251e0b4f Check that W3C capabilities is a plain object (#171)
* If 'capabilities' and 'desiredCapabilities' were provided, and 'capabilities' is NOT a plain object, fall back to 'desiredCapabilities'
* Added more logging to the W3C vs. MJSONWP determination logic
* Rename `createSession` args to be more descriptive
* Added basic W3C unit tests for above fix
2018-01-15 14:49:36 -08:00
Mykola Mokhnach 9229a58ea4 Update parameters list for start_recording_screen/stop_recording_screen endpoints (#168) 2018-01-12 16:41:04 +01:00