codeceptjs / codeceptjs/CodeceptJS

targetCreatedHandler triggers UnhandledPromiseRejectionWarning

Abierto
#3,037 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug playwright
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?
Running tests on the CI with minimum text output to the console

#### What do you get instead?
Though the tests pass the UnhandledPromiseRejectionWarning message creates redundant text output.

> Provide console output if related. Use `--verbose` mode for more details.

```bash
(node:21420) UnhandledPromiseRejectionWarning: frame.frameElement: Frame has been detached.
at C:\Users\...\..\...\node_modules\codeceptjs\lib\helper\Playwright.js:2643:46
(node:21420) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
```
![photo_2021-09-11_14-31-21](https://user-images.githubusercontent.com/53792559/132946466-cf5bedee-090a-4403-af5e-121fdddc63c0.jpg)

> Provide test source code if related

```js
// paste test
```

### Details

* CodeceptJS version: 3.1.2
* NodeJS Version: 14.17.5
* Operating System: Windows and Linux
* puppeteer || webdriverio || protractor || testcafe version (if related)
* Configuration file:

```js
//unrelated data omitted with "..."
exports.config = {
tests: './test/steps/*_test.js',
"translation": "ru-RU",
output: './output',
helpers: {
Playwright: {
url: 'someurl',
show: false,
browser: 'chromium'
},
GraphQL: {
endpoint: '...',
},
ChaiWrapper : {
"require": "codeceptjs-chai"
},
CustomPlaywrightHelper: {
require: '.../customPlaywright_helper.js',
},
DateHelper: {
require: '.../date_helper.js',
},
REST: {
}
},
include: {
I: './test/steps_file.js',
pages: '...',
},
bootstrap: null,
mocha: {
"reporterOptions": {
"reportDir": "output"
}
},
name: 'foo',
plugins: {
pauseOnFail: {},
retryFailedStep: {
enabled: true
},
tryTo: {
enabled: true
},
screenshotOnFail: {
enabled: true
},
"allure": {
"enabled": true
}
}
}
```

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.