codeceptjs / ui

Web UI for CodeceptJS
https://codecept.io
MIT License
82 stars 28 forks source link

Unhandled rejection when running `npx codecept-ui` #92

Closed jankaifer closed 8 months ago

jankaifer commented 4 years ago

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": {}
}
yacovg commented 4 years ago

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" }

vid commented 4 years ago

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

clarebrody commented 4 years ago

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

gurjeetbains commented 4 years ago

I have tried for webdriver and getting the same error

gulench commented 4 years ago

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

vid commented 4 years ago

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

gulench commented 4 years ago

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.

callistino commented 3 years ago

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.

helenou commented 3 years ago

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.

ansonliao commented 3 years ago

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

pedrommvv commented 2 years ago

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

realanthonysu commented 2 years ago

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

woytekn commented 1 year ago

Same issue here.

sebastianandrada commented 1 year ago

still happening

kobenguyent commented 8 months ago

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.