Using cucumber, scripts exception ends in a passing test

オープン
#2,773 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, node.js, typescript
領域
testing

調査の方向性

報告された CodeceptJS 3.0.4 の設定を使って失敗を再現し、UI モードと headless モードの両方で、gherkin セクションに設定された gherkin の features と steps に焦点を当てます。Cucumber の step から発生した JavaScript 例外がどのように報告されるかを追跡します。両方の実行モードでシナリオが失敗し、例外がログに記録されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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:
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'
    ],
  },
};

主要言語
JavaScript
スター
4.2k
フォーク
756
平均マージ
2日 9時間
マージ済み PR(30日)
16

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codeceptjs/CodeceptJS のほかの issue

codeceptjs/CodeceptJS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。