codeceptjs / codeceptjs/CodeceptJS

Exception Handling (e.g. throw new Error) stopped working in the steps

Đang mở
#2,784 0 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?
I would like to see the error if step fails with exception
e.g.
```js
Given('I fail the step', () => {
throw new Error('Error');
});
```
#### What do you get instead?
I can see that step passes

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

```bash
fail step @fail
✔ OK
```

> Provide test source code if related
Example
My step in a feature file
```js
@fail
Scenario: fail step
Given I fail the step
```

Implementation
```js
Given('I fail the step', () => {
throw new Error('Error');
});
```

Result
```js
fail step @fail
✔ OK
```

### Details

* CodeceptJS version: 3.0.4
* (With version 3.0.2 everything works fine!)
* NodeJS Version: 12.19.2 (with 14.15.4 I have the same issue)
* Operating System: Windows/Mac/Debian
* playwrigth
* Configuration file:

```js
exports.config = {
output: './output',
helpers: {
Playwright: {
browser: process.env.BROWSER || 'chromium',
windowSize: '1400x800',
waitForAction: 500,
waitForNavigation: 'load',
chromium: {
args: [
'--disable-setuid-sandbox',
'--deterministic-fetch',
'--no-sandbox',
],
},
waitForTimeout: 40000,
disableScreenshots: false,
uniqueScreenshotNames: true,
keepBrowserState: false,
keepCookies: true,
restart: false,
locale: 'en_US',
show: process.env.SHOW === 'true',
},
helpers etc.
```

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.