Files
appium/index.js
T
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

44 lines
1.6 KiB
JavaScript

// transpile:main
// BaseDriver exports
import BaseDriver from './lib/basedriver/driver';
import { ImageElement } from './lib/basedriver/image-element';
import DeviceSettings, { BASEDRIVER_HANDLED_SETTINGS } from './lib/basedriver/device-settings';
export { BaseDriver, DeviceSettings, ImageElement, BASEDRIVER_HANDLED_SETTINGS };
export default BaseDriver;
// MJSONWP exports
import { Protocol, routeConfiguringFunction, errors, isErrorType,
errorFromMJSONWPStatusCode, errorFromW3CJsonCode,
ALL_COMMANDS, METHOD_MAP, routeToCommandName,
NO_SESSION_ID_COMMANDS, isSessionCommand } from './lib/protocol';
export { Protocol, routeConfiguringFunction, errors, isErrorType,
errorFromMJSONWPStatusCode, errorFromW3CJsonCode, errorFromMJSONWPStatusCode as errorFromCode,
ALL_COMMANDS, METHOD_MAP, routeToCommandName,
NO_SESSION_ID_COMMANDS, isSessionCommand };
// Express exports
import { STATIC_DIR } from './lib/express/static';
export { STATIC_DIR };
import { server } from './lib/express/server';
export { server };
// jsonwp-proxy exports
import JWProxy from './lib/jsonwp-proxy/proxy';
export { JWProxy };
// jsonwp-status exports
import { codes, getSummaryByCode } from './lib/jsonwp-status/status';
const statusCodes = codes;
export { statusCodes, getSummaryByCode };
// W3C capabilities parser
import { processCapabilities } from './lib/basedriver/capabilities';
export { processCapabilities };
// Web socket helpers
import { DEFAULT_WS_PATHNAME_PREFIX } from './lib/express/websocket';
export { DEFAULT_WS_PATHNAME_PREFIX };