BREAKING CHANGE: The current refactoring is breaking and changes `onUnexpectedShutdown` property to a function, which accepts a handler that is invoked by the driver when it gets shut down unexpectedly
* 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 imageTemplateDefaultScale to scale arbitrary scale every time by default
* put all of template scaling into one method
* increase test cases to cover all situations
* define gnoreDefaultImageTemplateScale for click
* add a comment
* tweak comments
* fix typo, default value, docstring
* fix review
* fix ratio potential issue
* use const instead of let
* tweak a comment about scale factor
* remove _, tweak NaN comparison
* use math.round to compare two float
* rename float round constant
* fix typo
* update imgObj
* fix comments
* fix wrong coordinate for android and ios
* separate fixScaleTemplateImage
* add fixScaleTemplateImage as a settings
* take care of both landscape and portrate
* rename to fixTemplateImageScale
* rename ratio to scale
* does not scale if the arg is non number
* rename preference name, default value
* remove comment outted lines
* add null filter as safer way
* add custom locator strategy
* address review comments
* allow customFindModules cap to register multiple modules as an object
* add unit tests for custom element finding plugin
* 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
* This test worked fine in base driver but these tests also run in fake driver and don't work beause `app ` is a required capability
* Added `app=fake` to caps
* 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
* 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
* 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
* 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
* 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