codeceptjs / codeceptjs/CodeceptJS

targetCreatedHandler triggers UnhandledPromiseRejectionWarning

Đang mở
#3,037 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug playwright
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?
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
}
}
}
```

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.