Methods

executeCommand(log, errorMessage, identifier, fn, browseropt) → {Promise.<*>}

Shared error handling wrapper for command methods. Most command methods follow the same try/catch pattern: log.error + log.verbose + throw new Error. This helper eliminates that boilerplate.
Parameters:
NameTypeAttributesDescription
logObjectThe logger instance.
errorMessagestringprintf-style message (with %s placeholder).
identifierstring | undefinedValue to interpolate into the message, or undefined if none.
fnfunctionThe async function to execute.
browserObject<optional>
Optional browser instance. When provided, the current page URL is appended to the error message.
Returns:
The return value of fn.
Type: 
Promise.<*>

parseSelector(selector) → {Object}

Parses a selector string into a Selenium By locator. Supports prefix-based strategies: - 'id:value' -> By.id('value') - 'xpath:expression' -> By.xpath('expression') - 'name:value' -> By.name('value') - 'text:value' -> By.xpath('//*[normalize-space(text())="value"]') - 'link:value' -> By.xpath('//a[text()="value"]') - 'class:value' -> By.className('value') - No prefix -> By.css(selector) (CSS selector is the default)
Parameters:
NameTypeDescription
selectorstringThe selector string to parse.
Returns:
The parsed locator and a human-readable description.
Type: 
Object

(async) timeout(promise, ms, errorMessage)

Timeout a promise after ms. Use promise.race to compete about the timeout and the promise.
Parameters:
NameTypeDescription
promisepromisethe promise to wait for
msinthow long in ms to wait for the promise to fininsh
errorMessagestringthe error message in the Error if we timeouts