Cypress
coryhouse opened this issue · 0 comments
coryhouse commented
Custom Commands
Cypress.Commands.add("findSectionByHeading", (heading) => {
return cy.findByRole("heading", { name: heading }).closest("section");
});
// This type is necessary for TypeScript
declare global {
namespace Cypress {
interface Chainable {
findSectionByHeading(heading: string): Chainable<Element>;
}
}
}