(sel)
| 17 | } |
| 18 | |
| 19 | elementByCss(sel) { |
| 20 | return this.updateChain(() => |
| 21 | this.browser.findElement(By.css(sel)).then((el) => { |
| 22 | el.sel = sel |
| 23 | el.text = () => el.getText() |
| 24 | el.getComputedCss = (prop) => el.getCssValue(prop) |
| 25 | el.type = (text) => el.sendKeys(text) |
| 26 | el.getValue = () => |
| 27 | this.browser.executeScript(`return document.querySelector('${sel}').value`) |
| 28 | return el |
| 29 | }), |
| 30 | ) |
| 31 | } |
| 32 | |
| 33 | elementByXpath(sel) { |
| 34 | return this.updateChain(() => { |