I was wondering if we could call a page object model from a cypress custom commands. If this can happen then it could make cypress automated test more powerful
Asked
Active
Viewed 75 times
0
-
It can be done easily with importing your page object. – jjhelguero Dec 15 '22 at 17:35
-
Can u add a bit of code snippet. Forexample login page called on custom command made for login – Mcr Dec 15 '22 at 19:31
-
It's simple. Add `import {login} from '/path/to/login/login.js'` at top of your `commands.js` file. I recommendi reading up more on importing. https://bobbyhadz.com/blog/javascript-import-class-from-another-file – jjhelguero Dec 15 '22 at 19:37