lib/commands.js
async function waitVariableToBe (variableExpression, value, timeout) {
  return await this.waitUntil(async () => {
    const result = await this.execute(`return ${variableExpression} === ${JSON.stringify(value)}`)
    return result.value
  }, timeout, `Timeout to wait expression \`${variableExpression}\` to be \`${JSON.stringify(value)}\``)
}
async function waitVariableToBe (variableExpression, value, timeout) {
  return await this.waitUntil(async () => {
    const result = await this.execute(`return ${variableExpression} === ${JSON.stringify(value)}`)
    return result.value
  }, timeout, `Timeout to wait expression \`${variableExpression}\` to be \`${JSON.stringify(value)}\``)
}
Wait variable expression matches value
@param {string} variableExpression
@param {string} value
@param {number} [timeout]
@returns {Promise<*|void>}