Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Commit 839cea5

Browse files
committed
export which settings are handled by basedriver so downstream drivers can utilize this information
1 parent 1c57023 commit 839cea5

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// BaseDriver exports
44
import BaseDriver from './lib/basedriver/driver';
55
import { ImageElement } from './lib/basedriver/image-element';
6-
import DeviceSettings from './lib/basedriver/device-settings';
6+
import DeviceSettings, { BASEDRIVER_HANDLED_SETTINGS } from './lib/basedriver/device-settings';
77

8-
export { BaseDriver, DeviceSettings, ImageElement };
8+
export { BaseDriver, DeviceSettings, ImageElement, BASEDRIVER_HANDLED_SETTINGS };
99
export default BaseDriver;
1010

1111
// MJSONWP exports

lib/basedriver/device-settings.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ const GLOBAL_DEFAULT_SETTINGS = {
3030
imageElementTapStrategy: IMAGE_EL_TAP_STRATEGY_W3C,
3131
};
3232

33+
// declare settings that are really handled only by basedriver, so downstream
34+
// drivers can choose to ignore them for their own settings validation, etc...
35+
const BASEDRIVER_HANDLED_SETTINGS = [
36+
'imageMatchThreshold',
37+
'fixImageFindScreenshotDims',
38+
'fixImageTemplateSize',
39+
'checkForImageElementStaleness',
40+
'autoUpdateImageElementPosition',
41+
'imageElementTapStrategy',
42+
];
43+
3344
class DeviceSettings {
3445

3546
constructor (defaultSettings = {}, onSettingsUpdate = null) {
@@ -65,3 +76,4 @@ class DeviceSettings {
6576
}
6677

6778
export default DeviceSettings;
79+
export { BASEDRIVER_HANDLED_SETTINGS };

0 commit comments

Comments
 (0)