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.

I.amOnPage is not a function

See original GitHub issue

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?

Provide console output if related. Use --verbose mode for more details.

> .\node_modules\.bin\codeceptjs run --steps --verbose
CodeceptJS v0.6.3
Using test root "C:\Users\tamj0rd2\coding\autotools3"

My First Test --
   [1] Starting recording promises
   Emitted | suite.before ([object Object])
 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 7ms

   Emitted | test.after
   [3] Starting recording promises
   Emitted | suite.after ([object Object])

-- FAILURES:

  1) My First Test: test something:
     I.amOnPage is not a function
  ypeError: I.amOnPage is not a function
      at Test.Scenario (tests\first_test.spec.js:4:5)
      at Context.test.fn (node_modules\codeceptjs-webdriverio\node_modules\codeceptjs\lib\scenario.js:29:24)


  FAIL  | 0 passed, 1 failed   // 27ms
   Emitted | global.result ([object Object])

Provide test source code if related

Feature('My First Test')

Scenario('test something', (I) => {
  I.amOnPage('/')
  I.see('Something')
})

Details

  • CodeceptJS version: 1.0.1
  • NodeJS Version: v6.9.2
  • Operating System: Windows 10
  • WebDriverIO version: 4.8.0
  • Configuration file:
{
  "tests": "./tests/**/*.spec.js",
  "timeout": 10000,
  "output": "./codecept_output",
  "helpers": {},
  "include": {
    "I": "./tests/steps_file.js"
  },
  "bootstrap": false,
  "mocha": {},
  "name": "autotools3"
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
Nathan-Schwartzcommented, Nov 9, 2017

That makes sense, I think what threw me off was using space bar to select an option. I thought the cursor next to the option meant it was selected and that enter would confirm my choice. If you can select multiple Helpers, not using enter makes sense though 👍

Maybe it would be worth it to make a note of using space to toggle options in the prompt? Either way, the issues were enough for me to figure out the problem.

Thanks @DavertMik! Love the package.

3reactions
benfurfiecommented, Aug 7, 2017

Also ran into this issue. Init file didn’t prompt for browser or url, though it is noted in the docs.

Perhaps there should be a section that highlights that they are required and how to add them manually.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I.amOnPage is not a function · Issue #535 - GitHub
What are you trying to achieve? Trying to run a simple test following the QuickStart on website using codeceptjs init ...
Read more >
Error when executing "see" or "wait" - CodeceptJS Community
Scenario('login test', (I) => { I.amOnPage(url); I.see('Supports'); });. I got this error ... webdriverMonad) is not a function. I'm using
Read more >
Getting Started - CodeceptJS
Each test is described inside a Scenario function with the I object passed into ... When "http://site.com" is url in config I.amOnPage('/'); ...
Read more >
Codeceptjs on Google Cloud Function goto of undefined
I'm trying to automate a web activity using CodeceptJS (with Puppeteer) running in a Google Cloud Function. My index.js is:
Read more >
Codeception/CodeceptJS - Gitter
Whenever i require a helper, i cant access any built-in functions like I.amOnPage. Does anybody ever seen this? With this code, i cant...
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