codeceptjs / codeceptjs/CodeceptJS

DOMException thrown with using text locators with puppeteer click method

Abierto
#1,787 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
4.2k
Forks
757
Merge medio
2 d 9 h
PR fusionados (30 d)
16

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.