codeceptjs / codeceptjs/CodeceptJS

DOMException thrown with using text locators with puppeteer click method

Đang mở
#1,787 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
4.2k
Fork
757
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
16

Mô tả

#### 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']
}
}
}
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.