question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not load helper Nightmare from module './helper/Nightmare'

See original GitHub issue

What are you trying to achieve?

Hi @DavertMik , I’m trying to run tests with Nightmare (both nightmare and nightmare-upload have been installed globally):

codeceptjs run . --steps

What do you get instead?

Got following:

Could not load helper Nightmare from module './helper/Nightmare':
Required modules are not installed.

RUN: [sudo] npm install -g nightmare nightmare-upload
{}

Error: 
    at createHelpers (/usr/lib/node_modules/codeceptjs/lib/container.js:29:13)
    at Object.create (/usr/lib/node_modules/codeceptjs/lib/container.js:102:15)
    at Codecept.init (/usr/lib/node_modules/codeceptjs/lib/codecept.js:43:15)
    at Command.module.exports (/usr/lib/node_modules/codeceptjs/lib/command/run.js:23:14)
    at Command.listener (/usr/lib/node_modules/codeceptjs/node_modules/commander/index.js:301:8)
    at emitTwo (events.js:106:13)
    at Command.emit (events.js:191:7)
    at Command.parseArgs (/usr/lib/node_modules/codeceptjs/node_modules/commander/index.js:615:12)
    at Command.parse (/usr/lib/node_modules/codeceptjs/node_modules/commander/index.js:458:21)
    at Object.<anonymous> (/usr/lib/node_modules/codeceptjs/bin/codecept.js:90:9)

My test code is:

Feature('Hellooworld');

Scenario('Login page loaded', (I) => {
  I.amOnPage('/');
  I.seeElement({name: 'password'});
});

Details

  • CodeceptJS version:
  • NodeJS Version:
  • Operating System:
  • Protractor || WebDriverIO || Nightmare version (if related)
  • Configuration file:
{
  "tests": "./tests/e2e/*_test.js",
  "timeout": 20000,
  "output": "./tests/e2e/output",
  "helpers": {
    "Nightmare": {
      "url": "http://localhost:3000",
      "show": false 
    }
  },
  "include": {},
  "bootstrap": false,
  "mocha": {},
  "name": "ui"
}

Any thoughts about it? Thanks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
adrianblynchcommented, Mar 30, 2017

Now as I expand my sample test to:

Feature('Retrieve booking');

Scenario('test something', (I) => {
	I.amOnPage('http://localhost:3000');
});

It errors with:

08:45> npm test

> myb-e2e@1.0.0 test /project
> codeceptjs run --steps --verbose

CodeceptJS v0.5.1
Using test root "/project"

Retrieve booking --
   [1] Starting recording promises
   Emitted | suite.before
 test something
   [2] Starting recording promises
   Emitted | test.before
   Emitted | test.start ([object Object])
   [2] Queued | throw error TypeError: I.amOnPage is not a function
   [2] Queued | fire test.passed
   [2] Queued | finish test
   [2] Error | TypeError: I.amOnPage is not a function
   [2] Starting <teardown> session
   Emitted | test.failed ([object Object])
   [2] <teardown> Queued | () => done(err)
   [2] <teardown> Stopping recording promises
 ✖ FAILED in 3ms

   Emitted | test.after
   [3] Starting recording promises
   Emitted | suite.after

-- FAILURES:

  1) Retrieve booking: test something:
     I.amOnPage is not a function
  ypeError: I.amOnPage is not a function
      at Test.Scenario (tests/retrieve_booking.js:5:4)
      at Context.test.fn (node_modules/codeceptjs/lib/scenario.js:29:24)


  FAIL  | 0 passed, 1 failed   // 13ms
   Emitted | global.result ([object Object])
npm ERR! Test failed.  See above for more details.
1reaction
ccfungcommented, Mar 26, 2017

I met the same question after global installation. I solved the problem by changing to local installation and edited the codecept.json as followed :

"node_modules": {
    "Nightmare": {
      "url": "",
      "show": false,
      "restart": false
    }},

It works for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
Could not load helper Nightmare from module './helper/Nightmare': Required modules are not installed. RUN: [sudo] npm install -g nightmare ...
Read more >
Docker Could not load helper ResembleHelper - CodeceptJS
I have codeceptjs-resemblehelper module added. Tried to give the absolute path. REquired module manually. Nothing helped. SImple docker command
Read more >
Codeception/CodeceptJS - Gitter
Could not load helper DbHelper from module 'node_modules/codeceptjs-dbhelper': Cannot find module 'node_modules/codeceptjs-dbhelper'.
Read more >
Nightmare JS not working - Stack Overflow
I'm on Windows, so can't help you much. You can browse through their GitHub issues for any information. – hassansin. Apr 19, 2016...
Read more >
Nightmare | CodeceptJS
This helper should be configured in codecept.conf.ts or codecept.conf.js. url - base url of website to be tested.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found