
* reference type cypress working * refactor * remove screenshots * add reference * add slash marker * run tests based on shop version * fix run tests based on shop version * fix run tests based on shop version * change base url to localhost * fix plugins * fix plugins * fix plugins * fix plugins * fix plugins * fix plugins * fix yml * fix yml * chage file names * fix files names * fix broken imports add checking for errors in grpah responses * fix broken imports add checking for errors in grpah responses * update jest * fix snapshot
18 lines
505 B
JavaScript
18 lines
505 B
JavaScript
Cypress.Commands.add(
|
|
"handleDeleteElement",
|
|
(element, deleteFunction, startsWith, name) => {
|
|
if (element.node[name].includes(startsWith)) {
|
|
deleteFunction(element.node.id);
|
|
}
|
|
}
|
|
);
|
|
Cypress.Commands.add(
|
|
"deleteElementsStartsWith",
|
|
(deleteFunction, getFunction, startsWith, name = "name") => {
|
|
getFunction(100, startsWith).then(elements => {
|
|
elements.forEach(element => {
|
|
cy.handleDeleteElement(element, deleteFunction, startsWith, name);
|
|
});
|
|
});
|
|
}
|
|
);
|