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
* 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
* 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
* 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`
* 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
* 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
* 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'
* 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
* 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