After hook is NOT working and browser does NOT close when more than 1 Feature sections exists in test file

Đang mở
#4,696 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
javascript, node.js
Lĩnh vực
testing

Hướng nghiên cứu

Bắt đầu với các test khớp với tests/*_tests.ts và cấu hình CodeceptJS được hiển thị, tập trung vào sự tương tác giữa nhiều phần Feature, restart: true và helper Puppeteer. Tái hiện vấn đề với nhiều hơn một phần Feature và theo dõi xem After và AfterSuite có được chạy hay không. Hoàn thành khi các hook được thực thi và các trang trình duyệt được đóng sau mỗi test mà không tích lũy các process.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

stale
What are you trying to achieve?

When there are more than 1 Feature sections in the test file:

  • the browser/page does NOT close after each test, so at the end I have many browsers opened, which slowing down my system.
  • the After and AfterSuite hooks are NOT working at all (are NOT called).

Tests behave (passed/failed) normally and the next test is conducted on newly opened browser, but After and AfterSuite hooks are NOT even called after test(s). Additional hooks / teardown implemented in the codecept.conf do NOT help. Any suggestion?

What do you get instead?

Tests behave (passed/failed) normally and the next test is conducted on newly opened browser, but After and AfterSuite hooks are NOT even called after test(s). Additional hooks / teardown implemented in the codecept.conf do NOT help, so at the end I have many browsers/threads opened, which slowing down my system.

Details
  • CodeceptJS version: 3.6.10
  • NodeJS Version: 20.15.0
  • Operating System: Win11 Pro
  • puppeteer version: 23.11.1
  • Configuration file:
/// <reference types='./steps' />
import { testConfig } from "./testConfig";

const fullScreen: string = "false";

export const config: CodeceptJS.MainConfig = {
  tests: "./tests/*_tests.ts",
  timeout: 60,
  output: "./output",

  helpers: {
    REST: {},
    Puppeteer: {
      url: testUrl,
      browser: "chrome",
      show: true,
      fullPageScreenshots: true,
      uniqueScreenshotNames: false,
      waitForNavigation: ["load", "domcontentloaded"] as any,
      pressKeyDelay: 7,
      waitForTimeout: 30000,
      restart: true,
      windowSize: screenResolution.join("x") as any,
      chrome: {
        args: ["--no-sandbox", `--lang=${lang}`, fullScreen === "true" ? "--start-fullscreen" : ""],
      },
    },
    CustomHelper: {
      require: "./helpers/customHelper.ts",
    },
    AssertWrapper: {
      require: "codeceptjs-assert",
    },
    ResembleHelper: {
      require: "codeceptjs-resemblehelper",
      screenshotFolder: "./output/",
      baseFolder: "./screenshots/base/",
      diffFolder: "./screenshots/diff/",
      prepareBaseImage: false,
      tolerance: 2,
      needsSameDimension: true,
    },
  },
};
Ngôn ngữ chính
JavaScript
Star
4.2k
Fork
756
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
16

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codeceptjs/CodeceptJS

Tất cả issue của codeceptjs/CodeceptJS

Issue tương tự

Thêm issue về JavaScript

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.