Skip to content

Commit

Permalink
fix enable/disable highlightElement for webdriver
Browse files Browse the repository at this point in the history
  • Loading branch information
philkas committed Jul 25, 2023
1 parent be2b579 commit a1de2e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/helpers/WebDriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Type: [object][16]
- `desiredCapabilities` **[object][16]?** Selenium's [desired capabilities][6].
- `manualStart` **[boolean][32]?** do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
- `timeouts` **[object][16]?** [WebDriver timeouts][37] defined as hash.
- `highlightElement` **[boolean][32]?** highlight the interacting elements
- `highlightElement` **[boolean][32]?** highlight the interacting elements. Default: false



Expand Down
5 changes: 3 additions & 2 deletions lib/helper/WebDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const webRoot = 'body';
* @prop {object} [desiredCapabilities] Selenium's [desired capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities).
* @prop {boolean} [manualStart=false] - do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
* @prop {object} [timeouts] [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
* @prop {boolean} [highlightElement] - highlight the interacting elements
* @prop {boolean} [highlightElement] - highlight the interacting elements. Default: false
*/
const config = {};

Expand Down Expand Up @@ -429,6 +429,7 @@ class WebDriver extends Helper {
keepCookies: false,
keepBrowserState: false,
deprecationWarnings: false,
highlightElement: false,
};

// override defaults with config
Expand Down Expand Up @@ -2914,7 +2915,7 @@ function isModifierKey(key) {
}

function highlightActiveElement(element) {
if (!this.options.enableHighlight && !store.debugMode) return;
if (!this.options.highlightElement && !store.debugMode) return;

highlightElement(element, this.browser);
}
Expand Down

0 comments on commit a1de2e6

Please sign in to comment.