CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

targetCreatedHandler triggers UnhandledPromiseRejectionWarning

Open SergeyBibikov opened this issue 4 years ago • 0 comments

What are you trying to achieve?

Running tests on the CI with minimum text output to the console

What do you get instead?

Though the tests pass the UnhandledPromiseRejectionWarning message creates redundant text output.

Provide console output if related. Use --verbose mode for more details.

(node:21420) UnhandledPromiseRejectionWarning: frame.frameElement: Frame has been detached.
    at C:\Users\...\..\...\node_modules\codeceptjs\lib\helper\Playwright.js:2643:46
(node:21420) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

photo_2021-09-11_14-31-21

Provide test source code if related

// paste test

Details

  • CodeceptJS version: 3.1.2
  • NodeJS Version: 14.17.5
  • Operating System: Windows and Linux
  • puppeteer || webdriverio || protractor || testcafe version (if related)
  • Configuration file:
//unrelated data omitted with "..."
exports.config = {
  tests: './test/steps/*_test.js',
  "translation": "ru-RU",
  output: './output',
  helpers: {
    Playwright: {
      url: 'someurl',
      show: false,
      browser: 'chromium'
    },
    GraphQL: {
      endpoint: '...',
    },
    ChaiWrapper : {
      "require": "codeceptjs-chai"
    },
    CustomPlaywrightHelper: {
      require: '.../customPlaywright_helper.js',
    },
    DateHelper: {
      require: '.../date_helper.js',
    },
    REST: {
    }
  },
  include: {
    I: './test/steps_file.js',
    pages: '...',
  },
  bootstrap: null,
  mocha: {
    "reporterOptions": {
      "reportDir": "output"
    }
  },
  name: 'foo',
  plugins: {
    pauseOnFail: {},
    retryFailedStep: {
      enabled: true
    },
    tryTo: {
      enabled: true
    },
    screenshotOnFail: {
      enabled: true
    },
    "allure": {
      "enabled": true
    }
  }
}

SergeyBibikov avatar Sep 11 '21 11:09 SergeyBibikov