mardi 29 septembre 2020

Cypress reuse test cases in multiple test suites

I am new to Cypress and trying out one POC.

The application I am working on requires me to test the same component in different test suites. Is there any why in which I can avoid rewriting the same chunk of code, like using function?

export function testWelcomeBanner() {
    ...
 welcomeBanner.should('have.text', 'welcome');
    ...
}

I did try some ways, like trying to call this function from it block in test suites etc. but received errors. Any help appreciated.

Aucun commentaire:

Enregistrer un commentaire