codeceptjs / codeceptjs/CodeceptJS

DOMException thrown with using text locators with puppeteer click method

オープン
#1,787 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
4.2k
フォーク
757
平均マージ
2日 9時間
マージ済み PR(30日)
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。