(selector: string)
| 508 | } |
| 509 | |
| 510 | elementsByCss(selector: string) { |
| 511 | return this.startChain(() => |
| 512 | page.$$(selector).then((els) => { |
| 513 | return els.map((el) => { |
| 514 | const origGetAttribute = el.getAttribute.bind(el) |
| 515 | el.getAttribute = (name) => { |
| 516 | // ensure getAttribute defaults to empty string to |
| 517 | // match selenium |
| 518 | return origGetAttribute(name).then((val) => val || '') |
| 519 | } |
| 520 | return el |
| 521 | }) |
| 522 | }) |
| 523 | ) |
| 524 | } |
| 525 | |
| 526 | waitForElementByCss(selector: string, opts: number | ElementByCssOpts = {}) { |
| 527 | const { |