lib/commands.js
async function waitAttributeToBe (selector, key, value, timeout) {
  return await this.waitUntil(async () => {
    const got = await this.element(selector).getAttribute(key)
    return [].concat(value).some((value) => got === value || String(got) === String(value))
  }, timeout, `Timeout to wait attribute "${key}" on \`${selector}\` to be \`${JSON.stringify(value)}\``)
}
async function waitAttributeToBe (selector, key, value, timeout) {
  return await this.waitUntil(async () => {
    const got = await this.element(selector).getAttribute(key)
    return [].concat(value).some((value) => got === value || String(got) === String(value))
  }, timeout, `Timeout to wait attribute "${key}" on \`${selector}\` to be \`${JSON.stringify(value)}\``)
}
Wait attribute matches value
@param {string} selector
@param {string} key
@param {string} value
@param {number} [timeout]
@returns {Promise<*|void>}