2021-07-15 11:17:56 +00:00
|
|
|
import { CATEGORY_DETAILS } from "../elements/catalog/categories/category-details";
|
|
|
|
import { BUTTON_SELECTORS } from "../elements/shared/button-selectors";
|
2021-09-10 08:59:46 +00:00
|
|
|
import { confirmationMessageShouldDisappear } from "./shared/confirmationMessages";
|
2021-07-15 11:17:56 +00:00
|
|
|
|
|
|
|
export function createCategory({ name, description }) {
|
|
|
|
cy.get(CATEGORY_DETAILS.nameInput)
|
|
|
|
.type(name)
|
|
|
|
.get(CATEGORY_DETAILS.descriptionInput)
|
|
|
|
.type(description)
|
|
|
|
.addAliasToGraphRequest("CategoryCreate")
|
|
|
|
.get(BUTTON_SELECTORS.confirm)
|
|
|
|
.click();
|
|
|
|
confirmationMessageShouldDisappear();
|
|
|
|
return cy.wait("@CategoryCreate");
|
|
|
|
}
|