CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

Issue with running multiple test scripts w/ WebDriverIO. Unhandled promise rejection

Open artiomnist opened this issue 10 years ago • 12 comments

When running all of my test scripts, the first Feature will pass, but the rest will receive the following error:

A session id is required for this command but wasn't found in the response payload

(node:11) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: A session id is required for this command but wasn't found in the response payload
(node:11) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)

NPM - 3.10.3 codeceptjs - 0.4.6 node - 6.7.0 WebDriverIO - 4.2.16

This was previously working on codeceptjs 0.4.5, And works if I roll back to codeceptjs 0.4.5

Running a single test script, (e.g. codeceptjs run . --grep "@header" ) Works perfectly fine.

Any thoughts?

artiomnist avatar Oct 05 '16 11:10 artiomnist

Do you use restart:false option? If yes, there is an issue and PR, please check https://github.com/Codeception/CodeceptJS/pull/240

APshenkin avatar Oct 05 '16 12:10 APshenkin

Yes, I have that option set in the codeceptjs config. Seems to be the issue... I'll way for the request to be merged, and report any issues if they persist. Thanks!

artiomnist avatar Oct 05 '16 12:10 artiomnist

Issue has been fixed in version 0.4.7 with the merging of PR #240. Thanks a bunch guys! Keep up the awesome work!

artiomnist avatar Oct 13 '16 09:10 artiomnist

Hello,

Got here by google and it seems the problem is back as i encountered it today. :)

adrien-carre avatar Feb 02 '17 17:02 adrien-carre

same here. I do not use the restart option (neither restart: false nor restart:true)

nodejs: 4.4.1 webdriverio: 4.6.2 codeceptjs: 0.5.1

config-file:

exports.config = {
  "helpers": {
    "WebDriverIO": {
      // load variables from the environment and provide defaults
      "url": process.env.CODECEPT_URL || 'http://www.ad.nl',
      "browser" : process.profile || "phantomjs"
    }
  },
  "tests": "./*_test.js",
  "timeout": 120000,
  "output": "./output",
  "include": {
    "I": "./steps_file.js",
    "functions": "./pages/global_functions.js",
    "globals":"./globals.js"
  },
  "bootstrap": false,
  "mocha": {
    "reporterOptions": {
      "mochaFile": "output/result.xml",
      "reportDir": "output",
      "reportFilename": "check",
      "enableCharts": true,
      "autoOpen": true,
      "quiet": true
    }
  },
};

joelgrimberg avatar Mar 10 '17 13:03 joelgrimberg

I am also getting [6] Error | Error: A session id is required for this command but wasn't found in the response payload on tests after the first test. I am using restart:false

waryhermit avatar Mar 13 '17 13:03 waryhermit

Please, provide your test to reproduce the issue

APshenkin avatar Mar 13 '17 15:03 APshenkin

@APshenkin I'll link you to our tests. If I get some free time I might try to make a trimmed down reproducible case.

codecept.conf.js saucelabs_helper.js steps_file.js codeceptjs-init.js login_test.js resource_test.js

Travis CI log with error and codeceptjs verbose: https://travis-ci.org/ole-vi/BeLL-Apps/builds/210193040#L1159

waryhermit avatar Mar 24 '17 01:03 waryhermit

I only have this issue when the tests are running on Travis, not when running them locally.

@thesupad @joelgrimberg Did either you figure out what the problem was? Do you run into this error when running the tests locally or only on a CI build system?

waryhermit avatar Mar 24 '17 21:03 waryhermit

I have the same issue with when i am using it with Browserstack:

NPM - 3.10.10 codeceptjs - 0.6.2 node - 6.10.0 WebDriverIO - 4.8.0

MitkoTschimev avatar May 13 '17 13:05 MitkoTschimev

Just reproduced it again

mikhailpractice avatar Sep 29 '17 02:09 mikhailpractice

Still face the same err "Error: A session id is required for this command but wasn't found in the response payload". Can someone guide me what the err actually means? Thanks!

shamili12 avatar Dec 13 '18 21:12 shamili12