elgentos / magento2-cypress-testing-suite

A community-driven Cypress testing suite for Magento 2
MIT License
172 stars 37 forks source link

Make rest api methods available as cy commands #97

Closed Vinai closed 2 years ago

Vinai commented 2 years ago

This helps avoid having to specify relative import paths from tests in modules.

peterjaap commented 2 years ago

Smart one, I actually put this into the Contributing part in the readme;

Avoid creating global cy functions (Custom Commands), instead put functions in utils/helpers and import them

But the way you do it here is that you get best of both worlds.

Vinai commented 2 years ago

Thanks for the merge, I didn't really expect you would like it :D I think it really is probably the best way to make code from this repo available to tests in a module (that is, in a different folder hierarchy).