Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
michalorlinski opened this issue Dec 30, 2024 · 0 comments

Comments

@michalorlinski
Copy link

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,
    },
  },
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant