251 Commits
Author SHA1 Message Date
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 5cf4f13609 Fix protocol conversion for getWindowHandle command (#265) 2018-09-30 21:04:56 +02:00
Mykola Mokhnach d0d85bf6ff Allow numbers-as-strings while performing capabilities verification (#264) 2018-09-27 19:35:55 +02: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 d176cda10c Append the current session identifier to the protocol name prefix (#259) 2018-09-18 13:53:33 +02:00
Mykola Mokhnach 16e2852a1b Fix the way current protocol is determined from execute response (#258) 2018-09-11 18:27:27 +02:00
Mykola Mokhnach d80a78a615 Fix protocol detection inside the routing function (#257) 2018-09-08 20:39:08 +02:00
Mykola Mokhnach e6218fb4b1 Replace isError lodash verification as it is not reliable (#256) 2018-09-07 16:18:13 +02:00
Mykola Mokhnach 432915f234 Fix setting alert text for W3C protocol (#254) 2018-09-06 18:01:03 +02:00
Mykola Mokhnach 50e4c04805 Change logging level to debug for internal errors (#255) 2018-09-06 18:00:23 +02: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 e50ef5e6aa Remove the redundant logging from getResponseForW3CError helper (#252) 2018-08-24 16:25:56 +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
Isaac A. Murchie 5e9df93eeb Clean up error message from protocol (#249) 2018-08-15 08:04:14 -04: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
Kazuaki Matsuo b90ed154d9 fix raising NotYetImplementedError against commands which exist in image-element (#245)
* fix raising NotYetImplementedError when the element is image-element
2018-08-05 22:37:59 +09:00
Mykola Mokhnach 4ed0c0b3cc Add an optional parameter to /window call (#244)
* Add an optional parameter to /window call

* update the validation

* Use util.hasValue

* Make args to make both protocols happy
2018-08-02 07:53:53 +02:00
Jonathan Lipps ec72948de2 add -image locator strategy and related logic (#235)
* add -image locator strategy and related logic

* use appium-support jimp helper

* handle find multiple elements by image

* update staleness check variable name

* ensure that a settings object always exists so we can rely on global settings always existing too

* only fix template size if user requests it in settings

* add note about implicit wait error handling

* only automatically update image element position if user turns on an appropriate setting

* add setting to control whether we check for image element staleness

* add setting to determine the image element tap strategy (w3c or mjsonwp)

* prefer single quotes

* add setting to turn off screenshot resizing if not desired

* add docstrings (except for cache class which we may not keep)

* address additional review comments

* add better jsdoc arg info

* use lru-cache npm package instead of rolling our own

* use new versino of appium-support

* make sure the lru cache is checking element size correctly

* give better names and tighten up logic around image el tap strategies

* add some unit tests for image elements

* ensure DeviceSettings has a default no-op update method

* check that driver implements action strategies and fall back / throw as appropriate

* finish out image element unit tests

* have basedriver set noop onSettingsUpdate rather than doing it in DeviceSettings

* move route avoidance detection from protocol to driver

* handle proxying actions to downstream drivers during image tap

* tighten up logic for deciding whether to proxy based on presence of image element

* add find by image specs and fix issues that arose in the process

* clean up regexes

* don't try to be smart and proxy actions for drivers; let them set it up themselves to support image elements

* change default match threshold based on experimentation

* export which settings are handled by basedriver so downstream drivers can utilize this information

* make sure to include a duration for the initial pointerMove action

* add docstring to proxyRouteIsAvoided
2018-07-30 13:17:54 -07: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
Isaac A. Murchie f0bb198d7d Remove list of possible values for platformName cap (#233) 2018-07-12 09:15:23 -04:00
Dan Graham c6c56093f5 Handle /timeouts W3C + MJSONWP proxying (#231) 2018-07-11 09:05:01 -07:00
Dan Graham ae21c08248 Log typos (#232) 2018-07-06 19:05:12 -07:00
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