codeceptjs / codeceptjs/CodeceptJS
DOMException thrown with using text locators with puppeteer click method
- 主要语言
- JavaScript
- 星标
- 4.2k
- 派生
- 757
- 平均合并
- 2 天 9 小时
- 30 天内合并 PR
- 16
描述
#### What are you trying to achieve?
Test clicking on element found by text (fuzzy selector).
#### What do you get instead?
When testing click behavior using latest Puppeteer driver, the exception is thrown:
`DOMException: Failed to execute 'querySelectorAll' on 'Element': 'Computer & Data (160)' is not a valid selector.`
The same test is working correctly with Webdriver.
> Provide console output if related. Use `--verbose` mode for more details.
```bash
Error: Evaluation failed: DOMException: Failed to execute 'querySelectorAll' on 'Element': 'Computer & Data (160)' is not a valid selector.
at __puppeteer_evaluation_script__:1:33
at ExecutionContext._evaluateInternal (node_modules/puppeteer/lib/ExecutionContext.js:122:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
-- ASYNC --
at ExecutionContext. (node_modules/puppeteer/lib/helper.js:111:15)
at ElementHandle.$$ (node_modules/puppeteer/lib/JSHandle.js:411:55)
at ElementHandle. (node_modules/puppeteer/lib/helper.js:112:23)
at Puppeteer.findElements (node_modules/codeceptjs/lib/helper/Puppeteer.js:2035:42)
at Puppeteer.findClickable (node_modules/codeceptjs/lib/helper/Puppeteer.js:2082:23)
at process._tickCallback (internal/process/next_tick.js:68:7)
```
> Provide test source code if related
```js
...
I.click('Computer & Data (160)')
...
```
### Details
* CodeceptJS version: 2.2.0
* NodeJS Version: v10.15.3
* Operating System: macOS 10.14.5
* Puppeteer: 1.18.1,
* Configuration file:
```js
...
helpers: {
Puppeteer: {
url: process.env.BASE_URL,
show: true,
windowSize: '1920x1080',
chrome: {
args: ['--no-sandbox', '--window-size=1920,1080']
}
}
}
```
贡献指南
评估
这个 Issue 还没有评估数据。