Playwright Cucumber with javascript- Unable to reuse the steps from another step definition file, getting Page not defined error
I am new to Playwright and I am trying to create a Cucumber Playwright POM framework. For this I have create 2 feature files userLogin.feature and bookHotel.feature. And I have 3 step definition files called userLogin.steps.js, bookHotel.steps.js and searchHotel.steps.js. When I run the userLogin.feature file alone, it works fine as I have only 3 steps mentioned in it. However, when I run bookHotel.feature file which reuses 3 steps from userLogin.steps.js and 1 step from searchHotel.steps.js. It gives error stating Page is Not defined in the searchHotel.steps.js file. I have tried various ways to initialise the page object but I am not able to fix the issue. Is there a way to utilise the same steps across multiple feature files like in cucumber java?