2021-07-05 10:21:35 +00:00
|
|
|
import { ASSIGN_ELEMENTS_SELECTORS } from "../../elements/shared/assign-elements-selectors";
|
2021-07-15 09:20:59 +00:00
|
|
|
import { waitForProgressBarToNotBeVisible } from "./progressBar";
|
2021-07-05 10:21:35 +00:00
|
|
|
|
|
|
|
export function assignElements(name, withLoader = true) {
|
|
|
|
cy.get(ASSIGN_ELEMENTS_SELECTORS.searchInput).type(name);
|
|
|
|
if (withLoader) {
|
2021-07-15 09:20:59 +00:00
|
|
|
cy.get(ASSIGN_ELEMENTS_SELECTORS.dialogContent);
|
|
|
|
waitForProgressBarToNotBeVisible();
|
2021-07-05 10:21:35 +00:00
|
|
|
}
|
|
|
|
cy.contains(ASSIGN_ELEMENTS_SELECTORS.tableRow, name)
|
|
|
|
.find(ASSIGN_ELEMENTS_SELECTORS.checkbox)
|
|
|
|
.click()
|
|
|
|
.get(ASSIGN_ELEMENTS_SELECTORS.submitButton)
|
|
|
|
.click();
|
|
|
|
}
|