Codeceptjs: TypeError: I.amOnPage is not a function

Created on 23 Feb 2017  Â·  4Comments  Â·  Source: codeceptjs/CodeceptJS

What are you trying to achieve?

trying to run a simple test following the QuickStart on website using codeceptjs init

http://codecept.io/quickstart/

What do you get instead?

j-MacBook-Pro:s j$ codeceptjs run --steps
CodeceptJS v0.5.0
Using test root "/Users/j/s"

title --
 test something
 ✖ FAILED in 2ms


-- FAILURES:

  1) title: test something:
     I.amOnPage is not a function

  Run with --verbose flag to see NodeJS stacktrace


  FAIL  | 0 passed, 1 failed   // 8ms
j-MacBook-Pro:s j$ 

Provide test source code if related


Feature('title');

Scenario('test something', (I) => {

  I.amOnPage('http://google.com');

});

Details

  • CodeceptJS version: 0.5.0
  • NodeJS Version: 7
  • Operating System: OSX
  • Nightmare version: 2.9.1
  • Configuration file:

{
  "tests": "./*_test.js",
  "timeout": 10000,
  "output": "./output",
  "helpers": {},
  "include": {
    "I": "./steps_file.js"
  },
  "bootstrap": false,
  "mocha": {},
  "name": "s"
}

question

Most helpful comment

You need to define helpers in codecept.json as described here: http://codecept.io/nightmare/

{ // ..
  "helpers": {
    "Nightmare": {
      "url": "http://localhost",
      "show": false,
      "restart": false
    }
  }
  // ..
}

All 4 comments

Maybe you need to install webdriverIO,Please use the command:npm install -g webdriverio

Using Nightmare.js

You need to define helpers in codecept.json as described here: http://codecept.io/nightmare/

{ // ..
  "helpers": {
    "Nightmare": {
      "url": "http://localhost",
      "show": false,
      "restart": false
    }
  }
  // ..
}

Closing due inactivity

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dsypien picture dsypien  Â·  4Comments

hanthomas picture hanthomas  Â·  4Comments

wahengchang picture wahengchang  Â·  4Comments

Isikiyski picture Isikiyski  Â·  4Comments

davorb picture davorb  Â·  4Comments