create simple product without sku (#2188)
* create simple product without sku * remove comments * restore channel cleanup line * cr fixes
This commit is contained in:
parent
cea3ead44b
commit
0ad0becf9f
1 changed files with 19 additions and 12 deletions
|
@ -193,10 +193,11 @@ describe("Creating variants", () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
it(
|
it(
|
||||||
"should create simple product without sku",
|
"should create simple product without sku SALEOR_2806",
|
||||||
{ tags: ["@products", "@allEnv"] },
|
{ tags: ["@products", "@allEnv"] },
|
||||||
() => {
|
() => {
|
||||||
const name = `${startsWith}${faker.datatype.number()}`;
|
const name = `${startsWith}${faker.datatype.number()}`;
|
||||||
|
|
||||||
cy.visit(urlList.products)
|
cy.visit(urlList.products)
|
||||||
.get(PRODUCTS_LIST.createProductBtn)
|
.get(PRODUCTS_LIST.createProductBtn)
|
||||||
.click()
|
.click()
|
||||||
|
@ -208,15 +209,21 @@ describe("Creating variants", () => {
|
||||||
)
|
)
|
||||||
.fillAutocompleteSelect(PRODUCT_DETAILS.categoryInput);
|
.fillAutocompleteSelect(PRODUCT_DETAILS.categoryInput);
|
||||||
selectChannelInDetailsPages(defaultChannel.name);
|
selectChannelInDetailsPages(defaultChannel.name);
|
||||||
cy.get(PRODUCT_DETAILS.addWarehouseButton).click();
|
cy.get(PRODUCT_DETAILS.costPriceInput)
|
||||||
|
.type(10)
|
||||||
|
.get(PRODUCT_DETAILS.sellingPriceInput)
|
||||||
|
.type(10)
|
||||||
|
.addAliasToGraphRequest("VariantCreate")
|
||||||
|
.get(BUTTON_SELECTORS.confirm)
|
||||||
|
.click()
|
||||||
|
.confirmationMessageShouldDisappear()
|
||||||
|
.wait("@VariantCreate")
|
||||||
|
.get(PRODUCT_DETAILS.addWarehouseButton)
|
||||||
|
.click();
|
||||||
cy.contains(PRODUCT_DETAILS.warehouseOption, warehouse.name)
|
cy.contains(PRODUCT_DETAILS.warehouseOption, warehouse.name)
|
||||||
.click()
|
.click()
|
||||||
.get(PRODUCT_DETAILS.stockInput)
|
.get(PRODUCT_DETAILS.stockInput)
|
||||||
.clearAndType(10)
|
.clearAndType(10)
|
||||||
.get(PRODUCT_DETAILS.costPriceInput)
|
|
||||||
.type(10)
|
|
||||||
.get(PRODUCT_DETAILS.sellingPriceInput)
|
|
||||||
.type(10)
|
|
||||||
.get(AVAILABLE_CHANNELS_FORM.assignedChannels)
|
.get(AVAILABLE_CHANNELS_FORM.assignedChannels)
|
||||||
.click()
|
.click()
|
||||||
.get(
|
.get(
|
||||||
|
@ -227,22 +234,22 @@ describe("Creating variants", () => {
|
||||||
`${AVAILABLE_CHANNELS_FORM.publishedRadioButtons}${AVAILABLE_CHANNELS_FORM.radioButtonsValueTrue}`,
|
`${AVAILABLE_CHANNELS_FORM.publishedRadioButtons}${AVAILABLE_CHANNELS_FORM.radioButtonsValueTrue}`,
|
||||||
)
|
)
|
||||||
.click()
|
.click()
|
||||||
.addAliasToGraphRequest("VariantCreate")
|
.addAliasToGraphRequest("ProductDetails")
|
||||||
.get(BUTTON_SELECTORS.confirm)
|
.get(BUTTON_SELECTORS.confirm)
|
||||||
.click()
|
.click()
|
||||||
.confirmationMessageShouldDisappear()
|
.confirmationMessageShouldDisappear()
|
||||||
.wait("@VariantCreate")
|
.wait("@ProductDetails")
|
||||||
.then(({ response }) => {
|
.then(({ response }) => {
|
||||||
const variants = [
|
const variants = [response.body.data.product.variants[0]];
|
||||||
response.body.data.productVariantCreate.productVariant,
|
|
||||||
];
|
|
||||||
createWaitingForCaptureOrder({
|
createWaitingForCaptureOrder({
|
||||||
channelSlug: defaultChannel.slug,
|
channelSlug: defaultChannel.slug,
|
||||||
email: "example@example.com",
|
email: "example@example.com",
|
||||||
variantsList: variants,
|
variantsList: variants,
|
||||||
shippingMethodName: shippingMethod.name,
|
shippingMethodName: shippingMethod.name,
|
||||||
address,
|
address,
|
||||||
});
|
})
|
||||||
|
.its("order.id")
|
||||||
|
.should("be.ok");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue