codeceptjs / codeceptjs/CodeceptJS

Using cucumber, scripts exception ends in a passing test

Đang mở
#2,773 1 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 am using cucumber to write the tests.

A step for some reasons throws a javascript exception.

#### What do you get instead?

The scenario execution stops without any log, and test is considered as "passing".

This happens whenever I use the UI executor or the headless mode.

### Details

* CodeceptJS version: 3.0.4
* NodeJS Version: 14.15.4
* Operating System:
* puppeteer
* Configuration file:

```js
require('ts-node/register');
const { setHeadlessWhen, setSharedCookies } = require('@codeceptjs/configure');

// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);
setSharedCookies();

process.env.TEST_URL = process.env.TEST_URL || 'http://localhost:3000';

// eslint-disable-next-line no-undef
exports.config = {
tests: './test/**/*.test.ts',
output: './output',
helpers: {
Puppeteer: {
url: process.env.TEST_URL,
show: true,
browser: 'chromium',
chrome: {
args: ['--no-sandbox'],
},
},
REST: {
endpoint: `${process.env.TEST_URL}/api`,
},
},
include: {
I: './steps_file.ts',
},
bootstrap: null,
mocha: {
reporterOptions: {
mochaFile: 'reports/e2e/community-management-web.xml',
},
},
name: 'xxx-e2e',
plugins: {
pauseOnFail: {},
retryFailedStep: {
enabled: true,
},
tryTo: {
enabled: true,
},
screenshotOnFail: {
enabled: true,
},
allure: {
enabled: false,
},
},
gherkin: {
features: './test/features/*.feature',
steps: [
'./test/step-definitions/base.steps.ts',
'./test/step-definitions/xxx.steps.ts',
'./test/step-definitions/auth.steps.ts'
],
},
};

```

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.