Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom helper functions are not calling after upgrading from 2 to3 #4780

Open
midhunsanku opened this issue Jan 23, 2025 · 2 comments
Open

Comments

@midhunsanku
Copy link

midhunsanku commented Jan 23, 2025

created custom helper and added async function as below:

async fillField(selector, value) {
await this.puppeteer.fillField(element, value)
await this.puppeteer.page.keyboard.press("Tab")
// function to wait for ajax Load
}

Calling fillField in test files

I.fillField(selector, value) --> Its calling await this.puppeteer.fillField(element, value) instead of custom helper function

@DavertMik
Copy link
Contributor

I think it depends on order of helpers declared in config.
There is no pre-defined list of helpers in the code so CodeceptJS has no differentiation is it standard one

Could you show your current config?

Try to add your own helper latest in the list
If not helps add it as first

@midhunsanku
Copy link
Author

We are currently upgrading from CodeceptJS 2.6.11 and Puppeteer 9.1.1 to CodeceptJS 3.6.0 and Puppeteer 24.1.0. However, we have observed that all our scripts are failing because our custom helper functions are not being called.

Below is codecept.conf.js strutcture:

const config= {

tests: "./features/*-test.js",
output: "./output",
helpers: {

Puppeteer: {

},
Helper1: {
require: "./helpers/helper1.js"
}
.
.
.
.
.
// all customer helpers

}
include:{
I: "./src/support/navigation.js",
}
bootstart,
teardown,
plugins:{
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants