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

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

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

評価

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

調査の方向性

CodeceptJS 3.0.4 と Playwright helper を使って、提供された失敗するステップを再現し、その後、動作していた 3.0.2 と比較します。ステップの実行と例外処理の経路を追跡します。スローされた Error によってステップが失敗し、テスト出力に表示されれば完了です。

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

説明

What are you trying to achieve?

I would like to see the error if step fails with exception
e.g.

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.

  fail step @fail
  ✔ OK 

Provide test source code if related
Example
My step in a feature file

@fail
  Scenario: fail step
    Given I fail the step

Implementation

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

Result

  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:
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.
主要言語
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 を短くまとめたダイジェスト。