ui icon indicating copy to clipboard operation
ui copied to clipboard

Unhandled rejection when running `npx codecept-ui`

Open jankaifer opened this issue 5 years ago • 12 comments

What are you trying to achieve?

Start CodeceptUi

What do you get instead?

~/tmp/codecept $ npx codecept-ui                  
Unhandled rejection

Environment info


 Environment information:-

codeceptVersion:  "2.6.8"
nodeInfo:  10.19.0
osInfo:  Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa)
cpuInfo:  (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
chromeInfo:  84.0.4147.105
edgeInfo:  "N/A"
firefoxInfo:  79.0
safariInfo:  N/A
helpers:  {
 "Puppeteer": {
  "url": "github.com",
  "show": true,
  "windowSize": "1200x900"
 }
}
plugins:  {
 "screenshotOnFail": {
  "enabled": true
 },
 "retryFailedStep": {
  "enabled": true
 },
 "allure": {}
}

jankaifer avatar Aug 08 '20 15:08 jankaifer

Same here, both windows 10 and Ubuntu 18

"devDependencies": { "@wdio/selenium-standalone-service": "^6.4.0", "codeceptjs": "^2.6.8", "puppeteer": "^5.2.1", "webdriverio": "^6.4.0", "@codeceptjs/ui": "^0.4.0" }

yacovg avatar Aug 15 '20 20:08 yacovg

Also seeing this problem. I'm on Ubuntu 18.04, using playwright. Tests work fine normally.

vid avatar Aug 28 '20 13:08 vid

I am seeing the issue on mac for a testcafe and puppeteer project.

clarebrody avatar Sep 01 '20 05:09 clarebrody

I have tried for webdriver and getting the same error

gurjeetbains avatar Sep 02 '20 07:09 gurjeetbains

codecept-ui requires CodeceptJS v3 which is currently under beta.

gulench avatar Sep 03 '20 16:09 gulench

codecept-ui requires CodeceptJS v3 which is currently under beta.

When I try to run it after upgrading to the beta, I see this: ⚠️You have to build Vue application by npm run build

vid avatar Sep 03 '20 18:09 vid

codecept-ui requires CodeceptJS v3 which is currently under beta.

When I try to run it after upgrading to the beta, I see this: ⚠️You have to build Vue application by npm run build

Contrary to the issue's original post on using the @codeceptjs/ui NPM package, it looks like you are trying to run the UI on a clone of the codeceptjs/ui Git repository. Then, as the error says, you need to npm run build before running the UI.

However, if it is about integrating the UI to an existing CodeceptJS test project, here are the steps that I followed on a Windows 10 workstation:

  1. Set up a CodeceptJS v3 test project. Check out the Upgrading to CodeceptJS v3 guide.

  2. Install CodeceptJS UI package:

    npm i @codeceptjs/ui --save-dev
    
  3. Run CodeceptJS UI:

    npx codecept-ui
    

Note: If you happen to run the Electron app, you will need to manually bring the app window into the viewport; refer this comment.

gulench avatar Sep 04 '20 21:09 gulench

I have the same problem and adding a breakpoint in https://github.com/codeceptjs/ui/blob/master/lib/codeceptjs/realtime-reporter.helper.js#L78 I get this error:

Error: Cannot find module 'mocha/lib/test'
Require stack:
- .../node_modules/@codeceptjs/ui/lib/api/new-test.js

And that takes me to these lines https://github.com/codeceptjs/ui/blob/master/lib/api/new-test.js#L5-L6 that are requiring mocha.js utils but @codeceptjs/ui is not listing mocha.js as a dependency.

So a temp solution would be to add mocha as a dependency of your project with npm i mocha -D but the real solution should be that @codeceptjs/ui adds it as a dependency of it's own.

callistino avatar Jan 27 '21 22:01 callistino

I am getting the same 'Unhandled rejection' message executing the command.

Here is my config:

CodeceptJS v3.0.7 @codeceptjs/ui @0.4.3

node: 12.18.4

OS: Ubuntu 20.04 LTS

helpers: {
    Nightmare: {
      url: 'https://app.sarbacane.com/',
      show: true
    }
  }
"scripts": {
    "test": "mocha",
    "codeceptjs": "codeceptjs run --steps",
    "codeceptjs:headless": "HEADLESS=true codeceptjs run --steps",
    "codecept:ui": "codecept-ui --app"
  },
  "dependencies": {
    "@codeceptjs/configure": "0.6.2",
    "codeceptjs": "3.0.7",
    "codeceptjs-nightmare": "1.2.0",
    "nightmare": "3.0.2",
    "nightmare-upload": "0.1.1",
    "playwright": "1.11.0"
  },
  "devDependencies": {
    "@codeceptjs/ui": "0.4.3"
  },

I have tried @gulench suggestion to reinstall on new project without success. Note that I have not given any browser setup to my project, i'm guessing (documentation is missing on this for nightmare) it's only electron compatible.

helenou avatar May 19 '21 13:05 helenou

Upgrade CodeceptJS to version 3.1.1, and Codecept-UI version is 0.4.6, still see this problem, anyone can help to provide some solution? Thanks. image

image

ansonliao avatar Aug 12 '21 20:08 ansonliao

Still happening this issue. Any idea about the root cause of this?

pedrommvv avatar Jul 13 '22 16:07 pedrommvv

still happen this issue on CodeceptJS v3.3.4 & playwright v1.23.4 & @codeceptjs/ui v0.4.6

realanthonysu avatar Jul 22 '22 04:07 realanthonysu

Same issue here.

woytekn avatar Apr 18 '23 09:04 woytekn

still happening

sebastianandrada avatar Apr 24 '23 21:04 sebastianandrada

Closed for now! Feel free to reopen if you still encounter the issue with latest version and would be nice to provide a sample code to reproduce the issue.

kobenguyent avatar Feb 05 '24 14:02 kobenguyent