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.

CodeceptJS 3: Error: "I.say is not a function"

See original GitHub issue

What are you trying to achieve?

Execute I.say or I.retry in CodeceptJS 3 Beta.4

What do you get instead?

Errors I.say is not a function or I.retry is not a function

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

$ npx codeceptjs run
DEPRECATION NOTICE:
You are using webdriverio v5. It is recommended to update to webdriverio@6.
Support of webdriverio v5 is deprecated and will be removed in CodeceptJS 3.0

CodeceptJS v3.0.0-beta.4
Using test root "/Users/grafn/projects/Isay"

Isay --
Error: old CodeceptJS v2 format detected. Upgrade your project to the new format -> https://bit.ly/codecept3Up
  ✖ test something in 313ms

-- FAILURES:

  1) Isay
       test something:
     I.say is not a function
      at Test.<anonymous> (Isay_test.js:4:4)
      at Context.test.fn (node_modules/codeceptjs/lib/scenario.js:79:14)


  Artifacts:
  - screenshot: /Users/grafn/projects/Isay/output/test_something.failed.png


  FAIL  | 0 passed, 1 failed   // 1s

Provide test source code if related


Feature('Isay');

Scenario('test something', (I) => {
        I.say('hello world');
        I.retry(2).amOnPage('https://www.google');
});

Details

  • CodeceptJS version: 3.0 beta.4
  • NodeJS Version: 12.16
  • Operating System: MacOS Catalina
  • webdriverio
  • Configuration file:
const { setHeadlessWhen } = require('@codeceptjs/configure');

// turn on headless mode when running with HEADLESS=true environment variable
// HEADLESS=true npx codecept run
setHeadlessWhen(process.env.HEADLESS);

exports.config = {
  tests: './*_test.js',
  output: './output',
  helpers: {
    WebDriver: {
      url: 'http://localhost',
      browser: 'chrome'
    }
  },
  include: {
    I: './steps_file.js'
  },
  bootstrap: null,
  mocha: {},
  name: 'Isay',
  plugins: {
    retryFailedStep: {
      enabled: true
    },
    screenshotOnFail: {
      enabled: true
    }
  }
}

Steps file:

// in this file you can append custom step methods to 'I' object

module.exports = function() {
  return actor({

    // Define custom steps here, use 'this' to access default methods of I.
    // It is recommended to place a general 'login' function here.

  });
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
PeterNgTrcommented, Aug 17, 2020

Hey, with codeceptjs v3.0 you should inject like {I} not I like older version.

1reaction
ngrafcommented, Oct 8, 2020

I can confirm my reported bug is fixed now in official final public version of “3.0.0” 👍🏻

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started | CodeceptJS
Each test is described inside a Scenario function with the I object passed into it. The I object is an actor, an abstraction...
Read more >
CodeceptJS locator.stringify is not a function error while ...
It looks like you found a bug, made in Dec, 2017. Soon, fix will be made. As workaround, use different locators, not just...
Read more >
Boostrap - is not a function error - CodeceptJS Community
Hi! I'm trying build my custom runner, but when I start it I have error “TypeError: codecept.bootstrap is not a function”. runner.js:
Read more >
Codeception/CodeceptJS - Gitter
Hello. I started using codeceptjs recently and I find it a fantastic tool. I managed to develop scripts for testing my UI (Selenium...
Read more >
codeceptjs | Yarn - Package Manager
codeceptjs. owner Codeception740.1kMIT3.3.7TS vulns 3 vulnerabilities. Supercharged End 2 End Testing Framework for NodeJS. acceptance, end2end, end 2 end, ...
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