I am using Cypress and Cucumber for my end to end test.
I have the following Cypress structure:
page-one/
another-page/
cypress/integration/page-one/check-hero.js
cypress/integration/page-one/check-custom-block.js
cypress/integration/page-one.feature
cypress/integration/another-page.feature
Inside both files check-hero.js and check-custom-block.js I have:
Given('I navigate to page one', () => {
cy.visit(`${Cypress.env('baseUrl')}/page-one`);
});
Can I improve this structure to make it more DRY and to reuse this Given step in multiple files?