IO-2327 converting a job tests
This commit is contained in:
@@ -49,3 +49,26 @@ Cypress.on("uncaught:exception", (err, runnable) => {
|
||||
// failing the test
|
||||
return false;
|
||||
});
|
||||
|
||||
Cypress.Commands.add("antdSelect", (selector) => {
|
||||
cy.get(`.ant-select-${selector} > .ant-select-selector`).click();
|
||||
cy.get(`.ant-select-${selector} .ant-select-selection-search input`)
|
||||
.invoke("attr", "id")
|
||||
.then((selElm) => {
|
||||
const dropDownSelector = `#${selElm}_list`;
|
||||
cy.get(dropDownSelector)
|
||||
.next()
|
||||
.find(".ant-select-item-option-content")
|
||||
.first()
|
||||
.click();
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add("antdFormSelect", (name, text, cb) => {
|
||||
cy.get(".ant-form-item-required").then(($field) => {
|
||||
if ($field.text().includes(text)) {
|
||||
if (name) cy.antdSelect(name);
|
||||
cb?.();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user