
* 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
20 lines
691 B
JavaScript
20 lines
691 B
JavaScript
import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
|
|
import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
|
|
|
|
Cypress.Commands.add("findElementOnTable", elementName => {
|
|
cy.getTextFromElement(SHARED_ELEMENTS.table).then(tableText => {
|
|
if (tableText.includes(elementName)) {
|
|
cy.contains(SHARED_ELEMENTS.tableRow, elementName).click({ force: true });
|
|
} else {
|
|
cy.get(BUTTON_SELECTORS.nextPaginationButton)
|
|
.click()
|
|
.findElementOnTable(elementName);
|
|
}
|
|
});
|
|
});
|
|
|
|
Cypress.Commands.add("searchInTable", query => {
|
|
cy.get(SHARED_ELEMENTS.searchInput)
|
|
.type(query)
|
|
.waitForProgressBarToNotExist();
|
|
});
|