48 Commits
Author SHA1 Message Date
Mykola Mokhnach 14efcc973a feat: Add Webauthn routes (#433) 2020-09-19 21:24:07 +02:00
Mykola Mokhnach e24be8a7a2 fix: Return proper responses to unexpected errors (#432) 2020-09-09 07:42:49 +02:00
dependabot-preview[bot]andMykola Mokhnach 93ff4c16f2 chore(deps): bump http-status-codes from 1.4.0 to 2.1.1 (#428)
* chore(deps): bump http-status-codes from 1.4.0 to 2.1.1

Bumps [http-status-codes](https://github.com/prettymuchbryce/node-http-status) from 1.4.0 to 2.1.1.
- [Release notes](https://github.com/prettymuchbryce/node-http-status/releases)
- [Commits](https://github.com/prettymuchbryce/node-http-status/compare/v1.4.0...2.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Update imports

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Mykola Mokhnach <mokhnach@gmail.com>
2020-08-24 07:41:47 +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 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 57ef9bc7ab chore: Replace request usage with axios in tests (#408) 2020-05-05 14:26:33 +02:00
snoopy-peace 5d36756c1c chore: Define options for for doubleClick, buttonUp\Down routes (#406) 2020-04-24 11:31:51 +02:00
Kazuaki Matsuo d22c01f759 feat: add calling chrome devtools endpoint for chromium (#405)
* add calling chrome devtools for chromium

* fill command and required parameter in

* replace goog with :vendor
2020-04-18 10:08:56 +09:00
Isaac A. Murchie d396dbf823 chore: fix linting issues (#403)
* chore: fix linting issues

* fix: address review
2020-03-31 15:43:13 -04:00
Mykola Mokhnach d0ac39d8fc chore: Import uuid from appium-suuport (#391) 2020-03-14 07:28:04 +01:00
Mykola Mokhnach 9de802864c fix: Sync parameters validation for the old and the new set alert text endpoints (#369) 2019-11-20 09:35:08 +01:00
Jonathan Lipps 09a7bf81c9 feat: add ability to retrieve log events as a new api route (#365) 2019-11-05 16:38:30 -08:00
Jonathan Lipps e434762c31 feat: add new route to allow logging of custom events (#364) 2019-11-04 19:56:31 -08:00
Mykola Mokhnach b860a3bfa4 fix: Adjust the error codes for NotImplementedError (#357) 2019-10-04 13:42:56 +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
Isaac A. Murchie 22eef3b4a3 refactor: make server parameters a hash [breaking change] (#350) 2019-08-26 15:15:19 -04:00
Kazuaki Matsuo 58222d35f9 accept text for setValueImmediate and replaceValue as W3C (#347) 2019-08-16 10:20:53 +09:00
Jonathan Lipps 23d6ecf949 Add endpoint that receives a webdriver script for batch command execution (#328)
* add executeDriverScript route, command, tests

* allow driver scripts to write and collect console logs

* ensure driver script protocol is set to same protocol as driver, and also includes all appium commands

* implement isFeatureEnabled to check for insecure feature

* add tests for isFeatureEnabled

* update feature flag name to match style of other flags

* add ensureFeatureEnabled method for use by other drivers

* move driver script execution into a child process so we can kill it if necessary

* use this.opts.address instead of this.opts.host

* ensure driver script timeout is a number in the child proc as well

* ensure we get webdriverio without issues
2019-06-25 12:12:27 -07:00
Khanh Do 757e029fad Fixed typo signalStrength (#308)
* Fixed typo signalStrength

* Update hash

* Added backward-compatible

* Updated hash & fixed unit test
2019-03-06 23:20:11 +09: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
Kazuaki Matsuo a98f22607e add POST for system_time in order to set payload (#294) 2019-01-07 09:26:10 +01:00
Dan Graham 644208fe60 Copy W3C/Element keys instead of renaming them (#290) 2018-12-10 13:24:36 -08: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 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 432915f234 Fix setting alert text for W3C protocol (#254) 2018-09-06 18:01:03 +02:00
Mykola Mokhnach f909201791 Add JSONWP<>W3C mapping for window/handles endpoint (#251) 2018-08-21 21:50:00 +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
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
Dan Graham c6c56093f5 Handle /timeouts W3C + MJSONWP proxying (#231) 2018-07-11 09:05:01 -07:00
Kazuaki Matsuo f4b89448d6 add format in deviveTime as a parameter (#225) 2018-06-12 07:59:39 +09: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 0765c92d7b Add an optional flags parameter to press_key_code endpoint (#208) 2018-05-07 18:29:21 +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
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 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
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
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 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
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