[Question] Steps file variable scope.
What are you trying to achieve?
I am trying to make a login function in the steps file. The first time the login function is used, you are redirected to a page to fill out more information. I want to either check the URL or record the number of times the login function has been used so I know if the data page needs to be filled out.
Right now I am trying to use a variable to track the number of times the login function is called, but I can't figure out the variable scope of return actor(... What what be the best way to do this sort of thing in codeceptjs?
actor is registered globally so it is a singeleton.
I think you can just store the counter inside a custom_steps.js and they should persist between tests.
Yep, thought I had tried that but I had done it wrong, I had used this and not var.
module.exports = function () {
this.runcounter1 = 0; // doesn't work
var runcounter2 = 0; // works
Thanks