Fix get correct domain from version (#2118)
This commit is contained in:
parent
fd7813692a
commit
9e43dd4ab1
85 changed files with 918 additions and 916 deletions
4
.github/workflows/tests-nightly.yml
vendored
4
.github/workflows/tests-nightly.yml
vendored
|
@ -158,7 +158,9 @@ jobs:
|
|||
env:
|
||||
version: ${{github.event.client_payload.version}}
|
||||
run: |
|
||||
echo "::set-output name=formatted_version::$(echo $version | grep -Eo "\d\.\d" | sed s/\\.// | head -n 1 )"
|
||||
echo "::set-output name=formatted_version::$(echo $version | grep -Eo "\d\.\d" | sed s/\\.// | head -n 1 | { read formatted; echo "$formatted"; })"
|
||||
echo "$formatted_version"
|
||||
|
||||
- name: Cypress run - automatically
|
||||
uses: cypress-io/github-action@v4
|
||||
env:
|
||||
|
|
|
@ -11,7 +11,7 @@ module.exports = defineConfig({
|
|||
viewportHeight: 660,
|
||||
e2e: {
|
||||
env: {
|
||||
grepFilterSpecs: true
|
||||
grepFilterSpecs: true,
|
||||
},
|
||||
setupNodeEvents(on, config) {
|
||||
config = require("./cypress/support/cypress-grep/plugin")(config);
|
||||
|
@ -19,6 +19,6 @@ module.exports = defineConfig({
|
|||
return config;
|
||||
},
|
||||
baseUrl: "http://localhost:9000/",
|
||||
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}"
|
||||
}
|
||||
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
|
||||
},
|
||||
});
|
||||
|
|
|
@ -57,7 +57,7 @@ describe("Tests for apps", () => {
|
|||
const token = app.tokens.find(element => element.name === "Default");
|
||||
expect(token).to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -81,7 +81,7 @@ describe("Tests for apps", () => {
|
|||
expect(webhooks[0].name).to.eq(randomName);
|
||||
expect(webhooks[0].targetUrl).to.eq(targetUrl);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -109,10 +109,10 @@ describe("Tests for apps", () => {
|
|||
.then(app => {
|
||||
const token = app.tokens.find(element => element.name === randomName);
|
||||
const tokenLastFourDigits = expectedToken.slice(
|
||||
expectedToken.length - 4
|
||||
expectedToken.length - 4,
|
||||
);
|
||||
expect(token.authToken).to.eq(tokenLastFourDigits);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@ import faker from "faker";
|
|||
|
||||
import {
|
||||
CATEGORIES_LIST,
|
||||
categoryRow
|
||||
categoryRow,
|
||||
} from "../../elements/catalog/categories/categories-list";
|
||||
import { CATEGORY_DETAILS } from "../../elements/catalog/categories/category-details";
|
||||
import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors";
|
||||
|
@ -13,7 +13,7 @@ import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
|
|||
import { categoryDetailsUrl, urlList } from "../../fixtures/urlList";
|
||||
import {
|
||||
createCategory as createCategoryRequest,
|
||||
getCategory
|
||||
getCategory,
|
||||
} from "../../support/api/requests/Category";
|
||||
import { deleteCategoriesStartsWith } from "../../support/api/utils/catalog/categoryUtils";
|
||||
import * as channelsUtils from "../../support/api/utils/channelsUtils";
|
||||
|
@ -21,7 +21,7 @@ import * as productsUtils from "../../support/api/utils/products/productsUtils";
|
|||
import { deleteShippingStartsWith } from "../../support/api/utils/shippingUtils";
|
||||
import {
|
||||
createCategory,
|
||||
updateCategory
|
||||
updateCategory,
|
||||
} from "../../support/pages/catalog/categoriesPage";
|
||||
|
||||
describe("As an admin I want to manage categories", () => {
|
||||
|
@ -52,7 +52,7 @@ describe("As an admin I want to manage categories", () => {
|
|||
({
|
||||
category: categoryResp,
|
||||
attribute: attributeResp,
|
||||
productType: productTypeResp
|
||||
productType: productTypeResp,
|
||||
}) => {
|
||||
category = categoryResp;
|
||||
attribute = attributeResp;
|
||||
|
@ -62,9 +62,9 @@ describe("As an admin I want to manage categories", () => {
|
|||
channelId: defaultChannel.id,
|
||||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id
|
||||
categoryId: category.id,
|
||||
});
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(({ product: productResp }) => (product = productResp));
|
||||
});
|
||||
|
@ -92,7 +92,7 @@ describe("As an admin I want to manage categories", () => {
|
|||
const descriptionResp = JSON.parse(newCategory.description);
|
||||
expect(descriptionResp.blocks[0].data.text).to.eq(categoryName);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -111,7 +111,7 @@ describe("As an admin I want to manage categories", () => {
|
|||
getCategory(category.id).then(categoryResp => {
|
||||
expect(categoryResp.children.edges[0].node.name).to.eq(categoryName);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -125,7 +125,7 @@ describe("As an admin I want to manage categories", () => {
|
|||
.click()
|
||||
.url()
|
||||
.should("include", urlList.addProduct);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -150,7 +150,7 @@ describe("As an admin I want to manage categories", () => {
|
|||
getCategory(category.id).then(categoryResp => {
|
||||
expect(categoryResp.products.edges.length).to.be.eq(0);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -162,7 +162,7 @@ describe("As an admin I want to manage categories", () => {
|
|||
.type(category.name);
|
||||
cy.contains(SHARED_ELEMENTS.tableRow, category.name).click();
|
||||
cy.contains(SHARED_ELEMENTS.header, category.name).should("be.visible");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -172,7 +172,7 @@ describe("As an admin I want to manage categories", () => {
|
|||
const categoryName = `${startsWith}${faker.datatype.number()}`;
|
||||
|
||||
createCategoryRequest({
|
||||
name: categoryName
|
||||
name: categoryName,
|
||||
}).then(categoryResp => {
|
||||
cy.visit(categoryDetailsUrl(categoryResp.id))
|
||||
.get(BUTTON_SELECTORS.deleteButton)
|
||||
|
@ -183,7 +183,7 @@ describe("As an admin I want to manage categories", () => {
|
|||
.waitForRequestAndCheckIfNoErrors("@CategoryDelete");
|
||||
getCategory(categoryResp.id).should("be.null");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -194,11 +194,11 @@ describe("As an admin I want to manage categories", () => {
|
|||
const updatedName = `${startsWith}updatedCategory`;
|
||||
|
||||
createCategoryRequest({
|
||||
name: categoryName
|
||||
name: categoryName,
|
||||
})
|
||||
.then(categoryResp => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
categoryDetailsUrl(categoryResp.id)
|
||||
categoryDetailsUrl(categoryResp.id),
|
||||
);
|
||||
updateCategory({ name: updatedName, description: updatedName });
|
||||
getCategory(categoryResp.id);
|
||||
|
@ -209,7 +209,7 @@ describe("As an admin I want to manage categories", () => {
|
|||
const descriptionText = descriptionJson.blocks[0].data.text;
|
||||
expect(descriptionText).to.eq(updatedName);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -222,13 +222,13 @@ describe("As an admin I want to manage categories", () => {
|
|||
let secondCategory;
|
||||
|
||||
createCategoryRequest({
|
||||
name: firstCategoryName
|
||||
name: firstCategoryName,
|
||||
}).then(categoryResp => {
|
||||
firstCategory = categoryResp;
|
||||
});
|
||||
|
||||
createCategoryRequest({
|
||||
name: secondCategoryName
|
||||
name: secondCategoryName,
|
||||
}).then(categoryResp => {
|
||||
secondCategory = categoryResp;
|
||||
cy.visit(urlList.categories)
|
||||
|
@ -248,7 +248,7 @@ describe("As an admin I want to manage categories", () => {
|
|||
getCategory(firstCategory.id).should("be.null");
|
||||
getCategory(secondCategory.id).should("be.null");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -261,13 +261,13 @@ describe("As an admin I want to manage categories", () => {
|
|||
let mainCategory;
|
||||
|
||||
createCategoryRequest({
|
||||
name: mainCategoryName
|
||||
name: mainCategoryName,
|
||||
})
|
||||
.then(categoryResp => {
|
||||
mainCategory = categoryResp;
|
||||
createCategoryRequest({
|
||||
name: subCategoryName,
|
||||
parent: mainCategory.id
|
||||
parent: mainCategory.id,
|
||||
});
|
||||
})
|
||||
.then(categoryResp => {
|
||||
|
@ -288,6 +288,6 @@ describe("As an admin I want to manage categories", () => {
|
|||
.then(categoryResp => {
|
||||
expect(categoryResp.children.edges).to.be.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -9,7 +9,7 @@ import { collectionDetailsUrl, urlList } from "../../fixtures/urlList";
|
|||
import { createChannel } from "../../support/api/requests/Channels";
|
||||
import {
|
||||
addProductToCollection,
|
||||
createCollection as createCollectionRequest
|
||||
createCollection as createCollectionRequest,
|
||||
} from "../../support/api/requests/Collections";
|
||||
import { updateChannelInProduct } from "../../support/api/requests/Product";
|
||||
import { getCollection } from "../../support/api/requests/storeFront/Collections";
|
||||
|
@ -21,7 +21,7 @@ import * as productsUtils from "../../support/api/utils/products/productsUtils";
|
|||
import { deleteShippingStartsWith } from "../../support/api/utils/shippingUtils";
|
||||
import {
|
||||
isCollectionVisible,
|
||||
isProductInCollectionVisible
|
||||
isProductInCollectionVisible,
|
||||
} from "../../support/api/utils/storeFront/collectionsUtils";
|
||||
import { isProductVisibleInSearchResult } from "../../support/api/utils/storeFront/storeFrontProductUtils";
|
||||
import filterTests from "../../support/filterTests";
|
||||
|
@ -29,7 +29,7 @@ import {
|
|||
assignProductsToCollection,
|
||||
createCollection,
|
||||
removeProductsFromCollection,
|
||||
updateCollection
|
||||
updateCollection,
|
||||
} from "../../support/pages/catalog/collectionsPage";
|
||||
|
||||
filterTests({ definedTags: ["all"] }, () => {
|
||||
|
@ -61,7 +61,7 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
({
|
||||
attribute: attributeResp,
|
||||
productType: productTypeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
attribute = attributeResp;
|
||||
productType = productTypeResp;
|
||||
|
@ -71,9 +71,9 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
channelId: defaultChannel.id,
|
||||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id
|
||||
categoryId: category.id,
|
||||
});
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(({ product: productResp }) => (product = productResp));
|
||||
});
|
||||
|
@ -100,14 +100,14 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
.then(() => {
|
||||
getCollection({
|
||||
collectionId: collection.id,
|
||||
channelSlug: defaultChannel.slug
|
||||
channelSlug: defaultChannel.slug,
|
||||
});
|
||||
})
|
||||
.then(({ collection: resp }) => {
|
||||
const isVisible = isCollectionVisible(resp, collection.id);
|
||||
expect(isVisible).to.equal(false);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -126,14 +126,14 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
assignProductsToCollection(name);
|
||||
getCollection({
|
||||
collectionId: collection.id,
|
||||
channelSlug: defaultChannel.slug
|
||||
channelSlug: defaultChannel.slug,
|
||||
});
|
||||
})
|
||||
.then(({ collection: resp }) => {
|
||||
const isVisible = isCollectionVisible(resp, collection.id);
|
||||
expect(isVisible).to.equal(true);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -159,14 +159,14 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
assignProductsToCollection(name);
|
||||
getCollection({
|
||||
collectionId: collection.id,
|
||||
channelSlug: defaultChannel.slug
|
||||
channelSlug: defaultChannel.slug,
|
||||
});
|
||||
})
|
||||
.then(({ collection: resp }) => {
|
||||
const isVisible = isCollectionVisible(resp, collection.id);
|
||||
expect(isVisible).to.equal(false);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -186,7 +186,7 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
visibleInListings: false
|
||||
visibleInListings: false,
|
||||
})
|
||||
.then(({ product: productResp }) => (createdProduct = productResp));
|
||||
cy.visit(urlList.collections);
|
||||
|
@ -199,13 +199,13 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
.then(() => {
|
||||
getCollection({
|
||||
collectionId: collection.id,
|
||||
channelSlug: defaultChannel.slug
|
||||
channelSlug: defaultChannel.slug,
|
||||
});
|
||||
})
|
||||
.then(({ collection: resp }) => {
|
||||
const isVisible = isProductInCollectionVisible(
|
||||
resp,
|
||||
createdProduct.id
|
||||
createdProduct.id,
|
||||
);
|
||||
expect(isVisible).to.equal(true);
|
||||
})
|
||||
|
@ -215,11 +215,11 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
.then(resp => {
|
||||
const isVisible = isProductVisibleInSearchResult(
|
||||
resp,
|
||||
createdProduct.name
|
||||
createdProduct.name,
|
||||
);
|
||||
expect(isVisible).to.equal(false);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -240,7 +240,7 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
.its("collection")
|
||||
.should("be.null");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -281,7 +281,7 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
.its("collection")
|
||||
.should("be.null");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
xit(
|
||||
|
@ -304,7 +304,7 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
visibleInListings: false
|
||||
visibleInListings: false,
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
productToAssign = productResp;
|
||||
|
@ -320,7 +320,7 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -342,14 +342,14 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
visibleInListings: false
|
||||
visibleInListings: false,
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
productToAssign = productResp;
|
||||
|
||||
addProductToCollection({
|
||||
collectionId: collection.id,
|
||||
productId: productToAssign.id
|
||||
productId: productToAssign.id,
|
||||
});
|
||||
|
||||
cy.visit(collectionDetailsUrl(collection.id));
|
||||
|
@ -369,7 +369,7 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
.should("be.empty");
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -382,7 +382,7 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
createCollectionRequest(collectionName)
|
||||
.then(collectionResp => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
collectionDetailsUrl(collectionResp.id)
|
||||
collectionDetailsUrl(collectionResp.id),
|
||||
);
|
||||
updateCollection({ name: updatedName, description: updatedName });
|
||||
getCollection({ collectionId: collectionResp.id, auth: "auth" });
|
||||
|
@ -393,7 +393,7 @@ filterTests({ definedTags: ["all"] }, () => {
|
|||
const descriptionText = descriptionJson.blocks[0].data.text;
|
||||
expect(descriptionText).to.eq(updatedName);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,24 +5,24 @@ import { GIFT_CARD_LIST } from "../../../elements/catalog/giftCard/giftCardList"
|
|||
import { completeCheckout } from "../../../support/api/requests/Checkout";
|
||||
import {
|
||||
createGiftCard,
|
||||
giftCardDeactivate
|
||||
giftCardDeactivate,
|
||||
} from "../../../support/api/requests/GiftCard";
|
||||
import {
|
||||
createCheckoutWithDisabledGiftCard,
|
||||
deleteGiftCardsWithTagStartsWith,
|
||||
isGiftCardDataAsExpected,
|
||||
purchaseProductWithActiveGiftCard
|
||||
purchaseProductWithActiveGiftCard,
|
||||
} from "../../../support/api/utils/catalog/giftCardUtils";
|
||||
import * as channelsUtils from "../../../support/api/utils/channelsUtils";
|
||||
import {
|
||||
addPayment,
|
||||
purchaseProductWithPromoCode
|
||||
purchaseProductWithPromoCode,
|
||||
} from "../../../support/api/utils/ordersUtils";
|
||||
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
|
||||
import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils";
|
||||
import {
|
||||
changeGiftCardActiveStatus,
|
||||
enterAndSelectGiftCards
|
||||
enterAndSelectGiftCards,
|
||||
} from "../../../support/pages/catalog/giftCardPage";
|
||||
|
||||
describe("As a admin I want to use enabled gift card in checkout", () => {
|
||||
|
@ -32,7 +32,7 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
|||
const email = "example@example.com";
|
||||
const giftCardData = {
|
||||
amount: 150,
|
||||
currency: "USD"
|
||||
currency: "USD",
|
||||
};
|
||||
|
||||
let defaultChannel;
|
||||
|
@ -61,7 +61,7 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
|||
auth: "token",
|
||||
channelSlug: defaultChannel.slug,
|
||||
shippingMethodName: resp.shippingMethod.name,
|
||||
variantsList: resp.variantsList
|
||||
variantsList: resp.variantsList,
|
||||
};
|
||||
});
|
||||
});
|
||||
|
@ -97,13 +97,13 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
|||
giftCardId: giftCard.id,
|
||||
expectedAmount: expectedGiftCardBalance,
|
||||
userEmail: email,
|
||||
initialBalance: giftCardData.amount
|
||||
initialBalance: giftCardData.amount,
|
||||
});
|
||||
})
|
||||
.then(dataAsExpected => {
|
||||
expect(dataAsExpected).to.be.true;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -127,13 +127,13 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
|||
.then(() => {
|
||||
isGiftCardDataAsExpected({
|
||||
giftCardId: giftCard.id,
|
||||
expectedAmount: giftCardData.amount
|
||||
expectedAmount: giftCardData.amount,
|
||||
});
|
||||
})
|
||||
.then(dataAsExpected => {
|
||||
expect(dataAsExpected).to.be.true;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -149,14 +149,14 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
|||
createGiftCard({
|
||||
tag: firstGiftCardName,
|
||||
amount,
|
||||
currency: "USD"
|
||||
currency: "USD",
|
||||
})
|
||||
.then(giftCard => {
|
||||
firstGiftCard = giftCard;
|
||||
createGiftCard({
|
||||
tag: secondGiftCardName,
|
||||
amount,
|
||||
currency: "USD"
|
||||
currency: "USD",
|
||||
});
|
||||
})
|
||||
.then(giftCard => {
|
||||
|
@ -180,14 +180,14 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
|||
.then(() => {
|
||||
isGiftCardDataAsExpected({
|
||||
giftCardId: firstGiftCard.id,
|
||||
expectedAmount: amount
|
||||
expectedAmount: amount,
|
||||
}).then(dataAsExpected => expect(dataAsExpected).to.be.true);
|
||||
isGiftCardDataAsExpected({
|
||||
giftCardId: secondGiftCard.id,
|
||||
expectedAmount: amount
|
||||
expectedAmount: amount,
|
||||
}).then(dataAsExpected => expect(dataAsExpected).to.be.true);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
xit(
|
||||
|
@ -205,7 +205,7 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
|||
tag: firstGiftCardName,
|
||||
amount,
|
||||
currency: "USD",
|
||||
isActive: false
|
||||
isActive: false,
|
||||
})
|
||||
.then(giftCard => {
|
||||
firstGiftCard = giftCard;
|
||||
|
@ -213,7 +213,7 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
|||
tag: secondGiftCardName,
|
||||
amount,
|
||||
currency: "USD",
|
||||
isActive: false
|
||||
isActive: false,
|
||||
});
|
||||
})
|
||||
.then(giftCard => {
|
||||
|
@ -230,7 +230,7 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
|||
expectedAmount: 0,
|
||||
initialAmount: amount,
|
||||
dataForCheckout,
|
||||
expectedOrderPrice
|
||||
expectedOrderPrice,
|
||||
}).then(isDataAsExpected => expect(isDataAsExpected).to.be.true);
|
||||
dataForCheckout.voucherCode = secondGiftCard.code;
|
||||
purchaseProductWithActiveGiftCard({
|
||||
|
@ -238,9 +238,9 @@ describe("As a admin I want to use enabled gift card in checkout", () => {
|
|||
expectedAmount: 0,
|
||||
initialAmount: amount,
|
||||
dataForCheckout,
|
||||
expectedOrderPrice
|
||||
expectedOrderPrice,
|
||||
}).then(isDataAsExpected => expect(isDataAsExpected).to.be.true);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
openAndFillUpCreateGiftCardDialog,
|
||||
saveGiftCard,
|
||||
setExpiryDate,
|
||||
setExpiryPeriod
|
||||
setExpiryPeriod,
|
||||
} from "../../../support/pages/catalog/giftCardPage";
|
||||
|
||||
describe("As an admin I want to create gift card", () => {
|
||||
|
@ -40,7 +40,7 @@ describe("As an admin I want to create gift card", () => {
|
|||
note: name,
|
||||
tag: name,
|
||||
amount,
|
||||
currency
|
||||
currency,
|
||||
});
|
||||
saveGiftCard()
|
||||
.then(giftCardResp => {
|
||||
|
@ -52,7 +52,7 @@ describe("As an admin I want to create gift card", () => {
|
|||
expect(giftCardsResp[0].node.initialBalance.amount).to.eq(amount);
|
||||
expect(giftCardsResp[0].node.initialBalance.currency).to.eq(currency);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -67,7 +67,7 @@ describe("As an admin I want to create gift card", () => {
|
|||
note: name,
|
||||
tag: name,
|
||||
amount,
|
||||
currency
|
||||
currency,
|
||||
});
|
||||
setExpiryPeriod(2, expiryPeriods.MONTH);
|
||||
saveGiftCard()
|
||||
|
@ -81,7 +81,7 @@ describe("As an admin I want to create gift card", () => {
|
|||
expect(giftCardsResp[0].node.initialBalance.currency).to.eq(currency);
|
||||
expect(giftCardsResp[0].node.expiryDate).to.eq(expectedExpiryDate);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -96,7 +96,7 @@ describe("As an admin I want to create gift card", () => {
|
|||
note: name,
|
||||
tag: name,
|
||||
amount,
|
||||
currency
|
||||
currency,
|
||||
});
|
||||
setExpiryDate(date);
|
||||
saveGiftCard()
|
||||
|
@ -110,6 +110,6 @@ describe("As an admin I want to create gift card", () => {
|
|||
expect(giftCardsResp[0].node.initialBalance.currency).to.eq(currency);
|
||||
expect(giftCardsResp[0].node.expiryDate).to.eq(date);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@ import { createWaitingForCaptureOrder } from "../../../support/api/utils/ordersU
|
|||
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../../support/api/utils/shippingUtils";
|
||||
|
||||
describe("As a customer I should be able to purchase gift card as a product", () => {
|
||||
|
@ -25,7 +25,7 @@ describe("As a customer I should be able to purchase gift card as a product", ()
|
|||
let address;
|
||||
const giftCardData = {
|
||||
amount: 150,
|
||||
currency: "USD"
|
||||
currency: "USD",
|
||||
};
|
||||
|
||||
before(() => {
|
||||
|
@ -43,14 +43,14 @@ describe("As a customer I should be able to purchase gift card as a product", ()
|
|||
({
|
||||
productType: productTypeResp,
|
||||
attribute: attributeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
productType = productTypeResp;
|
||||
attribute = attributeResp;
|
||||
category = categoryResp;
|
||||
|
||||
channelsUtils.getDefaultChannel();
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(channel => {
|
||||
defaultChannel = channel;
|
||||
|
@ -62,7 +62,7 @@ describe("As a customer I should be able to purchase gift card as a product", ()
|
|||
channelId: defaultChannel.id,
|
||||
name,
|
||||
address,
|
||||
price: shippingPrice
|
||||
price: shippingPrice,
|
||||
});
|
||||
})
|
||||
.then(({ shippingMethod: shippingMethodResp, warehouse: warehouse }) => {
|
||||
|
@ -74,7 +74,7 @@ describe("As a customer I should be able to purchase gift card as a product", ()
|
|||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
price: productPrice
|
||||
price: productPrice,
|
||||
});
|
||||
})
|
||||
.then(({ variantsList: variantsResp }) => {
|
||||
|
@ -97,10 +97,10 @@ describe("As a customer I should be able to purchase gift card as a product", ()
|
|||
channelSlug: defaultChannel.slug,
|
||||
email,
|
||||
shippingMethodName: shippingMethod.name,
|
||||
variantsList: variants
|
||||
variantsList: variants,
|
||||
}).then(({ order }) => {
|
||||
expect(order.id).to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@ import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
|
|||
import { giftCardDetailsUrl } from "../../../fixtures/urlList";
|
||||
import {
|
||||
createGiftCard,
|
||||
getGiftCardWithId
|
||||
getGiftCardWithId,
|
||||
} from "../../../support/api/requests/GiftCard";
|
||||
import { deleteGiftCardsWithTagStartsWith } from "../../../support/api/utils/catalog/giftCardUtils";
|
||||
import { formatDate } from "../../../support/formatData/formatDate";
|
||||
|
@ -34,7 +34,7 @@ describe("As an admin I want to update gift card", () => {
|
|||
createGiftCard({
|
||||
tag: name,
|
||||
amount: 10,
|
||||
currency: "USD"
|
||||
currency: "USD",
|
||||
}).then(giftCard => {
|
||||
cy.visit(giftCardDetailsUrl(giftCard.id))
|
||||
.get(BUTTON_SELECTORS.deleteButton)
|
||||
|
@ -47,7 +47,7 @@ describe("As an admin I want to update gift card", () => {
|
|||
.waitForRequestAndCheckIfNoErrors("@DeleteGiftCard");
|
||||
getGiftCardWithId(giftCard.id).should("be.null");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -61,7 +61,7 @@ describe("As an admin I want to update gift card", () => {
|
|||
createGiftCard({
|
||||
tag: name,
|
||||
amount: 10,
|
||||
currency: "USD"
|
||||
currency: "USD",
|
||||
})
|
||||
.then(giftCard => {
|
||||
cy.visit(giftCardDetailsUrl(giftCard.id))
|
||||
|
@ -86,10 +86,10 @@ describe("As an admin I want to update gift card", () => {
|
|||
})
|
||||
.then(giftCard => {
|
||||
expect(giftCard.tags[0].name.toLowerCase()).to.eq(
|
||||
updatedName.toLowerCase()
|
||||
updatedName.toLowerCase(),
|
||||
);
|
||||
expect(giftCard.expiryDate).to.eq(date);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@ import { WAREHOUSES_DETAILS } from "../../elements/warehouses/warehouse-details"
|
|||
import {
|
||||
completeCheckout,
|
||||
createCheckout,
|
||||
deliveryMethodUpdate
|
||||
deliveryMethodUpdate,
|
||||
} from "../../support/api/requests/Checkout";
|
||||
import { getOrder } from "../../support/api/requests/Order";
|
||||
import { updateWarehouse } from "../../support/api/requests/Warehouse";
|
||||
|
@ -16,17 +16,17 @@ import { addPayment } from "../../support/api/utils/ordersUtils";
|
|||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../support/api/utils/shippingUtils";
|
||||
import {
|
||||
createWarehouse,
|
||||
pickupOptions,
|
||||
visitAndEnablePickup,
|
||||
visitSetPublicStockAndEnablePickup
|
||||
visitSetPublicStockAndEnablePickup,
|
||||
} from "../../support/pages/warehousePage";
|
||||
|
||||
describe("Warehouses in checkout", () => {
|
||||
|
@ -60,18 +60,18 @@ describe("Warehouses in checkout", () => {
|
|||
categoryId: category.id,
|
||||
channelId: defaultChannel.id,
|
||||
productTypeId: productType.id,
|
||||
quantityInWarehouse: 100
|
||||
quantityInWarehouse: 100,
|
||||
};
|
||||
checkoutData = {
|
||||
returnAvailableCollectionPoints: true,
|
||||
channelSlug: defaultChannel.slug,
|
||||
email: "example@example.com",
|
||||
address: secondUsAddress
|
||||
address: secondUsAddress,
|
||||
};
|
||||
createShipping({
|
||||
channelId: defaultChannel.id,
|
||||
name: startsWith,
|
||||
address: secondUsAddress
|
||||
address: secondUsAddress,
|
||||
});
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
|
@ -99,7 +99,7 @@ describe("Warehouses in checkout", () => {
|
|||
createShipping({
|
||||
channelId: defaultChannel.id,
|
||||
name,
|
||||
address: secondUsAddress
|
||||
address: secondUsAddress,
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
warehouse = warehouseResp;
|
||||
|
@ -110,20 +110,20 @@ describe("Warehouses in checkout", () => {
|
|||
})
|
||||
.then(({ variantsList }) => {
|
||||
checkoutData.variantsList = variantsList.concat(
|
||||
variantsInOtherWarehouse
|
||||
variantsInOtherWarehouse,
|
||||
);
|
||||
createCheckout(checkoutData);
|
||||
})
|
||||
.then(({ checkout }) => {
|
||||
const clickAndCollectOption = checkout.availableCollectionPoints.find(
|
||||
element => element.id === warehouse.id
|
||||
element => element.id === warehouse.id,
|
||||
);
|
||||
expect(clickAndCollectOption.clickAndCollectOption).to.eq("ALL");
|
||||
expect(clickAndCollectOption.id).to.eq(warehouse.id);
|
||||
expect(clickAndCollectOption.isPrivate).to.eq(true);
|
||||
expect(clickAndCollectOption.name).to.eq(warehouse.name);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
xit(
|
||||
|
@ -136,7 +136,7 @@ describe("Warehouses in checkout", () => {
|
|||
createShipping({
|
||||
channelId: defaultChannel.id,
|
||||
name,
|
||||
address: secondUsAddress
|
||||
address: secondUsAddress,
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
warehouse = warehouseResp;
|
||||
|
@ -147,20 +147,20 @@ describe("Warehouses in checkout", () => {
|
|||
})
|
||||
.then(({ variantsList }) => {
|
||||
checkoutData.variantsList = variantsList.concat(
|
||||
variantsInOtherWarehouse
|
||||
variantsInOtherWarehouse,
|
||||
);
|
||||
createCheckout(checkoutData);
|
||||
})
|
||||
.then(({ checkout }) => {
|
||||
const clickAndCollectOption = checkout.availableCollectionPoints.find(
|
||||
element => element.id === warehouse.id
|
||||
element => element.id === warehouse.id,
|
||||
);
|
||||
expect(clickAndCollectOption.clickAndCollectOption).to.eq("ALL");
|
||||
expect(clickAndCollectOption.id).to.eq(warehouse.id);
|
||||
expect(clickAndCollectOption.isPrivate).to.eq(false);
|
||||
expect(clickAndCollectOption.name).to.eq(warehouse.name);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
xit(
|
||||
|
@ -174,7 +174,7 @@ describe("Warehouses in checkout", () => {
|
|||
createShipping({
|
||||
channelId: defaultChannel.id,
|
||||
name,
|
||||
address: secondUsAddress
|
||||
address: secondUsAddress,
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
warehouse = warehouseResp;
|
||||
|
@ -186,14 +186,14 @@ describe("Warehouses in checkout", () => {
|
|||
.then(({ variantsList }) => {
|
||||
variantsInLocalStock = variantsList;
|
||||
checkoutData.variantsList = variantsInLocalStock.concat(
|
||||
variantsInOtherWarehouse
|
||||
variantsInOtherWarehouse,
|
||||
);
|
||||
createCheckout(checkoutData);
|
||||
})
|
||||
.then(({ checkout }) => {
|
||||
expect(checkout.availableCollectionPoints).to.have.length(
|
||||
1,
|
||||
"there should be no available collection point for local stock"
|
||||
"there should be no available collection point for local stock",
|
||||
);
|
||||
checkoutData.variantsList = variantsInLocalStock;
|
||||
createCheckout(checkoutData);
|
||||
|
@ -205,7 +205,7 @@ describe("Warehouses in checkout", () => {
|
|||
expect(clickAndCollectOption.isPrivate).to.eq(false);
|
||||
expect(clickAndCollectOption.name).to.eq(warehouse.name);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
xit(
|
||||
|
@ -215,9 +215,9 @@ describe("Warehouses in checkout", () => {
|
|||
const name = `${startsWith}${faker.datatype.number()}`;
|
||||
createWarehouse({ name, address: usAddress });
|
||||
cy.get(WAREHOUSES_DETAILS.clickAndCollectLocalStockRadioButton).should(
|
||||
"not.exist"
|
||||
"not.exist",
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -245,6 +245,6 @@ describe("Warehouses in checkout", () => {
|
|||
cy.expectCorrectBasicAddress(order.shippingAddress, secondUsAddress);
|
||||
cy.expectCorrectBasicAddress(order.billingAddress, usAddress);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,17 @@ import { createChannel } from "../../support/api/requests/Channels";
|
|||
import {
|
||||
addProductsToCheckout,
|
||||
addShippingMethod,
|
||||
createCheckout
|
||||
createCheckout,
|
||||
} from "../../support/api/requests/Checkout";
|
||||
import { deleteChannelsStartsWith } from "../../support/api/utils/channelsUtils";
|
||||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../support/api/utils/shippingUtils";
|
||||
|
||||
describe("Products without shipment option", () => {
|
||||
|
@ -40,7 +40,7 @@ describe("Products without shipment option", () => {
|
|||
deleteChannelsStartsWith(startsWith);
|
||||
|
||||
createChannel({
|
||||
name
|
||||
name,
|
||||
})
|
||||
.then(channelResp => {
|
||||
channel = channelResp;
|
||||
|
@ -52,7 +52,7 @@ describe("Products without shipment option", () => {
|
|||
channelId: channel.id,
|
||||
name,
|
||||
address,
|
||||
minProductPrice: 100
|
||||
minProductPrice: 100,
|
||||
});
|
||||
})
|
||||
.then(
|
||||
|
@ -60,13 +60,13 @@ describe("Products without shipment option", () => {
|
|||
warehouse = warehouseResp;
|
||||
shippingMethod = shippingMethodResp;
|
||||
createTypeAttributeAndCategoryForProduct({ name });
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(
|
||||
({
|
||||
attribute: attributeResp,
|
||||
productType: productTypeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
createProductInChannel({
|
||||
attributeId: attributeResp.id,
|
||||
|
@ -74,7 +74,7 @@ describe("Products without shipment option", () => {
|
|||
channelId: channel.id,
|
||||
name,
|
||||
productTypeId: productTypeResp.id,
|
||||
warehouseId: warehouse.id
|
||||
warehouseId: warehouse.id,
|
||||
}).then(({ variantsList }) => (productWithShipping = variantsList));
|
||||
createProductInChannel({
|
||||
attributeId: attributeResp.id,
|
||||
|
@ -82,11 +82,11 @@ describe("Products without shipment option", () => {
|
|||
channelId: channel.id,
|
||||
name: nameProdWithoutShipping,
|
||||
productTypeId: productTypeResp.id,
|
||||
warehouseId: warehouse.id
|
||||
warehouseId: warehouse.id,
|
||||
}).then(
|
||||
({ variantsList }) => (productWithoutShipping = variantsList)
|
||||
({ variantsList }) => (productWithoutShipping = variantsList),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -99,27 +99,27 @@ describe("Products without shipment option", () => {
|
|||
email: "example@example.com",
|
||||
variantsList: productWithoutShipping,
|
||||
address,
|
||||
auth: "token"
|
||||
auth: "token",
|
||||
})
|
||||
.then(({ checkout }) => {
|
||||
expect(
|
||||
checkout.shippingMethods,
|
||||
"expect no available shipping"
|
||||
"expect no available shipping",
|
||||
).to.have.length(0);
|
||||
addProductsToCheckout(checkout.id, productWithShipping, 1);
|
||||
})
|
||||
.then(({ checkout }) => {
|
||||
expect(
|
||||
checkout.shippingMethods,
|
||||
"expect no available shipping"
|
||||
"expect no available shipping",
|
||||
).to.have.length(0);
|
||||
addShippingMethod(checkout.id, shippingMethod.id);
|
||||
})
|
||||
.then(({ errors }) => {
|
||||
expect(errors[0].field, "expect error in shipping method").to.be.eq(
|
||||
"shippingMethodId"
|
||||
"shippingMethodId",
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
checkoutShippingAddressUpdate,
|
||||
checkoutVariantsUpdate,
|
||||
completeCheckout,
|
||||
createCheckout
|
||||
createCheckout,
|
||||
} from "../../support/api/requests/Checkout";
|
||||
import { getOrder } from "../../support/api/requests/Order";
|
||||
import {
|
||||
|
@ -15,7 +15,7 @@ import {
|
|||
createAndCompleteCheckoutWithoutShipping,
|
||||
createWaitingForCaptureOrder,
|
||||
getShippingMethodIdFromCheckout,
|
||||
updateShippingInCheckout
|
||||
updateShippingInCheckout,
|
||||
} from "../../support/api/utils/ordersUtils";
|
||||
import { createDigitalAndPhysicalProductWithNewDataAndDefaultChannel } from "../../support/api/utils/products/productsUtils";
|
||||
|
||||
|
@ -36,7 +36,7 @@ describe("As an unlogged customer I want to order physical and digital products"
|
|||
cy.clearSessionData().loginUserViaRequest();
|
||||
createDigitalAndPhysicalProductWithNewDataAndDefaultChannel({
|
||||
physicalProductName: physicalName,
|
||||
digitalProductName: digitalName
|
||||
digitalProductName: digitalName,
|
||||
}).then(resp => {
|
||||
defaultChannel = resp.defaultChannel;
|
||||
address = resp.address;
|
||||
|
@ -55,7 +55,7 @@ describe("As an unlogged customer I want to order physical and digital products"
|
|||
email,
|
||||
billingAddress: address,
|
||||
variantsList: digitalVariants,
|
||||
auth: "token"
|
||||
auth: "token",
|
||||
})
|
||||
.then(({ order }) => {
|
||||
getOrder(order.id);
|
||||
|
@ -63,11 +63,11 @@ describe("As an unlogged customer I want to order physical and digital products"
|
|||
.then(order => {
|
||||
expect(
|
||||
order.isShippingRequired,
|
||||
"Check if is shipping required in order"
|
||||
"Check if is shipping required in order",
|
||||
).to.eq(false);
|
||||
expect(order.status, testsMessage).to.be.eq("UNFULFILLED");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -79,7 +79,7 @@ describe("As an unlogged customer I want to order physical and digital products"
|
|||
email,
|
||||
variantsList: physicalVariants,
|
||||
shippingMethodName: shippingMethod.name,
|
||||
address
|
||||
address,
|
||||
})
|
||||
.then(({ order }) => {
|
||||
getOrder(order.id);
|
||||
|
@ -87,11 +87,11 @@ describe("As an unlogged customer I want to order physical and digital products"
|
|||
.then(order => {
|
||||
expect(
|
||||
order.isShippingRequired,
|
||||
"Check if is shipping required in order"
|
||||
"Check if is shipping required in order",
|
||||
).to.eq(true);
|
||||
expect(order.status, testsMessage).to.be.eq("UNFULFILLED");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -105,7 +105,7 @@ describe("As an unlogged customer I want to order physical and digital products"
|
|||
email,
|
||||
variantsList: digitalVariants,
|
||||
billingAddress: address,
|
||||
auth: "token"
|
||||
auth: "token",
|
||||
})
|
||||
.then(({ checkout: checkoutResp }) => {
|
||||
checkout = checkoutResp;
|
||||
|
@ -117,11 +117,11 @@ describe("As an unlogged customer I want to order physical and digital products"
|
|||
.then(() => {
|
||||
const shippingMethodId = getShippingMethodIdFromCheckout(
|
||||
checkout,
|
||||
shippingMethod.name
|
||||
shippingMethod.name,
|
||||
);
|
||||
expect(
|
||||
shippingMethodId,
|
||||
"Should be not possible to add shipping method without shipping address"
|
||||
"Should be not possible to add shipping method without shipping address",
|
||||
).to.not.be.ok;
|
||||
checkoutShippingAddressUpdate(checkout.id, address);
|
||||
})
|
||||
|
@ -131,7 +131,7 @@ describe("As an unlogged customer I want to order physical and digital products"
|
|||
.then(({ errors }) => {
|
||||
expect(
|
||||
errors,
|
||||
"Should be not possible to add payment without shipping"
|
||||
"Should be not possible to add payment without shipping",
|
||||
).to.have.lengthOf(1);
|
||||
updateShippingInCheckout(checkout.token, shippingMethod.name);
|
||||
})
|
||||
|
@ -147,10 +147,10 @@ describe("As an unlogged customer I want to order physical and digital products"
|
|||
.then(order => {
|
||||
expect(
|
||||
order.isShippingRequired,
|
||||
"Check if is shipping required in order"
|
||||
"Check if is shipping required in order",
|
||||
).to.eq(true);
|
||||
expect(order.status, testsMessage).to.be.eq("UNFULFILLED");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@ import faker from "faker";
|
|||
|
||||
import {
|
||||
addProductsToCheckout,
|
||||
createCheckout
|
||||
createCheckout,
|
||||
} from "../../support/api/requests/Checkout";
|
||||
import { getVariants } from "../../support/api/requests/Product";
|
||||
import { createWaitingForCaptureOrder } from "../../support/api/utils/ordersUtils";
|
||||
|
@ -29,18 +29,18 @@ describe("Manage products stocks in checkout", () => {
|
|||
{
|
||||
name: "variantsWithLowStock",
|
||||
trackInventory: true,
|
||||
quantityInWarehouse: 1
|
||||
quantityInWarehouse: 1,
|
||||
},
|
||||
{
|
||||
name: "variantsWithoutTrackInventory",
|
||||
trackInventory: false,
|
||||
quantityInWarehouse: 0
|
||||
quantityInWarehouse: 0,
|
||||
},
|
||||
{
|
||||
name: "lastVariantInStock",
|
||||
trackInventory: true,
|
||||
quantityInWarehouse: 1
|
||||
}
|
||||
quantityInWarehouse: 1,
|
||||
},
|
||||
];
|
||||
|
||||
createNewProductWithSeveralVariants(name, variantsData).then(resp => {
|
||||
|
@ -48,13 +48,13 @@ describe("Manage products stocks in checkout", () => {
|
|||
address = resp.address;
|
||||
shippingMethod = resp.shippingMethod;
|
||||
variantsWithLowStock = resp.createdVariants.find(
|
||||
variant => variant.name === "variantsWithLowStock"
|
||||
variant => variant.name === "variantsWithLowStock",
|
||||
);
|
||||
variantsWithoutTrackInventory = resp.createdVariants.find(
|
||||
variant => variant.name === "variantsWithoutTrackInventory"
|
||||
variant => variant.name === "variantsWithoutTrackInventory",
|
||||
);
|
||||
lastVariantInStock = resp.createdVariants.find(
|
||||
variant => variant.name === "lastVariantInStock"
|
||||
variant => variant.name === "lastVariantInStock",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -69,7 +69,7 @@ describe("Manage products stocks in checkout", () => {
|
|||
billingAddress: address,
|
||||
email: "email@example.com",
|
||||
variantsList: [variantsWithLowStock],
|
||||
auth: "token"
|
||||
auth: "token",
|
||||
})
|
||||
.then(({ checkout: checkout }) => {
|
||||
addProductsToCheckout(checkout.id, [variantsWithLowStock], 2);
|
||||
|
@ -77,10 +77,10 @@ describe("Manage products stocks in checkout", () => {
|
|||
.then(({ errors }) => {
|
||||
expect(
|
||||
errors[0],
|
||||
"should return error on field quantity"
|
||||
"should return error on field quantity",
|
||||
).to.have.property("field", "quantity");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -92,11 +92,11 @@ describe("Manage products stocks in checkout", () => {
|
|||
channelSlug: defaultChannel.slug,
|
||||
email: "example@example.com",
|
||||
shippingMethodName: shippingMethod.name,
|
||||
variantsList: [variantsWithoutTrackInventory]
|
||||
variantsList: [variantsWithoutTrackInventory],
|
||||
}).then(({ order }) => {
|
||||
expect(order, "order should be created").to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -108,7 +108,7 @@ describe("Manage products stocks in checkout", () => {
|
|||
channelSlug: defaultChannel.slug,
|
||||
email: "example@example.com",
|
||||
shippingMethodName: shippingMethod.name,
|
||||
variantsList: [lastVariantInStock]
|
||||
variantsList: [lastVariantInStock],
|
||||
})
|
||||
.then(({ order }) => {
|
||||
expect(order, "order should be created").to.be.ok;
|
||||
|
@ -119,6 +119,6 @@ describe("Manage products stocks in checkout", () => {
|
|||
expect(variant.node.stocks[0].quantityAllocated).to.eq(1);
|
||||
expect(variant.node.stocks[0].quantity).to.eq(1);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -8,11 +8,11 @@ import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
|
|||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../support/api/utils/shippingUtils";
|
||||
|
||||
describe("Warehouses in checkout", () => {
|
||||
|
@ -41,7 +41,7 @@ describe("Warehouses in checkout", () => {
|
|||
createShipping({
|
||||
channelId: defaultChannel.id,
|
||||
name,
|
||||
address: usAddress
|
||||
address: usAddress,
|
||||
});
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
|
@ -56,7 +56,7 @@ describe("Warehouses in checkout", () => {
|
|||
channelId: defaultChannel.id,
|
||||
productTypeId: productType.id,
|
||||
warehouseId: warehouse.id,
|
||||
quantityInWarehouse: 100
|
||||
quantityInWarehouse: 100,
|
||||
});
|
||||
})
|
||||
.then(({ variantsList }) => {
|
||||
|
@ -64,12 +64,12 @@ describe("Warehouses in checkout", () => {
|
|||
channelSlug: defaultChannel.slug,
|
||||
email: "example@example.com",
|
||||
variantsList,
|
||||
address: plAddress
|
||||
address: plAddress,
|
||||
});
|
||||
})
|
||||
.then(({ errors }) => {
|
||||
expect(errors[0]).to.have.property("field", "quantity");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -9,7 +9,7 @@ import { getVariant } from "../../../support/api/requests/Product";
|
|||
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
|
||||
import {
|
||||
createProductInChannelWithoutVariants,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../../support/api/utils/products/productsUtils";
|
||||
import { createProductTypeWithNewVariantSelectionAttribute } from "../../../support/api/utils/productTypeUtils";
|
||||
import { fillUpVariantDetails } from "../../../support/pages/catalog/products/VariantsPage";
|
||||
|
@ -22,7 +22,7 @@ describe("As an admin I want to use attributes in variant selection", () => {
|
|||
{ key: "MULTISELECT", TC: "SALEOR_0535" },
|
||||
{ key: "BOOLEAN", TC: "SALEOR_0536" },
|
||||
{ key: "NUMERIC", TC: "SALEOR_0537" },
|
||||
{ key: "SWATCH", TC: "SALEOR_0538" }
|
||||
{ key: "SWATCH", TC: "SALEOR_0538" },
|
||||
];
|
||||
let channel;
|
||||
let category;
|
||||
|
@ -33,7 +33,7 @@ describe("As an admin I want to use attributes in variant selection", () => {
|
|||
deleteProductsStartsWith(startsWith);
|
||||
getDefaultChannel().then(defaultChannel => (channel = defaultChannel));
|
||||
createCategory({ name: startsWith }).then(
|
||||
categoryResp => (category = categoryResp)
|
||||
categoryResp => (category = categoryResp),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -56,7 +56,7 @@ describe("As an admin I want to use attributes in variant selection", () => {
|
|||
createProductTypeWithNewVariantSelectionAttribute({
|
||||
name,
|
||||
inputType,
|
||||
attributeValues
|
||||
attributeValues,
|
||||
})
|
||||
.then(({ productType: productTypeResp }) => {
|
||||
productType = productTypeResp;
|
||||
|
@ -65,20 +65,20 @@ describe("As an admin I want to use attributes in variant selection", () => {
|
|||
categoryId: category.id,
|
||||
productTypeId: productType.id,
|
||||
name,
|
||||
channelId: channel.id
|
||||
channelId: channel.id,
|
||||
});
|
||||
})
|
||||
.then(productResp => {
|
||||
product = productResp;
|
||||
|
||||
cy.visit(addVariantUrl(product.id)).addAliasToGraphRequest(
|
||||
"VariantCreate"
|
||||
"VariantCreate",
|
||||
);
|
||||
|
||||
fillUpVariantDetails({
|
||||
sku: name,
|
||||
attributeName: attributeValues[0],
|
||||
attributeType: inputType
|
||||
attributeType: inputType,
|
||||
});
|
||||
|
||||
cy.wait("@VariantCreate");
|
||||
|
@ -92,7 +92,7 @@ describe("As an admin I want to use attributes in variant selection", () => {
|
|||
expect(attributes[0].attribute.inputType).to.eq(inputType);
|
||||
cy.confirmationMessageShouldAppear();
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,26 +20,26 @@ describe("As an admin I want to create content attribute", () => {
|
|||
{ type: "RICH_TEXT", testCase: "SALEOR_0515" },
|
||||
{ type: "BOOLEAN", testCase: "SALEOR_0516" },
|
||||
{ type: "DATE", testCase: "SALEOR_0527" },
|
||||
{ type: "DATE_TIME", testCase: "SALEOR_0528" }
|
||||
{ type: "DATE_TIME", testCase: "SALEOR_0528" },
|
||||
];
|
||||
const attributeReferenceType = [
|
||||
{ type: "PRODUCT", testCase: "SALEOR_0517" },
|
||||
{ type: "PAGE", testCase: "SALEOR_0518" }
|
||||
{ type: "PAGE", testCase: "SALEOR_0518" },
|
||||
];
|
||||
const attributeNumericType = [
|
||||
{
|
||||
unitSystem: "IMPERIAL",
|
||||
unitsOf: "DISTANCE",
|
||||
unit: "FT",
|
||||
testCase: "SALEOR_0519"
|
||||
testCase: "SALEOR_0519",
|
||||
},
|
||||
{
|
||||
unitSystem: "METRIC",
|
||||
unitsOf: "VOLUME",
|
||||
unit: "CUBIC_CENTIMETER",
|
||||
testCase: "SALEOR_0520"
|
||||
testCase: "SALEOR_0520",
|
||||
},
|
||||
{ unitSystem: "without selecting unit", testCase: "SALEOR_0521" }
|
||||
{ unitSystem: "without selecting unit", testCase: "SALEOR_0521" },
|
||||
];
|
||||
|
||||
before(() => {
|
||||
|
@ -65,7 +65,7 @@ describe("As an admin I want to create content attribute", () => {
|
|||
const attributeName = `${startsWith}${faker.datatype.number()}`;
|
||||
createAttributeWithInputType({
|
||||
name: attributeName,
|
||||
attributeType: attributeType.type
|
||||
attributeType: attributeType.type,
|
||||
})
|
||||
.then(({ attribute }) => {
|
||||
getAttribute(attribute.id);
|
||||
|
@ -73,10 +73,10 @@ describe("As an admin I want to create content attribute", () => {
|
|||
.then(attribute => {
|
||||
expectCorrectDataInAttribute(attribute, {
|
||||
attributeName,
|
||||
attributeType: attributeType.type
|
||||
attributeType: attributeType.type,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -90,7 +90,7 @@ describe("As an admin I want to create content attribute", () => {
|
|||
createAttributeWithInputType({
|
||||
name: attributeName,
|
||||
attributeType,
|
||||
entityType: entityType.type
|
||||
entityType: entityType.type,
|
||||
})
|
||||
.then(({ attribute }) => {
|
||||
getAttribute(attribute.id);
|
||||
|
@ -99,10 +99,10 @@ describe("As an admin I want to create content attribute", () => {
|
|||
expectCorrectDataInAttribute(attribute, {
|
||||
attributeName,
|
||||
attributeType,
|
||||
entityType: entityType.type
|
||||
entityType: entityType.type,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -116,7 +116,7 @@ describe("As an admin I want to create content attribute", () => {
|
|||
createAttributeWithInputType({
|
||||
name: attributeName,
|
||||
attributeType,
|
||||
numericSystemType
|
||||
numericSystemType,
|
||||
})
|
||||
.then(({ attribute }) => {
|
||||
getAttribute(attribute.id);
|
||||
|
@ -125,10 +125,10 @@ describe("As an admin I want to create content attribute", () => {
|
|||
expectCorrectDataInAttribute(attribute, {
|
||||
attributeName,
|
||||
attributeType,
|
||||
unit: numericSystemType.unit
|
||||
unit: numericSystemType.unit,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -141,7 +141,7 @@ describe("As an admin I want to create content attribute", () => {
|
|||
createAttributeWithInputType({
|
||||
name: attributeName,
|
||||
attributeType,
|
||||
valueRequired: false
|
||||
valueRequired: false,
|
||||
})
|
||||
.then(({ attribute }) => {
|
||||
getAttribute(attribute.id);
|
||||
|
@ -150,9 +150,9 @@ describe("As an admin I want to create content attribute", () => {
|
|||
expectCorrectDataInAttribute(attribute, {
|
||||
attributeName,
|
||||
attributeType,
|
||||
valueRequired: false
|
||||
valueRequired: false,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -9,13 +9,13 @@ import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
|
|||
import { attributeDetailsUrl, urlList } from "../../../fixtures/urlList";
|
||||
import {
|
||||
createAttribute,
|
||||
getAttribute
|
||||
getAttribute,
|
||||
} from "../../../support/api/requests/Attribute";
|
||||
import { deleteAttributesStartsWith } from "../../../support/api/utils/attributes/attributeUtils";
|
||||
import { expectCorrectDataInAttribute } from "../../../support/api/utils/attributes/checkAttributeData";
|
||||
import {
|
||||
createAttributeWithInputType,
|
||||
fillUpAttributeNameAndCode
|
||||
fillUpAttributeNameAndCode,
|
||||
} from "../../../support/pages/attributesPage";
|
||||
|
||||
describe("As an admin I want to create product attribute", () => {
|
||||
|
@ -27,26 +27,26 @@ describe("As an admin I want to create product attribute", () => {
|
|||
{ type: "RICH_TEXT", testCase: "SALEOR_0504" },
|
||||
{ type: "BOOLEAN", testCase: "SALEOR_0505" },
|
||||
{ type: "DATE", testCase: "SALEOR_0523" },
|
||||
{ type: "DATE_TIME", testCase: "SALEOR_0524" }
|
||||
{ type: "DATE_TIME", testCase: "SALEOR_0524" },
|
||||
];
|
||||
const attributeReferenceType = [
|
||||
{ type: "PRODUCT", testCase: "SALEOR_0506" },
|
||||
{ type: "PAGE", testCase: "SALEOR_0507" }
|
||||
{ type: "PAGE", testCase: "SALEOR_0507" },
|
||||
];
|
||||
const attributeNumericType = [
|
||||
{
|
||||
unitSystem: "IMPERIAL",
|
||||
unitsOf: "DISTANCE",
|
||||
unit: "FT",
|
||||
testCase: "SALEOR_0508"
|
||||
testCase: "SALEOR_0508",
|
||||
},
|
||||
{
|
||||
unitSystem: "METRIC",
|
||||
unitsOf: "VOLUME",
|
||||
unit: "CUBIC_CENTIMETER",
|
||||
testCase: "SALEOR_0509"
|
||||
testCase: "SALEOR_0509",
|
||||
},
|
||||
{ unitSystem: "without selecting unit", testCase: "SALEOR_0510" }
|
||||
{ unitSystem: "without selecting unit", testCase: "SALEOR_0510" },
|
||||
];
|
||||
|
||||
before(() => {
|
||||
|
@ -71,7 +71,7 @@ describe("As an admin I want to create product attribute", () => {
|
|||
|
||||
createAttributeWithInputType({
|
||||
name: attributeName,
|
||||
attributeType: attributeType.type
|
||||
attributeType: attributeType.type,
|
||||
})
|
||||
.then(({ attribute }) => {
|
||||
getAttribute(attribute.id);
|
||||
|
@ -79,10 +79,10 @@ describe("As an admin I want to create product attribute", () => {
|
|||
.then(attribute => {
|
||||
expectCorrectDataInAttribute(attribute, {
|
||||
attributeName,
|
||||
attributeType: attributeType.type
|
||||
attributeType: attributeType.type,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -97,7 +97,7 @@ describe("As an admin I want to create product attribute", () => {
|
|||
createAttributeWithInputType({
|
||||
name: attributeName,
|
||||
attributeType,
|
||||
entityType: entityType.type
|
||||
entityType: entityType.type,
|
||||
})
|
||||
.then(({ attribute }) => {
|
||||
getAttribute(attribute.id);
|
||||
|
@ -106,10 +106,10 @@ describe("As an admin I want to create product attribute", () => {
|
|||
expectCorrectDataInAttribute(attribute, {
|
||||
attributeName,
|
||||
attributeType,
|
||||
entityType: entityType.type
|
||||
entityType: entityType.type,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -124,7 +124,7 @@ describe("As an admin I want to create product attribute", () => {
|
|||
createAttributeWithInputType({
|
||||
name: attributeName,
|
||||
attributeType,
|
||||
numericSystemType
|
||||
numericSystemType,
|
||||
})
|
||||
.then(({ attribute }) => {
|
||||
getAttribute(attribute.id);
|
||||
|
@ -133,10 +133,10 @@ describe("As an admin I want to create product attribute", () => {
|
|||
expectCorrectDataInAttribute(attribute, {
|
||||
attributeName,
|
||||
attributeType,
|
||||
unit: numericSystemType.unit
|
||||
unit: numericSystemType.unit,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -150,7 +150,7 @@ describe("As an admin I want to create product attribute", () => {
|
|||
createAttributeWithInputType({
|
||||
name: attributeName,
|
||||
attributeType,
|
||||
valueRequired: false
|
||||
valueRequired: false,
|
||||
})
|
||||
.then(({ attribute }) => {
|
||||
getAttribute(attribute.id);
|
||||
|
@ -159,10 +159,10 @@ describe("As an admin I want to create product attribute", () => {
|
|||
expectCorrectDataInAttribute(attribute, {
|
||||
attributeName,
|
||||
attributeType,
|
||||
valueRequired: false
|
||||
valueRequired: false,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -173,7 +173,7 @@ describe("As an admin I want to create product attribute", () => {
|
|||
const attributeName = `${startsWith}${faker.datatype.number()}`;
|
||||
createAttributeWithInputType({
|
||||
name: attributeName,
|
||||
attributeType
|
||||
attributeType,
|
||||
})
|
||||
.then(({ attribute }) => {
|
||||
getAttribute(attribute.id);
|
||||
|
@ -182,10 +182,10 @@ describe("As an admin I want to create product attribute", () => {
|
|||
expectCorrectDataInAttribute(attribute, {
|
||||
attributeName,
|
||||
attributeType,
|
||||
valueRequired: true
|
||||
valueRequired: true,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -198,7 +198,7 @@ describe("As an admin I want to create product attribute", () => {
|
|||
createAttributeWithInputType({
|
||||
name: attributeName,
|
||||
attributeType,
|
||||
swatchImage
|
||||
swatchImage,
|
||||
})
|
||||
.then(({ attribute }) => {
|
||||
getAttribute(attribute.id);
|
||||
|
@ -207,13 +207,13 @@ describe("As an admin I want to create product attribute", () => {
|
|||
expectCorrectDataInAttribute(attribute, {
|
||||
attributeName,
|
||||
attributeType,
|
||||
valueRequired: true
|
||||
valueRequired: true,
|
||||
});
|
||||
cy.get(ATTRIBUTES_DETAILS.swatchValueImage)
|
||||
.invoke("attr", "style")
|
||||
.should("include", "saleorDemoProductSneakers");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -223,7 +223,7 @@ describe("As an admin I want to create product attribute", () => {
|
|||
const attributeName = `${startsWith}${faker.datatype.number()}`;
|
||||
|
||||
createAttribute({
|
||||
name: attributeName
|
||||
name: attributeName,
|
||||
}).then(attribute => {
|
||||
cy.visit(attributeDetailsUrl(attribute.id))
|
||||
.get(BUTTON_SELECTORS.deleteButton)
|
||||
|
@ -234,7 +234,7 @@ describe("As an admin I want to create product attribute", () => {
|
|||
.waitForRequestAndCheckIfNoErrors("@AttributeDelete");
|
||||
getAttribute(attribute.id).should("be.null");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -245,7 +245,7 @@ describe("As an admin I want to create product attribute", () => {
|
|||
const attributeUpdatedName = `${startsWith}${faker.datatype.number()}`;
|
||||
|
||||
createAttribute({
|
||||
name: attributeName
|
||||
name: attributeName,
|
||||
})
|
||||
.then(attribute => {
|
||||
cy.visit(attributeDetailsUrl(attribute.id));
|
||||
|
@ -260,6 +260,6 @@ describe("As an admin I want to create product attribute", () => {
|
|||
expect(attribute.name).to.eq(attributeUpdatedName);
|
||||
expect(attribute.slug).to.eq(attributeUpdatedName);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@ import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
|
|||
import { attributeDetailsUrl } from "../../../fixtures/urlList";
|
||||
import {
|
||||
createAttribute,
|
||||
getAttribute
|
||||
getAttribute,
|
||||
} from "../../../support/api/requests/Attribute";
|
||||
import { deleteAttributesStartsWith } from "../../../support/api/utils/attributes/attributeUtils";
|
||||
import { fillUpAttributeNameAndCode } from "../../../support/pages/attributesPage";
|
||||
|
@ -25,7 +25,7 @@ describe("As an admin I want to delete and update content attribute", () => {
|
|||
cy.clearSessionData().loginUserViaRequest();
|
||||
createAttribute({
|
||||
name: `${startsWith}${faker.datatype.number()}`,
|
||||
type: "PAGE_TYPE"
|
||||
type: "PAGE_TYPE",
|
||||
}).then(attributeResp => {
|
||||
attribute = attributeResp;
|
||||
});
|
||||
|
@ -43,7 +43,7 @@ describe("As an admin I want to delete and update content attribute", () => {
|
|||
.click()
|
||||
.waitForRequestAndCheckIfNoErrors("@AttributeDelete");
|
||||
getAttribute(attribute.id).should("be.null");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -62,6 +62,6 @@ describe("As an admin I want to delete and update content attribute", () => {
|
|||
expect(attributeResp.name).to.eq(attributeUpdatedName);
|
||||
expect(attributeResp.slug).to.eq(attributeUpdatedName);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -3,20 +3,20 @@
|
|||
|
||||
import {
|
||||
getElementByDataTestId,
|
||||
SHARED_ELEMENTS
|
||||
SHARED_ELEMENTS,
|
||||
} from "../../../elements/shared/sharedElements";
|
||||
import { updateAttribute } from "../../../support/api/requests/Attribute";
|
||||
import { createProduct } from "../../../support/api/requests/Product";
|
||||
import {
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../../support/api/utils/products/productsUtils";
|
||||
import filterTests from "../../../support/filterTests";
|
||||
import { enterAttributeAndChanegeIsFilterableInDashbord } from "../../../support/pages/attributesPage";
|
||||
import {
|
||||
enterProductListPage,
|
||||
selectAttributeFilter,
|
||||
showFilters
|
||||
showFilters,
|
||||
} from "../../../support/pages/catalog/products/productsListPage";
|
||||
|
||||
xdescribe("Tests for using attributes in filters", () => {
|
||||
|
@ -29,7 +29,7 @@ xdescribe("Tests for using attributes in filters", () => {
|
|||
deleteProductsStartsWith(startsWith);
|
||||
createTypeAttributeAndCategoryForProduct({
|
||||
name: startsWith,
|
||||
attributeValues: [startsWith]
|
||||
attributeValues: [startsWith],
|
||||
}).then(({ attribute: attributeResp, category, productType }) => {
|
||||
attribute = attributeResp;
|
||||
createProduct({
|
||||
|
@ -37,7 +37,7 @@ xdescribe("Tests for using attributes in filters", () => {
|
|||
attributeValue: startsWith,
|
||||
categoryId: category.id,
|
||||
productTypeId: productType.id,
|
||||
name: startsWith
|
||||
name: startsWith,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -52,15 +52,15 @@ xdescribe("Tests for using attributes in filters", () => {
|
|||
() => {
|
||||
updateAttribute({
|
||||
attributeId: attribute.id,
|
||||
filterableInDashboard: false
|
||||
filterableInDashboard: false,
|
||||
});
|
||||
enterAttributeAndChanegeIsFilterableInDashbord(attribute.id);
|
||||
enterProductListPage();
|
||||
selectAttributeFilter(attribute.slug, attribute.name);
|
||||
cy.contains(SHARED_ELEMENTS.tableRow, attribute.name).should(
|
||||
"be.visible"
|
||||
"be.visible",
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -69,12 +69,12 @@ xdescribe("Tests for using attributes in filters", () => {
|
|||
() => {
|
||||
updateAttribute({
|
||||
attributeId: attribute.id,
|
||||
filterableInDashboard: true
|
||||
filterableInDashboard: true,
|
||||
});
|
||||
enterAttributeAndChanegeIsFilterableInDashbord(attribute.id);
|
||||
enterProductListPage();
|
||||
showFilters();
|
||||
cy.get(getElementByDataTestId(attribute.name)).should("not.exist");
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@ import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
|
|||
import { createChannel } from "../../../support/api/requests/Channels";
|
||||
import {
|
||||
createShippingZone,
|
||||
getShippingZone
|
||||
getShippingZone,
|
||||
} from "../../../support/api/requests/ShippingMethod";
|
||||
import { deleteChannelsStartsWith } from "../../../support/api/utils/channelsUtils";
|
||||
import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils";
|
||||
|
@ -38,7 +38,7 @@ describe("Channels", () => {
|
|||
beforeEach(() => {
|
||||
cy.clearSessionData().loginUserViaRequest(
|
||||
"auth",
|
||||
ONE_PERMISSION_USERS.channel
|
||||
ONE_PERMISSION_USERS.channel,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -83,7 +83,7 @@ describe("Channels", () => {
|
|||
.click()
|
||||
.get(SELECT_CHANNELS_TO_ASSIGN.listOfChannels)
|
||||
.contains(randomChannel);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -101,16 +101,16 @@ describe("Channels", () => {
|
|||
createChannelByView({
|
||||
name: randomChannel,
|
||||
currency,
|
||||
shippingZone: shippingZone.name
|
||||
shippingZone: shippingZone.name,
|
||||
});
|
||||
cy.waitForRequestAndCheckIfNoErrors("@Channel");
|
||||
getShippingZone(shippingZone.id).then(shippingZoneResp => {
|
||||
const assignedChannel = shippingZoneResp.channels.find(
|
||||
channel => channel.name === randomChannel
|
||||
channel => channel.name === randomChannel,
|
||||
);
|
||||
expect(assignedChannel).to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -122,15 +122,15 @@ describe("Channels", () => {
|
|||
isActive: false,
|
||||
name: randomChannel,
|
||||
slug: randomChannel,
|
||||
currencyCode: currency
|
||||
currencyCode: currency,
|
||||
});
|
||||
cy.visit(urlList.channels);
|
||||
cy.expectSkeletonIsVisible();
|
||||
createChannelByView({ name: randomChannel, currency });
|
||||
cy.get(ADD_CHANNEL_FORM_SELECTORS.slugValidationMessage).should(
|
||||
"be.visible"
|
||||
"be.visible",
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -142,12 +142,12 @@ describe("Channels", () => {
|
|||
cy.expectSkeletonIsVisible();
|
||||
createChannelByView({
|
||||
name: randomChannel,
|
||||
currency: "notExistingCurrency"
|
||||
currency: "notExistingCurrency",
|
||||
});
|
||||
cy.get(ADD_CHANNEL_FORM_SELECTORS.currencyValidationMessage).should(
|
||||
"be.visible"
|
||||
"be.visible",
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -159,7 +159,7 @@ describe("Channels", () => {
|
|||
isActive: false,
|
||||
name: randomChannelToDelete,
|
||||
slug: randomChannelToDelete,
|
||||
currencyCode: currency
|
||||
currencyCode: currency,
|
||||
});
|
||||
cy.addAliasToGraphRequest("Channels");
|
||||
cy.visit(urlList.channels);
|
||||
|
@ -176,6 +176,6 @@ describe("Channels", () => {
|
|||
cy.get(CHANNELS_SELECTORS.channelName)
|
||||
.contains(randomChannelToDelete)
|
||||
.should("not.exist");
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -9,18 +9,18 @@ import { ORDERS_SELECTORS } from "../../../elements/orders/orders-selectors";
|
|||
import { urlList } from "../../../fixtures/urlList";
|
||||
import {
|
||||
activateChannel,
|
||||
createChannel
|
||||
createChannel,
|
||||
} from "../../../support/api/requests/Channels";
|
||||
import { createCheckout } from "../../../support/api/requests/Checkout";
|
||||
import { getProductDetails } from "../../../support/api/requests/storeFront/ProductDetails";
|
||||
import {
|
||||
deleteChannelsStartsWith,
|
||||
getDefaultChannel
|
||||
getDefaultChannel,
|
||||
} from "../../../support/api/utils/channelsUtils";
|
||||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../../support/api/utils/products/productsUtils";
|
||||
import { isProductVisible } from "../../../support/api/utils/storeFront/storeFrontProductUtils";
|
||||
|
||||
|
@ -45,7 +45,7 @@ describe("Tests on inactive channel", () => {
|
|||
isActive: false,
|
||||
name: randomName,
|
||||
slug: randomName,
|
||||
currencyCode: currency
|
||||
currencyCode: currency,
|
||||
}).then(channel => {
|
||||
newChannel = channel;
|
||||
});
|
||||
|
@ -76,7 +76,7 @@ describe("Tests on inactive channel", () => {
|
|||
})
|
||||
.get(DRAFT_ORDER_SELECTORS.addProducts)
|
||||
.should("not.exist");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -91,7 +91,7 @@ describe("Tests on inactive channel", () => {
|
|||
channelId: defaultChannel.id,
|
||||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id
|
||||
categoryId: category.id,
|
||||
});
|
||||
})
|
||||
.then(({ variantsList }) => {
|
||||
|
@ -99,16 +99,16 @@ describe("Tests on inactive channel", () => {
|
|||
channelSlug: newChannel.slug,
|
||||
email: "example@example.com",
|
||||
variantsList,
|
||||
address
|
||||
address,
|
||||
});
|
||||
})
|
||||
.then(({ errors }) => {
|
||||
expect(
|
||||
errors[0],
|
||||
"checkout shouldn't be created with error in field channel"
|
||||
"checkout shouldn't be created with error in field channel",
|
||||
).to.have.property("field", "channel");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -123,7 +123,7 @@ describe("Tests on inactive channel", () => {
|
|||
isActive: false,
|
||||
name: randomChannel,
|
||||
slug: randomChannel,
|
||||
currencyCode: currency
|
||||
currencyCode: currency,
|
||||
})
|
||||
.then(channelResp => {
|
||||
channel = channelResp;
|
||||
|
@ -135,7 +135,7 @@ describe("Tests on inactive channel", () => {
|
|||
channelId: channel.id,
|
||||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id
|
||||
categoryId: category.id,
|
||||
});
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
|
@ -146,7 +146,7 @@ describe("Tests on inactive channel", () => {
|
|||
const isVisible = isProductVisible(resp, randomChannel);
|
||||
expect(
|
||||
isVisible,
|
||||
"product with inactive channel shouldn't be visible"
|
||||
"product with inactive channel shouldn't be visible",
|
||||
).to.be.eq(false);
|
||||
activateChannel(channel.id);
|
||||
})
|
||||
|
@ -157,9 +157,9 @@ describe("Tests on inactive channel", () => {
|
|||
const isVisible = isProductVisible(resp, randomChannel);
|
||||
expect(
|
||||
isVisible,
|
||||
"product with active channel should be visible"
|
||||
"product with active channel should be visible",
|
||||
).to.be.eq(true);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
addressCreate,
|
||||
createCustomer,
|
||||
deleteCustomersStartsWith,
|
||||
getCustomer
|
||||
getCustomer,
|
||||
} from "../../support/api/requests/Customer";
|
||||
|
||||
describe("Tests for customer", () => {
|
||||
|
@ -66,16 +66,16 @@ describe("Tests for customer", () => {
|
|||
})
|
||||
.then(customer => {
|
||||
expect(customer.firstName, "Expect correct first name").to.eq(
|
||||
randomName
|
||||
randomName,
|
||||
);
|
||||
expect(customer.lastName, "Expect correct last name").to.eq(
|
||||
randomName
|
||||
randomName,
|
||||
);
|
||||
expect(customer.email, "Expect correct email").to.eq(email);
|
||||
expect(customer.note, "Expect correct note").to.eq(note);
|
||||
cy.expectCorrectFullAddress(customer.addresses[0], address);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -99,7 +99,7 @@ describe("Tests for customer", () => {
|
|||
cy.expectCorrectFullAddress(addresses[0], secondAddress);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -128,7 +128,7 @@ describe("Tests for customer", () => {
|
|||
expect(addresses).to.have.length(1);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -172,7 +172,7 @@ describe("Tests for customer", () => {
|
|||
.then(({ addresses }) => {
|
||||
expect(addresses[0].isDefaultBillingAddress).to.be.true;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -199,12 +199,12 @@ describe("Tests for customer", () => {
|
|||
expect(addresses).to.have.length(2);
|
||||
const addedAddress = addresses.find(
|
||||
element =>
|
||||
element.city.toUpperCase() === secondAddress.city.toUpperCase()
|
||||
element.city.toUpperCase() === secondAddress.city.toUpperCase(),
|
||||
);
|
||||
cy.expectCorrectFullAddress(addedAddress, secondAddress);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -224,7 +224,7 @@ describe("Tests for customer", () => {
|
|||
.wait("@RemoveCustomer");
|
||||
getCustomer(user.id).should("be.null");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -246,7 +246,7 @@ describe("Tests for customer", () => {
|
|||
expect(isActive).to.be.false;
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -273,15 +273,15 @@ describe("Tests for customer", () => {
|
|||
.wait("@UpdateCustomer");
|
||||
getCustomer(user.id).then(user => {
|
||||
expect(user.firstName, "Expect correct first name").to.eq(
|
||||
updatedName
|
||||
updatedName,
|
||||
);
|
||||
expect(user.lastName, "Expect correct last name").to.eq(updatedName);
|
||||
expect(user.email, "Expect correct email").to.eq(
|
||||
`${updatedName}@example.com`
|
||||
`${updatedName}@example.com`,
|
||||
);
|
||||
expect(user.note, "Expect correct note").to.eq(updatedName);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -5,13 +5,13 @@ import faker from "faker";
|
|||
|
||||
import {
|
||||
createMenu as createMenuViaApi,
|
||||
getMenu
|
||||
getMenu,
|
||||
} from "../../support/api/requests/Menu";
|
||||
import { deleteMenusStartsWith } from "../../support/api/utils/navigationUtils";
|
||||
import {
|
||||
createMenu,
|
||||
createNewMenuItem,
|
||||
MENU_ITEM_TYPES
|
||||
MENU_ITEM_TYPES,
|
||||
} from "../../support/pages/navigationPage";
|
||||
|
||||
describe("Tests for menu navigation", () => {
|
||||
|
@ -25,7 +25,7 @@ describe("Tests for menu navigation", () => {
|
|||
cy.clearSessionData().loginUserViaRequest();
|
||||
deleteMenusStartsWith(startsWith);
|
||||
createMenuViaApi(randomName).then(
|
||||
({ menu: menuResp }) => (menu = menuResp)
|
||||
({ menu: menuResp }) => (menu = menuResp),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -46,7 +46,7 @@ describe("Tests for menu navigation", () => {
|
|||
.then(menuResp => {
|
||||
expect(menuResp.name).to.eq(name);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
["category", "collection", "page"].forEach(itemType => {
|
||||
|
@ -61,7 +61,7 @@ describe("Tests for menu navigation", () => {
|
|||
createNewMenuItem({
|
||||
menuId: menu.id,
|
||||
name: itemName,
|
||||
menuItemType: MENU_ITEM_TYPES[itemType]
|
||||
menuItemType: MENU_ITEM_TYPES[itemType],
|
||||
})
|
||||
.then(selectedItemResp => {
|
||||
selectedItem = selectedItemResp;
|
||||
|
@ -73,7 +73,7 @@ describe("Tests for menu navigation", () => {
|
|||
const name = itemType !== "page" ? "name" : "title";
|
||||
expect(itemOfType[name]).to.eq(selectedItem);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -10,12 +10,12 @@ import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements";
|
|||
import {
|
||||
permissionGroupDetails,
|
||||
staffMemberDetailsUrl,
|
||||
urlList
|
||||
urlList,
|
||||
} from "../../fixtures/urlList";
|
||||
import { TEST_ADMIN_USER } from "../../fixtures/users.js";
|
||||
import {
|
||||
createPermissionGroup,
|
||||
getPermissionGroup
|
||||
getPermissionGroup,
|
||||
} from "../../support/api/requests/PermissionGroup.js";
|
||||
import { getStaffMembersStartsWith } from "../../support/api/requests/StaffMembers";
|
||||
import { deletePermissionGroupsStartsWith } from "../../support/api/utils/permissionGroupUtils.js";
|
||||
|
@ -47,7 +47,7 @@ describe("Permissions groups", () => {
|
|||
.get(PERMISSION_GROUP_DETAILS.productsPermissionCheckbox)
|
||||
.click()
|
||||
.get(
|
||||
PERMISSION_GROUP_DETAILS.productsTypesAndAttributesPermissionCheckbox
|
||||
PERMISSION_GROUP_DETAILS.productsTypesAndAttributesPermissionCheckbox,
|
||||
)
|
||||
.click()
|
||||
.get(BUTTON_SELECTORS.confirm)
|
||||
|
@ -59,9 +59,9 @@ describe("Permissions groups", () => {
|
|||
.waitForProgressBarToNotExist();
|
||||
cy.contains(
|
||||
PERMISSION_GROUP_LIST.permissionGroupRow,
|
||||
permissionName
|
||||
permissionName,
|
||||
).should("be.visible");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -77,7 +77,7 @@ describe("Permissions groups", () => {
|
|||
createPermissionGroup({
|
||||
name: permissionName,
|
||||
userIdsArray: `["${staffMember.id}"]`,
|
||||
permissionsArray: "[MANAGE_PRODUCTS]"
|
||||
permissionsArray: "[MANAGE_PRODUCTS]",
|
||||
});
|
||||
cy.visit(urlList.permissionsGroups);
|
||||
cy.contains(PERMISSION_GROUP_LIST.permissionGroupRow, permissionName)
|
||||
|
@ -92,7 +92,7 @@ describe("Permissions groups", () => {
|
|||
cy.get(SHARED_ELEMENTS.header).should("be.visible");
|
||||
cy.contains(permissionName).should("not.exist");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
xit(
|
||||
|
@ -102,7 +102,7 @@ describe("Permissions groups", () => {
|
|||
const permissionName = `${startsWith}${faker.datatype.number()}`;
|
||||
createPermissionGroup({
|
||||
name: permissionName,
|
||||
permissionsArray: "[MANAGE_PRODUCTS]"
|
||||
permissionsArray: "[MANAGE_PRODUCTS]",
|
||||
})
|
||||
.then(({ group }) => {
|
||||
cy.visit(permissionGroupDetails(group.id))
|
||||
|
@ -112,7 +112,7 @@ describe("Permissions groups", () => {
|
|||
.type(TEST_ADMIN_USER.email);
|
||||
cy.contains(
|
||||
PERMISSION_GROUP_DETAILS.userRow,
|
||||
`${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}`
|
||||
`${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}`,
|
||||
)
|
||||
.should("have.length", 1)
|
||||
.find(BUTTON_SELECTORS.checkbox)
|
||||
|
@ -129,7 +129,7 @@ describe("Permissions groups", () => {
|
|||
expect(resp.users).to.have.length(1);
|
||||
expect(resp.users[0].email).to.be.eq(TEST_ADMIN_USER.email);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -145,7 +145,7 @@ describe("Permissions groups", () => {
|
|||
createPermissionGroup({
|
||||
name: permissionName,
|
||||
userIdsArray: `["${staffMember.id}"]`,
|
||||
permissionsArray: "[MANAGE_PRODUCTS]"
|
||||
permissionsArray: "[MANAGE_PRODUCTS]",
|
||||
});
|
||||
})
|
||||
.then(({ group }) => {
|
||||
|
@ -162,6 +162,6 @@ describe("Permissions groups", () => {
|
|||
cy.get(SHARED_ELEMENTS.header).should("be.visible");
|
||||
cy.contains(permissionName).should("not.exist");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -6,22 +6,22 @@ import faker from "faker";
|
|||
import {
|
||||
addShippingMethod,
|
||||
completeCheckout,
|
||||
createCheckout
|
||||
createCheckout,
|
||||
} from "../../../support/api/requests/Checkout";
|
||||
import { getOrder } from "../../../support/api/requests/Order";
|
||||
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
|
||||
import {
|
||||
addAdyenPayment,
|
||||
getShippingMethodIdFromCheckout
|
||||
getShippingMethodIdFromCheckout,
|
||||
} from "../../../support/api/utils/ordersUtils";
|
||||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../../support/api/utils/shippingUtils";
|
||||
|
||||
describe("Adyen payments", () => {
|
||||
|
@ -48,7 +48,7 @@ describe("Adyen payments", () => {
|
|||
clientData: paymentCards.clientData,
|
||||
encryptedExpiryMonth: paymentCards.encryptedExpiryMonth,
|
||||
encryptedExpiryYear: paymentCards.encryptedExpiryYear,
|
||||
encryptedSecurityCode: paymentCards.encryptedSecurityCodes.matches
|
||||
encryptedSecurityCode: paymentCards.encryptedSecurityCodes.matches,
|
||||
};
|
||||
});
|
||||
cy.fixture("addresses")
|
||||
|
@ -62,18 +62,18 @@ describe("Adyen payments", () => {
|
|||
channelId: channelResp.id,
|
||||
name,
|
||||
address,
|
||||
price: 10
|
||||
price: 10,
|
||||
});
|
||||
})
|
||||
.then(
|
||||
({
|
||||
warehouse: warehouseResp,
|
||||
shippingZone: shippingZoneResp,
|
||||
shippingMethod: shippingMethodResp
|
||||
shippingMethod: shippingMethodResp,
|
||||
}) => {
|
||||
warehouse = warehouseResp;
|
||||
shippingMethod = shippingMethodResp;
|
||||
}
|
||||
},
|
||||
);
|
||||
createTypeAttributeAndCategoryForProduct({ name })
|
||||
.then(({ productType, attribute, category }) => {
|
||||
|
@ -83,7 +83,7 @@ describe("Adyen payments", () => {
|
|||
warehouseId: warehouse.id,
|
||||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id
|
||||
categoryId: category.id,
|
||||
});
|
||||
})
|
||||
.then(({ variantsList: variants }) => (variantsList = variants));
|
||||
|
@ -97,12 +97,12 @@ describe("Adyen payments", () => {
|
|||
variantsList,
|
||||
address,
|
||||
billingAddress: address,
|
||||
auth: "token"
|
||||
auth: "token",
|
||||
})
|
||||
.then(({ checkout: checkoutResp }) => {
|
||||
const shippingMethodId = getShippingMethodIdFromCheckout(
|
||||
checkoutResp,
|
||||
shippingMethod.name
|
||||
shippingMethod.name,
|
||||
);
|
||||
checkout = checkoutResp;
|
||||
addShippingMethod(checkout.id, shippingMethodId);
|
||||
|
@ -127,7 +127,7 @@ describe("Adyen payments", () => {
|
|||
.then(order => {
|
||||
expect(order.paymentStatus).to.eq("FULLY_CHARGED");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -145,7 +145,7 @@ describe("Adyen payments", () => {
|
|||
.then(order => {
|
||||
expect(order.paymentStatus).to.eq("FULLY_CHARGED");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -164,7 +164,7 @@ describe("Adyen payments", () => {
|
|||
.then(order => {
|
||||
expect(order.paymentStatus).to.eq("FULLY_CHARGED");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -180,7 +180,7 @@ describe("Adyen payments", () => {
|
|||
completeCheckout(checkout.id, simpleCard).then(({ errors }) => {
|
||||
expect(errors).to.have.length(1);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -194,7 +194,7 @@ describe("Adyen payments", () => {
|
|||
completeCheckout(checkout.id, errorCard).then(({ errors }) => {
|
||||
expect(errors).to.have.length(1);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -208,6 +208,6 @@ describe("Adyen payments", () => {
|
|||
completeCheckout(checkout.id, closeAccount).then(({ errors }) => {
|
||||
expect(errors).to.have.length(1);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -11,15 +11,15 @@ import { createChannel } from "../../../support/api/requests/Channels";
|
|||
import {
|
||||
customerRegistration,
|
||||
deleteCustomersStartsWith,
|
||||
requestPasswordReset
|
||||
requestPasswordReset,
|
||||
} from "../../../support/api/requests/Customer";
|
||||
import {
|
||||
deleteChannelsStartsWith,
|
||||
getDefaultChannel
|
||||
getDefaultChannel,
|
||||
} from "../../../support/api/utils/channelsUtils";
|
||||
import {
|
||||
getMailActivationLinkForUserAndSubject,
|
||||
getMailsForUser
|
||||
getMailsForUser,
|
||||
} from "../../../support/api/utils/users";
|
||||
|
||||
describe("Plugins", () => {
|
||||
|
@ -54,7 +54,7 @@ describe("Plugins", () => {
|
|||
.confirmationMessageShouldDisappear();
|
||||
customerRegistration({
|
||||
email: customerEmail,
|
||||
channel: defaultChannel.slug
|
||||
channel: defaultChannel.slug,
|
||||
})
|
||||
.then(() => {
|
||||
getMailsForUser(customerEmail);
|
||||
|
@ -82,12 +82,12 @@ describe("Plugins", () => {
|
|||
.then(() => {
|
||||
getMailActivationLinkForUserAndSubject(
|
||||
Cypress.env("USER_NAME"),
|
||||
randomName
|
||||
randomName,
|
||||
);
|
||||
})
|
||||
.then(link => {
|
||||
expect(link).to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
import {
|
||||
addShippingMethod,
|
||||
completeCheckout,
|
||||
createCheckout
|
||||
createCheckout,
|
||||
} from "../../../support/api/requests/Checkout";
|
||||
import { getOrder } from "../../../support/api/requests/Order";
|
||||
import { confirmThreeDSecure } from "../../../support/api/requests/stripe";
|
||||
import {
|
||||
addStripePaymentAndGetConfirmationData,
|
||||
getShippingMethodIdFromCheckout
|
||||
getShippingMethodIdFromCheckout,
|
||||
} from "../../../support/api/utils/ordersUtils";
|
||||
import { createProductWithShipping } from "../../../support/api/utils/products/productsUtils";
|
||||
import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils";
|
||||
|
@ -36,7 +36,7 @@ describe("Stripe payments", () => {
|
|||
publicKey: paymentCards.publicApiKey,
|
||||
cvc: 123,
|
||||
expMonth: 10,
|
||||
expYear: 50
|
||||
expYear: 50,
|
||||
};
|
||||
});
|
||||
createProductWithShipping({ name: startsWith }).then(values => {
|
||||
|
@ -55,13 +55,13 @@ describe("Stripe payments", () => {
|
|||
variantsList,
|
||||
address,
|
||||
billingAddress: address,
|
||||
auth: "token"
|
||||
auth: "token",
|
||||
})
|
||||
.then(({ checkout: checkoutResp }) => {
|
||||
checkout = checkoutResp;
|
||||
const shippingMethodId = getShippingMethodIdFromCheckout(
|
||||
checkoutResp,
|
||||
shippingMethod.name
|
||||
shippingMethod.name,
|
||||
);
|
||||
addShippingMethod(checkout.id, shippingMethodId);
|
||||
})
|
||||
|
@ -79,7 +79,7 @@ describe("Stripe payments", () => {
|
|||
addStripePaymentAndGetConfirmationData({
|
||||
card: simpleCard,
|
||||
checkoutId: checkout.id,
|
||||
amount: checkout.totalPrice.gross.amount
|
||||
amount: checkout.totalPrice.gross.amount,
|
||||
})
|
||||
.then(() => {
|
||||
completeCheckout(checkout.id);
|
||||
|
@ -90,7 +90,7 @@ describe("Stripe payments", () => {
|
|||
.then(order => {
|
||||
expect(order.paymentStatus).to.eq("FULLY_CHARGED");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -102,11 +102,11 @@ describe("Stripe payments", () => {
|
|||
addStripePaymentAndGetConfirmationData({
|
||||
card: simpleCard,
|
||||
checkoutId: checkout.id,
|
||||
amount: checkout.totalPrice.gross.amount
|
||||
amount: checkout.totalPrice.gross.amount,
|
||||
}).then(resp => {
|
||||
expect(resp.body.error.code).to.equal("card_declined");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -118,7 +118,7 @@ describe("Stripe payments", () => {
|
|||
addStripePaymentAndGetConfirmationData({
|
||||
card: threeDSecureCard,
|
||||
checkoutId: checkout.id,
|
||||
amount: checkout.totalPrice.gross.amount
|
||||
amount: checkout.totalPrice.gross.amount,
|
||||
})
|
||||
.then(resp => {
|
||||
confirmThreeDSecure(resp.body.next_action.redirect_to_url.url);
|
||||
|
@ -132,7 +132,7 @@ describe("Stripe payments", () => {
|
|||
.then(order => {
|
||||
expect(order.paymentStatus).to.eq("FULLY_CHARGED");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -144,7 +144,7 @@ describe("Stripe payments", () => {
|
|||
addStripePaymentAndGetConfirmationData({
|
||||
card: threeDSecureCard,
|
||||
checkoutId: checkout.id,
|
||||
amount: checkout.totalPrice.gross.amount
|
||||
amount: checkout.totalPrice.gross.amount,
|
||||
})
|
||||
.then(resp => {
|
||||
confirmThreeDSecure(resp.body.next_action.redirect_to_url.url, false);
|
||||
|
@ -155,6 +155,6 @@ describe("Stripe payments", () => {
|
|||
.then(({ order }) => {
|
||||
expect(order).to.not.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -11,7 +11,7 @@ import { createCategory } from "../../../support/api/requests/Category";
|
|||
import {
|
||||
assignAttribute,
|
||||
createTypeProduct,
|
||||
getProductType
|
||||
getProductType,
|
||||
} from "../../../support/api/requests/ProductType";
|
||||
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
|
||||
import { deleteProductsStartsWith } from "../../../support/api/utils/products/productsUtils";
|
||||
|
@ -43,7 +43,7 @@ describe("As an admin I want to manage attributes in product types", () => {
|
|||
createTypeProduct({ name })
|
||||
.then(productType => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productTypeDetailsUrl(productType.id)
|
||||
productTypeDetailsUrl(productType.id),
|
||||
)
|
||||
.get(PRODUCT_TYPE_DETAILS.assignProductAttributeButton)
|
||||
.click()
|
||||
|
@ -56,7 +56,7 @@ describe("As an admin I want to manage attributes in product types", () => {
|
|||
.then(productType => {
|
||||
expect(productType.productAttributes[0].name).to.eq(startsWith);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -68,7 +68,7 @@ describe("As an admin I want to manage attributes in product types", () => {
|
|||
createTypeProduct({ name, hasVariants: false })
|
||||
.then(productType => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productTypeDetailsUrl(productType.id)
|
||||
productTypeDetailsUrl(productType.id),
|
||||
)
|
||||
.get(PRODUCT_TYPE_DETAILS.hasVariantsButton)
|
||||
.click({ force: true })
|
||||
|
@ -82,10 +82,10 @@ describe("As an admin I want to manage attributes in product types", () => {
|
|||
})
|
||||
.then(productType => {
|
||||
expect(productType.assignedVariantAttributes[0].attribute.name).to.eq(
|
||||
startsWith
|
||||
startsWith,
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -102,7 +102,7 @@ describe("As an admin I want to manage attributes in product types", () => {
|
|||
})
|
||||
.then(() => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productTypeDetailsUrl(productType.id)
|
||||
productTypeDetailsUrl(productType.id),
|
||||
)
|
||||
.get(PRODUCT_TYPE_DETAILS.nameInput)
|
||||
.should("be.enabled")
|
||||
|
@ -118,7 +118,7 @@ describe("As an admin I want to manage attributes in product types", () => {
|
|||
.then(productTypeResp => {
|
||||
expect(productTypeResp.assignedVariantAttributes).to.be.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -135,7 +135,7 @@ describe("As an admin I want to manage attributes in product types", () => {
|
|||
})
|
||||
.then(() => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productTypeDetailsUrl(productType.id)
|
||||
productTypeDetailsUrl(productType.id),
|
||||
)
|
||||
.get(PRODUCT_TYPE_DETAILS.nameInput)
|
||||
.should("be.enabled")
|
||||
|
@ -151,7 +151,7 @@ describe("As an admin I want to manage attributes in product types", () => {
|
|||
.then(productTypeResp => {
|
||||
expect(productTypeResp.assignedVariantAttributes).to.be.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -168,7 +168,7 @@ describe("As an admin I want to manage attributes in product types", () => {
|
|||
})
|
||||
.then(() => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productTypeDetailsUrl(productType.id)
|
||||
productTypeDetailsUrl(productType.id),
|
||||
)
|
||||
.get(PRODUCT_TYPE_DETAILS.variantSelectionCheckbox)
|
||||
.click()
|
||||
|
@ -180,12 +180,12 @@ describe("As an admin I want to manage attributes in product types", () => {
|
|||
})
|
||||
.then(productType => {
|
||||
expect(productType.assignedVariantAttributes[0].attribute.name).to.eq(
|
||||
startsWith
|
||||
startsWith,
|
||||
);
|
||||
expect(
|
||||
productType.assignedVariantAttributes[0].variantSelection
|
||||
productType.assignedVariantAttributes[0].variantSelection,
|
||||
).to.eq(true);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -38,7 +38,7 @@ describe("As an admin I want to create product types", () => {
|
|||
expect(productType.isShippingRequired).to.be.false;
|
||||
expect(productType.kind).to.be.eq("NORMAL");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -58,7 +58,7 @@ describe("As an admin I want to create product types", () => {
|
|||
expect(productType.weight.value).to.eq(shippingWeight);
|
||||
expect(productType.kind).to.be.eq("NORMAL");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -76,6 +76,6 @@ describe("As an admin I want to create product types", () => {
|
|||
expect(productType.isShippingRequired).to.be.false;
|
||||
expect(productType.kind).to.be.eq("GIFT_CARD");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -9,13 +9,13 @@ import { createAttribute } from "../../../support/api/requests/Attribute";
|
|||
import { createCategory } from "../../../support/api/requests/Category";
|
||||
import {
|
||||
createTypeProduct,
|
||||
getProductType
|
||||
getProductType,
|
||||
} from "../../../support/api/requests/ProductType";
|
||||
import { getProductDetails } from "../../../support/api/requests/storeFront/ProductDetails";
|
||||
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
|
||||
import {
|
||||
createProductInChannel,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../../support/api/utils/products/productsUtils";
|
||||
|
||||
describe("As an admin I want to manage product types", () => {
|
||||
|
@ -44,7 +44,7 @@ describe("As an admin I want to manage product types", () => {
|
|||
|
||||
createTypeProduct({ name, hasVariants: false }).then(productType => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productTypeDetailsUrl(productType.id)
|
||||
productTypeDetailsUrl(productType.id),
|
||||
)
|
||||
.get(BUTTON_SELECTORS.deleteButton)
|
||||
.click()
|
||||
|
@ -54,7 +54,7 @@ describe("As an admin I want to manage product types", () => {
|
|||
.waitForRequestAndCheckIfNoErrors("@ProductTypeDelete");
|
||||
getProductType(productType.id).should("be.null");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -71,12 +71,12 @@ describe("As an admin I want to manage product types", () => {
|
|||
name,
|
||||
channelId: channel.id,
|
||||
categoryId: category.id,
|
||||
productTypeId: productType.id
|
||||
productTypeId: productType.id,
|
||||
});
|
||||
})
|
||||
.then(({ product }) => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productTypeDetailsUrl(productType.id)
|
||||
productTypeDetailsUrl(productType.id),
|
||||
)
|
||||
.get(BUTTON_SELECTORS.deleteButton)
|
||||
.click()
|
||||
|
@ -93,6 +93,6 @@ describe("As an admin I want to manage product types", () => {
|
|||
.its("body.data.product")
|
||||
.should("be.null");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -9,14 +9,14 @@ import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
|
|||
import { createChannel } from "../../../support/api/requests/Channels";
|
||||
import {
|
||||
addChannelToShippingMethod,
|
||||
addChannelToShippingZone
|
||||
addChannelToShippingZone,
|
||||
} from "../../../support/api/requests/ShippingMethod";
|
||||
import * as channelsUtils from "../../../support/api/utils/channelsUtils";
|
||||
import * as shippingUtils from "../../../support/api/utils/shippingUtils";
|
||||
import { selectChannelInHeader } from "../../../support/pages/channelsPage";
|
||||
import {
|
||||
enterAndSelectShippings,
|
||||
enterShippingZone
|
||||
enterShippingZone,
|
||||
} from "../../../support/pages/shippingZones";
|
||||
|
||||
describe("As a staff user I want have different shipping method prices for each channel", () => {
|
||||
|
@ -46,7 +46,7 @@ describe("As a staff user I want have different shipping method prices for each
|
|||
|
||||
createChannel({
|
||||
name: shippingName,
|
||||
currencyCode: createdChannelCurrency
|
||||
currencyCode: createdChannelCurrency,
|
||||
}).then(channel => {
|
||||
createdChannel = channel;
|
||||
});
|
||||
|
@ -57,7 +57,7 @@ describe("As a staff user I want have different shipping method prices for each
|
|||
({
|
||||
shippingMethod: shippingMethodResp,
|
||||
shippingZone: shippingZoneResp,
|
||||
defaultChannel: defaultChannelResp
|
||||
defaultChannel: defaultChannelResp,
|
||||
}) => {
|
||||
shippingZone = shippingZoneResp;
|
||||
shippingMethod = shippingMethodResp;
|
||||
|
@ -68,16 +68,16 @@ describe("As a staff user I want have different shipping method prices for each
|
|||
addChannelToShippingMethod(
|
||||
shippingMethod.id,
|
||||
createdChannel.id,
|
||||
createdChannelPrice
|
||||
createdChannelPrice,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(() => {
|
||||
cy.clearSessionData().loginUserViaRequest(
|
||||
"auth",
|
||||
ONE_PERMISSION_USERS.shipping
|
||||
ONE_PERMISSION_USERS.shipping,
|
||||
);
|
||||
enterAndSelectShippings(shippingZone.id, enterShippingZone);
|
||||
selectChannelInHeader(defaultChannel.name);
|
||||
|
@ -85,7 +85,7 @@ describe("As a staff user I want have different shipping method prices for each
|
|||
.get(SHARED_ELEMENTS.skeleton)
|
||||
.should("not.exist")
|
||||
.getTextFromElement(
|
||||
SHIPPING_ZONE_DETAILS.shippingRatePriceTableCell
|
||||
SHIPPING_ZONE_DETAILS.shippingRatePriceTableCell,
|
||||
)
|
||||
.then(text => {
|
||||
const value = defaultChannelPrice
|
||||
|
@ -102,7 +102,7 @@ describe("As a staff user I want have different shipping method prices for each
|
|||
})
|
||||
.then(() => {
|
||||
cy.getTextFromElement(
|
||||
SHIPPING_ZONE_DETAILS.shippingRatePriceTableCell
|
||||
SHIPPING_ZONE_DETAILS.shippingRatePriceTableCell,
|
||||
);
|
||||
})
|
||||
.then(text => {
|
||||
|
@ -115,6 +115,6 @@ describe("As a staff user I want have different shipping method prices for each
|
|||
expect(text).to.includes(createdChannelCurrency);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -16,7 +16,7 @@ import { isShippingAvailableInCheckout } from "../../../support/api/utils/storeF
|
|||
import {
|
||||
createShippingRate,
|
||||
createShippingZone,
|
||||
rateOptions
|
||||
rateOptions,
|
||||
} from "../../../support/pages/shippingMethodPage";
|
||||
|
||||
describe("As a staff user I want to create shipping zone and rate", () => {
|
||||
|
@ -53,14 +53,14 @@ describe("As a staff user I want to create shipping zone and rate", () => {
|
|||
.then(warehouseResp => {
|
||||
warehouse = warehouseResp;
|
||||
productsUtils.createTypeAttributeAndCategoryForProduct({
|
||||
name: startsWith
|
||||
name: startsWith,
|
||||
});
|
||||
})
|
||||
.then(
|
||||
({
|
||||
productType: productTypeResp,
|
||||
category: categoryResp,
|
||||
attribute: attributeResp
|
||||
attribute: attributeResp,
|
||||
}) => {
|
||||
attribute = attributeResp;
|
||||
category = categoryResp;
|
||||
|
@ -74,9 +74,9 @@ describe("As a staff user I want to create shipping zone and rate", () => {
|
|||
categoryId: categoryResp.id,
|
||||
warehouseId: warehouse.id,
|
||||
quantityInWarehouse: 10,
|
||||
price
|
||||
price,
|
||||
});
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(({ variantsList: variantsListResp, product }) => {
|
||||
variantsList = variantsListResp;
|
||||
|
@ -89,7 +89,7 @@ describe("As a staff user I want to create shipping zone and rate", () => {
|
|||
quantityInWarehouse: 10,
|
||||
channelId: defaultChannel.id,
|
||||
price: secondVariantPrice,
|
||||
weight: 10
|
||||
weight: 10,
|
||||
});
|
||||
})
|
||||
.then(variantsListResp => {
|
||||
|
@ -108,28 +108,28 @@ describe("As a staff user I want to create shipping zone and rate", () => {
|
|||
const shippingName = `${startsWith}${faker.datatype.number()}`;
|
||||
cy.clearSessionData().loginUserViaRequest(
|
||||
"auth",
|
||||
ONE_PERMISSION_USERS.shipping
|
||||
ONE_PERMISSION_USERS.shipping,
|
||||
);
|
||||
cy.visit(urlList.shippingMethods).expectSkeletonIsVisible();
|
||||
createShippingZone(
|
||||
shippingName,
|
||||
warehouse.name,
|
||||
address.countryFullName,
|
||||
defaultChannel.name
|
||||
defaultChannel.name,
|
||||
);
|
||||
createShippingRate({
|
||||
rateName: shippingName,
|
||||
price,
|
||||
priceLimits: { min: price, max: 100 },
|
||||
rateOption: rateOptions.PRICE_OPTION,
|
||||
deliveryTime
|
||||
deliveryTime,
|
||||
});
|
||||
createWaitingForCaptureOrder({
|
||||
channelSlug: defaultChannel.slug,
|
||||
email: "test@example.com",
|
||||
variantsList,
|
||||
address,
|
||||
shippingMethodName: shippingName
|
||||
shippingMethodName: shippingName,
|
||||
})
|
||||
.then(({ order }) => {
|
||||
expect(order.id).to.be.ok;
|
||||
|
@ -138,17 +138,17 @@ describe("As a staff user I want to create shipping zone and rate", () => {
|
|||
email: "test@example.com",
|
||||
variantsList: secondVariantsList,
|
||||
address,
|
||||
auth: "token"
|
||||
auth: "token",
|
||||
});
|
||||
})
|
||||
.then(({ checkout }) => {
|
||||
const isShippingAvailable = isShippingAvailableInCheckout(
|
||||
checkout,
|
||||
shippingName
|
||||
shippingName,
|
||||
);
|
||||
expect(isShippingAvailable).to.be.false;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -158,28 +158,28 @@ describe("As a staff user I want to create shipping zone and rate", () => {
|
|||
const shippingName = `${startsWith}${faker.datatype.number()}`;
|
||||
cy.clearSessionData().loginUserViaRequest(
|
||||
"auth",
|
||||
ONE_PERMISSION_USERS.shipping
|
||||
ONE_PERMISSION_USERS.shipping,
|
||||
);
|
||||
cy.visit(urlList.shippingMethods).expectSkeletonIsVisible();
|
||||
createShippingZone(
|
||||
shippingName,
|
||||
warehouse.name,
|
||||
address.countryFullName,
|
||||
defaultChannel.name
|
||||
defaultChannel.name,
|
||||
);
|
||||
createShippingRate({
|
||||
rateName: shippingName,
|
||||
price,
|
||||
rateOption: rateOptions.WEIGHT_OPTION,
|
||||
deliveryTime,
|
||||
weightLimits: { min: 5, max: 10 }
|
||||
weightLimits: { min: 5, max: 10 },
|
||||
});
|
||||
createWaitingForCaptureOrder({
|
||||
channelSlug: defaultChannel.slug,
|
||||
email: "test@example.com",
|
||||
variantsList: secondVariantsList,
|
||||
address,
|
||||
shippingMethodName: shippingName
|
||||
shippingMethodName: shippingName,
|
||||
})
|
||||
.then(({ order }) => {
|
||||
expect(order.id).to.be.ok;
|
||||
|
@ -188,16 +188,16 @@ describe("As a staff user I want to create shipping zone and rate", () => {
|
|||
email: "test@example.com",
|
||||
variantsList,
|
||||
address,
|
||||
auth: "token"
|
||||
auth: "token",
|
||||
});
|
||||
})
|
||||
.then(({ checkout }) => {
|
||||
const isShippingAvailable = isShippingAvailableInCheckout(
|
||||
checkout,
|
||||
shippingName
|
||||
shippingName,
|
||||
);
|
||||
expect(isShippingAvailable).to.be.false;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -8,13 +8,13 @@ import {
|
|||
addChannelToShippingMethod,
|
||||
createShippingRate,
|
||||
createShippingZone,
|
||||
getShippingZone
|
||||
getShippingZone,
|
||||
} from "../../../support/api/requests/ShippingMethod";
|
||||
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
|
||||
import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils";
|
||||
import {
|
||||
fillUpShippingRate,
|
||||
saveRateAfterUpdate
|
||||
saveRateAfterUpdate,
|
||||
} from "../../../support/pages/shippingMethodPage";
|
||||
|
||||
describe("As a user I should be able to update and delete shipping method", () => {
|
||||
|
@ -46,7 +46,7 @@ describe("As a user I should be able to update and delete shipping method", () =
|
|||
cy.clearSessionData().loginUserViaRequest();
|
||||
createShippingRate({
|
||||
name: rateName,
|
||||
shippingZone: shippingZone.id
|
||||
shippingZone: shippingZone.id,
|
||||
}).then(({ shippingMethod: shippingResp }) => {
|
||||
shippingMethod = shippingResp;
|
||||
addChannelToShippingMethod(shippingMethod.id, defaultChannel.id, 1);
|
||||
|
@ -64,22 +64,22 @@ describe("As a user I should be able to update and delete shipping method", () =
|
|||
fillUpShippingRate({
|
||||
rateName: updatedRateName,
|
||||
price,
|
||||
deliveryTime
|
||||
deliveryTime,
|
||||
});
|
||||
saveRateAfterUpdate();
|
||||
getShippingZone(shippingZone.id).then(({ shippingMethods }) => {
|
||||
expect(shippingMethods).to.have.length(1);
|
||||
expect(shippingMethods[0].minimumDeliveryDays).to.be.eq(
|
||||
deliveryTime.min
|
||||
deliveryTime.min,
|
||||
);
|
||||
expect(shippingMethods[0].maximumDeliveryDays).to.be.eq(
|
||||
deliveryTime.max
|
||||
deliveryTime.max,
|
||||
);
|
||||
expect(shippingMethods[0].channelListings[0].price.amount).to.be.eq(
|
||||
price
|
||||
price,
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -87,14 +87,14 @@ describe("As a user I should be able to update and delete shipping method", () =
|
|||
{ tags: ["@shipping", "@allEnv", "@stable"] },
|
||||
() => {
|
||||
cy.visit(
|
||||
shippingRateUrl(shippingZone.id, shippingMethod.id)
|
||||
shippingRateUrl(shippingZone.id, shippingMethod.id),
|
||||
).deleteElementWithReqAlias("DeleteShippingRate");
|
||||
getShippingZone(shippingZone.id).then(({ shippingMethods }) => {
|
||||
const deletedShipping = shippingMethods.find(
|
||||
element => element.id === shippingMethod.id
|
||||
element => element.id === shippingMethod.id,
|
||||
);
|
||||
expect(deletedShipping).to.be.not.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@ import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
|
|||
import { shippingZoneDetailsUrl } from "../../../fixtures/urlList";
|
||||
import {
|
||||
createShippingZone,
|
||||
getShippingZone
|
||||
getShippingZone,
|
||||
} from "../../../support/api/requests/ShippingMethod";
|
||||
import { createWarehouse } from "../../../support/api/requests/Warehouse";
|
||||
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
|
||||
|
@ -58,7 +58,7 @@ describe("As a user I should be able to update and delete shipping zone", () =>
|
|||
channelName: defaultChannel.name,
|
||||
country: "Poland",
|
||||
shippingName: updatedName,
|
||||
warehouseName: name
|
||||
warehouseName: name,
|
||||
});
|
||||
getShippingZone(shippingZone.id).then(shippingZone => {
|
||||
expect(shippingZone.channels).to.have.length(0);
|
||||
|
@ -67,7 +67,7 @@ describe("As a user I should be able to update and delete shipping zone", () =>
|
|||
expect(shippingZone.warehouses[0].name).to.eq(name);
|
||||
expect(shippingZone.countries.find(el => el.code === "PL")).to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -75,10 +75,10 @@ describe("As a user I should be able to update and delete shipping zone", () =>
|
|||
{ tags: ["@shipping", "@allEnv"] },
|
||||
() => {
|
||||
cy.visit(
|
||||
shippingZoneDetailsUrl(shippingZone.id)
|
||||
shippingZoneDetailsUrl(shippingZone.id),
|
||||
).deleteElementWithReqAlias("DeleteShippingZone");
|
||||
getShippingZone(shippingZone.id).should("be.null");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -99,8 +99,8 @@ describe("As a user I should be able to update and delete shipping zone", () =>
|
|||
.wait("@BulkDeleteShippingZone");
|
||||
getShippingZone(shippingZone.id).should("be.null");
|
||||
getShippingZone(secondShippingZone.id).should("be.null");
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -12,13 +12,13 @@ import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
|
|||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../../support/api/utils/products/productsUtils";
|
||||
import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils";
|
||||
import { isShippingAvailableInCheckout } from "../../../support/api/utils/storeFront/checkoutUtils";
|
||||
import {
|
||||
createRateWithPostalCode,
|
||||
postalCodesOptions
|
||||
postalCodesOptions,
|
||||
} from "../../../support/pages/shippingMethodPage";
|
||||
|
||||
describe("As a user I want to create shipping method with postal codes", () => {
|
||||
|
@ -47,19 +47,19 @@ describe("As a user I want to create shipping method with postal codes", () => {
|
|||
.then(
|
||||
({
|
||||
usAddress: usAddressResp,
|
||||
secondUsAddress: secondUsAddressResp
|
||||
secondUsAddress: secondUsAddressResp,
|
||||
}) => {
|
||||
usAddress = usAddressResp;
|
||||
secondUsAddress = secondUsAddressResp;
|
||||
createShippingZone(name, "US", defaultChannel.id);
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(shippingZoneResp => {
|
||||
shippingZone = shippingZoneResp;
|
||||
createWarehouse({
|
||||
name,
|
||||
shippingZone: shippingZone.id,
|
||||
address: usAddress
|
||||
address: usAddress,
|
||||
});
|
||||
})
|
||||
.then(warehouseResp => {
|
||||
|
@ -73,7 +73,7 @@ describe("As a user I want to create shipping method with postal codes", () => {
|
|||
warehouseId: warehouse.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
productTypeId: productType.id
|
||||
productTypeId: productType.id,
|
||||
});
|
||||
})
|
||||
.then(({ variantsList: variantsListResp }) => {
|
||||
|
@ -98,15 +98,15 @@ describe("As a user I want to create shipping method with postal codes", () => {
|
|||
price,
|
||||
postalCodeOption: postalCodesOptions.INCLUDE_OPTION,
|
||||
maxPostalCode: usAddress.postalCode,
|
||||
minPostalCode: usAddress.postalCode
|
||||
minPostalCode: usAddress.postalCode,
|
||||
});
|
||||
isShippingAvailableForAddress(usAddress, rateName).then(
|
||||
isAvailable => expect(isAvailable).to.be.true
|
||||
isAvailable => expect(isAvailable).to.be.true,
|
||||
);
|
||||
isShippingAvailableForAddress(secondUsAddress, rateName).then(
|
||||
isAvailable => expect(isAvailable).to.be.false
|
||||
isAvailable => expect(isAvailable).to.be.false,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -120,15 +120,15 @@ describe("As a user I want to create shipping method with postal codes", () => {
|
|||
price,
|
||||
postalCodeOption: postalCodesOptions.EXCLUDE_OPTION,
|
||||
maxPostalCode: usAddress.postalCode,
|
||||
minPostalCode: usAddress.postalCode
|
||||
minPostalCode: usAddress.postalCode,
|
||||
});
|
||||
isShippingAvailableForAddress(usAddress, rateName).then(
|
||||
isAvailable => expect(isAvailable).to.be.false
|
||||
isAvailable => expect(isAvailable).to.be.false,
|
||||
);
|
||||
isShippingAvailableForAddress(secondUsAddress, rateName).then(
|
||||
isAvailable => expect(isAvailable).to.be.true
|
||||
isAvailable => expect(isAvailable).to.be.true,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
function isShippingAvailableForAddress(address, rateName) {
|
||||
|
@ -136,9 +136,9 @@ describe("As a user I want to create shipping method with postal codes", () => {
|
|||
address,
|
||||
channelSlug: defaultChannel.slug,
|
||||
email: "example@example.com",
|
||||
variantsList
|
||||
variantsList,
|
||||
}).then(({ checkout }) =>
|
||||
isShippingAvailableInCheckout(checkout, rateName)
|
||||
isShippingAvailableInCheckout(checkout, rateName),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -12,13 +12,13 @@ import { getDefaultChannel } from "../../../../support/api/utils/channelsUtils";
|
|||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../../../support/api/utils/products/productsUtils";
|
||||
import { deleteShippingStartsWith } from "../../../../support/api/utils/shippingUtils";
|
||||
import { isShippingAvailableInCheckout } from "../../../../support/api/utils/storeFront/checkoutUtils";
|
||||
import {
|
||||
createShippingRate,
|
||||
rateOptions
|
||||
rateOptions,
|
||||
} from "../../../../support/pages/shippingMethodPage";
|
||||
|
||||
describe("As a staff user I want to manage shipping weights", () => {
|
||||
|
@ -52,7 +52,7 @@ describe("As a staff user I want to manage shipping weights", () => {
|
|||
createWarehouse({
|
||||
name,
|
||||
shippingZone: shippingZone.id,
|
||||
address: usAddress
|
||||
address: usAddress,
|
||||
});
|
||||
})
|
||||
.then(warehouseResp => {
|
||||
|
@ -67,7 +67,7 @@ describe("As a staff user I want to manage shipping weights", () => {
|
|||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
productTypeId: productType.id,
|
||||
weight: 10
|
||||
weight: 10,
|
||||
});
|
||||
})
|
||||
.then(({ variantsList: variantsListResp }) => {
|
||||
|
@ -93,21 +93,21 @@ describe("As a staff user I want to manage shipping weights", () => {
|
|||
rateOption: rateOptions.WEIGHT_OPTION,
|
||||
weightLimits: {
|
||||
max: 11,
|
||||
min: 10
|
||||
}
|
||||
min: 10,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
createCheckout({
|
||||
address: usAddress,
|
||||
channelSlug: defaultChannel.slug,
|
||||
email: "example@example.com",
|
||||
variantsList
|
||||
variantsList,
|
||||
});
|
||||
})
|
||||
.then(({ checkout }) => {
|
||||
expect(isShippingAvailableInCheckout(checkout, rateName)).to.be.true;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -122,20 +122,20 @@ describe("As a staff user I want to manage shipping weights", () => {
|
|||
rateOption: rateOptions.WEIGHT_OPTION,
|
||||
weightLimits: {
|
||||
max: 101,
|
||||
min: 100
|
||||
}
|
||||
min: 100,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
createCheckout({
|
||||
address: usAddress,
|
||||
channelSlug: defaultChannel.slug,
|
||||
email: "example@example.com",
|
||||
variantsList
|
||||
variantsList,
|
||||
});
|
||||
})
|
||||
.then(({ checkout }) => {
|
||||
expect(isShippingAvailableInCheckout(checkout, rateName)).to.be.false;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@ import { SHIPPING_RATE_DETAILS } from "../../../../elements/shipping/shipping-ra
|
|||
import { shippingRateUrl, urlList } from "../../../../fixtures/urlList";
|
||||
import {
|
||||
createShippingRate as createShippingRateViaApi,
|
||||
createShippingZone
|
||||
createShippingZone,
|
||||
} from "../../../../support/api/requests/ShippingMethod";
|
||||
import { updateShopWeightUnit } from "../../../../support/api/requests/ShopSettings";
|
||||
import { getDefaultChannel } from "../../../../support/api/utils/channelsUtils";
|
||||
|
@ -64,7 +64,7 @@ xdescribe("As a staff user I want to change shop default weight unit", () => {
|
|||
shippingZone: shippingZone.id,
|
||||
type: "WEIGHT",
|
||||
maxWeight: maxWeightInKg,
|
||||
minWeight: minWeightInKg
|
||||
minWeight: minWeightInKg,
|
||||
})
|
||||
.then(({ shippingMethod: shippingMethodResp }) => {
|
||||
shippingMethod = shippingMethodResp;
|
||||
|
@ -80,10 +80,10 @@ xdescribe("As a staff user I want to change shop default weight unit", () => {
|
|||
})
|
||||
.then(responseArray => {
|
||||
const shippingMethods = responseArray.find(
|
||||
element => element.data.shippingZone
|
||||
element => element.data.shippingZone,
|
||||
).data.shippingZone.shippingMethods;
|
||||
const rate = shippingMethods.find(
|
||||
element => element.id === shippingMethod.id
|
||||
element => element.id === shippingMethod.id,
|
||||
);
|
||||
cy.waitForProgressBarToNotBeVisible();
|
||||
expect(rate.minimumOrderWeight.unit).to.eq("G");
|
||||
|
@ -99,6 +99,6 @@ xdescribe("As a staff user I want to change shop default weight unit", () => {
|
|||
.then(actualMaxWeight => {
|
||||
expect(parseInt(actualMaxWeight, 10)).to.eq(maxWeightInG);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@ import { SITE_SETTINGS_DETAILS } from "../../elements/siteSettings/site-settings
|
|||
import { urlList } from "../../fixtures/urlList";
|
||||
import {
|
||||
getShopInfo,
|
||||
updateShopAddress
|
||||
updateShopAddress,
|
||||
} from "../../support/api/requests/ShopSettings";
|
||||
|
||||
xdescribe("Tests for site settings", () => {
|
||||
|
@ -56,7 +56,7 @@ xdescribe("Tests for site settings", () => {
|
|||
getShopInfo().then(shopInfo => {
|
||||
expect(shopInfo.description).to.eq(description);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -71,6 +71,6 @@ xdescribe("Tests for site settings", () => {
|
|||
expect(companyAddress.companyName).to.eq(address.companyName);
|
||||
cy.expectCorrectBasicAddress(companyAddress, address);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -10,12 +10,12 @@ import { WAREHOUSES_LIST } from "../../../elements/warehouses/warehouses-list";
|
|||
import {
|
||||
shippingZoneDetailsUrl,
|
||||
urlList,
|
||||
warehouseDetailsUrl
|
||||
warehouseDetailsUrl,
|
||||
} from "../../../fixtures/urlList";
|
||||
import { createShippingZone } from "../../../support/api/requests/ShippingMethod";
|
||||
import {
|
||||
createWarehouse as createWarehouseViaApi,
|
||||
getWarehouse
|
||||
getWarehouse,
|
||||
} from "../../../support/api/requests/Warehouse";
|
||||
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
|
||||
import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils";
|
||||
|
@ -75,7 +75,7 @@ describe("Warehouse settings", () => {
|
|||
defaultChannel = channelResp;
|
||||
createWarehouseViaApi({
|
||||
name,
|
||||
address: usAddress
|
||||
address: usAddress,
|
||||
});
|
||||
})
|
||||
.then(warehouseResp => {
|
||||
|
@ -87,7 +87,7 @@ describe("Warehouse settings", () => {
|
|||
cy.visit(shippingZoneDetailsUrl(shippingZone.id))
|
||||
.fillAutocompleteSelect(
|
||||
SHIPPING_ZONE_DETAILS.warehouseSelector,
|
||||
warehouse.name
|
||||
warehouse.name,
|
||||
)
|
||||
.addAliasToGraphRequest("UpdateShippingZone")
|
||||
.get(BUTTON_SELECTORS.confirm)
|
||||
|
@ -97,17 +97,17 @@ describe("Warehouse settings", () => {
|
|||
})
|
||||
.then(warehouseResp => {
|
||||
expect(warehouseResp.shippingZones.edges[0].node.id).to.be.eq(
|
||||
shippingZone.id
|
||||
shippingZone.id,
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it("should delete warehouse", { tags: ["@warehouse", "@allEnv"] }, () => {
|
||||
const name = `${startsWith}${faker.datatype.number()}`;
|
||||
createWarehouseViaApi({
|
||||
name,
|
||||
address: usAddress
|
||||
address: usAddress,
|
||||
}).then(warehouse => {
|
||||
cy.visit(warehouseDetailsUrl(warehouse.id))
|
||||
.get(BUTTON_SELECTORS.deleteButton)
|
||||
|
@ -139,7 +139,7 @@ describe("Warehouse settings", () => {
|
|||
createWarehouseViaApi({
|
||||
name,
|
||||
shippingZone: shippingZone.id,
|
||||
address: usAddress
|
||||
address: usAddress,
|
||||
});
|
||||
})
|
||||
.then(warehouseResp => {
|
||||
|
@ -156,7 +156,7 @@ describe("Warehouse settings", () => {
|
|||
.then(warehouseResp => {
|
||||
expect(warehouseResp.shippingZones.edges).to.be.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it("should update warehouse", { tags: ["@warehouse", "@allEnv"] }, () => {
|
||||
|
@ -166,7 +166,7 @@ describe("Warehouse settings", () => {
|
|||
|
||||
createWarehouseViaApi({
|
||||
name,
|
||||
address: usAddress
|
||||
address: usAddress,
|
||||
})
|
||||
.then(warehouseResp => {
|
||||
warehouse = warehouseResp;
|
||||
|
|
|
@ -9,7 +9,7 @@ import { customerDetailsUrl } from "../fixtures/urlList";
|
|||
import {
|
||||
confirmAccount,
|
||||
customerRegistration,
|
||||
deleteCustomersStartsWith
|
||||
deleteCustomersStartsWith,
|
||||
} from "../support/api/requests/Customer";
|
||||
import { getDefaultChannel } from "../support/api/utils/channelsUtils";
|
||||
import { getMailActivationLinkForUser } from "../support/api/utils/users";
|
||||
|
@ -42,7 +42,7 @@ describe("Tests for customer registration", () => {
|
|||
.then(() => {
|
||||
cy.loginUserViaRequest("token", {
|
||||
email,
|
||||
password: Cypress.env("USER_PASSWORD")
|
||||
password: Cypress.env("USER_PASSWORD"),
|
||||
}).its("body.data.tokenCreate");
|
||||
})
|
||||
.then(({ errors, token }) => {
|
||||
|
@ -58,12 +58,12 @@ describe("Tests for customer registration", () => {
|
|||
const duplicatedEmail = Cypress.env("USER_NAME");
|
||||
customerRegistration({
|
||||
duplicatedEmail,
|
||||
channel: defaultChannel.slug
|
||||
channel: defaultChannel.slug,
|
||||
}).then(({ user, errors }) => {
|
||||
expect(errors[0].field).to.eq("email");
|
||||
expect(user).to.not.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -83,7 +83,7 @@ describe("Tests for customer registration", () => {
|
|||
.clearSessionData()
|
||||
.loginUserViaRequest("token", {
|
||||
email,
|
||||
password: Cypress.env("USER_PASSWORD")
|
||||
password: Cypress.env("USER_PASSWORD"),
|
||||
})
|
||||
.its("body.data.tokenCreate");
|
||||
})
|
||||
|
@ -91,6 +91,6 @@ describe("Tests for customer registration", () => {
|
|||
expect(errors.length).to.eq(0);
|
||||
expect(token).to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -14,16 +14,16 @@ import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
|
|||
import {
|
||||
createSaleInChannel,
|
||||
createSaleInChannelWithProduct,
|
||||
deleteSalesStartsWith
|
||||
deleteSalesStartsWith,
|
||||
} from "../../support/api/utils/discounts/salesUtils";
|
||||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../support/api/utils/shippingUtils";
|
||||
|
||||
describe("Create sale with assigned products", () => {
|
||||
|
@ -48,7 +48,7 @@ describe("Create sale with assigned products", () => {
|
|||
name: startsWith,
|
||||
type: "FIXED",
|
||||
value: saleValue,
|
||||
channelId: channel.id
|
||||
channelId: channel.id,
|
||||
});
|
||||
})
|
||||
.then(saleResp => (sale = saleResp));
|
||||
|
@ -58,7 +58,7 @@ describe("Create sale with assigned products", () => {
|
|||
createShipping({
|
||||
channelId: channel.id,
|
||||
address,
|
||||
name: startsWith
|
||||
name: startsWith,
|
||||
});
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
|
@ -66,7 +66,7 @@ describe("Create sale with assigned products", () => {
|
|||
});
|
||||
createTypeAttributeAndCategoryForProduct({
|
||||
name: startsWith,
|
||||
attributeValues: ["value1", "value2"]
|
||||
attributeValues: ["value1", "value2"],
|
||||
}).then(({ attribute, category, productType }) => {
|
||||
productData = {
|
||||
attributeId: attribute.id,
|
||||
|
@ -74,7 +74,7 @@ describe("Create sale with assigned products", () => {
|
|||
productTypeId: productType.id,
|
||||
channelId: channel.id,
|
||||
warehouseId: warehouse.id,
|
||||
price: 30
|
||||
price: 30,
|
||||
};
|
||||
});
|
||||
});
|
||||
|
@ -114,26 +114,26 @@ describe("Create sale with assigned products", () => {
|
|||
channelSlug: channel.slug,
|
||||
email: "example@example.com",
|
||||
address,
|
||||
variantsList: variantOnSale.concat(variantNotOnSale)
|
||||
variantsList: variantOnSale.concat(variantNotOnSale),
|
||||
});
|
||||
})
|
||||
.then(({ checkout }) => {
|
||||
const variantRespNotOnSale = checkout.lines.find(
|
||||
element => element.variant.id === variantNotOnSale[0].id
|
||||
element => element.variant.id === variantNotOnSale[0].id,
|
||||
).variant;
|
||||
const variantRespOnSale = checkout.lines.find(
|
||||
element => element.variant.id === variantOnSale[0].id
|
||||
element => element.variant.id === variantOnSale[0].id,
|
||||
).variant;
|
||||
expect(variantRespNotOnSale.pricing.onSale).to.be.false;
|
||||
expect(variantRespOnSale.pricing.onSale).to.be.true;
|
||||
expect(variantRespNotOnSale.pricing.price.gross.amount).to.eq(
|
||||
productData.price
|
||||
productData.price,
|
||||
);
|
||||
expect(variantRespOnSale.pricing.price.gross.amount).to.eq(
|
||||
productData.price - saleValue
|
||||
productData.price - saleValue,
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it("should delete sale", { tags: ["@sales", "@allEnv", "@stable"] }, () => {
|
||||
|
@ -150,7 +150,7 @@ describe("Create sale with assigned products", () => {
|
|||
type: "FIXED",
|
||||
value: saleValue,
|
||||
channelId: channel.id,
|
||||
variants
|
||||
variants,
|
||||
});
|
||||
})
|
||||
.then(saleResp => {
|
||||
|
@ -160,7 +160,7 @@ describe("Create sale with assigned products", () => {
|
|||
.then(variantResp => {
|
||||
expect(variantResp.pricing.onSale).to.be.true;
|
||||
expect(variantResp.pricing.price.gross.amount).to.eq(
|
||||
productData.price - saleValue
|
||||
productData.price - saleValue,
|
||||
);
|
||||
cy.visit(saleDetailsUrl(saleToDelete.id))
|
||||
.addAliasToGraphRequest("SaleDelete")
|
||||
|
@ -192,7 +192,7 @@ describe("Create sale with assigned products", () => {
|
|||
variants = variantsList;
|
||||
updateSale({
|
||||
saleId: sale.id,
|
||||
variants
|
||||
variants,
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
|
@ -201,7 +201,7 @@ describe("Create sale with assigned products", () => {
|
|||
.then(variantResp => {
|
||||
expect(variantResp.pricing.onSale).to.be.true;
|
||||
expect(variantResp.pricing.price.gross.amount).to.eq(
|
||||
productData.price - saleValue
|
||||
productData.price - saleValue,
|
||||
);
|
||||
cy.visit(saleDetailsUrl(sale.id))
|
||||
.get(SALES_SELECTORS.variantsTab)
|
||||
|
@ -216,9 +216,9 @@ describe("Create sale with assigned products", () => {
|
|||
.then(variantResp => {
|
||||
expect(variantResp.pricing.onSale).to.be.false;
|
||||
expect(variantResp.pricing.price.gross.amount).to.eq(
|
||||
productData.price
|
||||
productData.price,
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -11,14 +11,14 @@ import { deleteSalesStartsWith } from "../../support/api/utils/discounts/salesUt
|
|||
import * as productsUtils from "../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../support/api/utils/shippingUtils";
|
||||
import { getProductPrice } from "../../support/api/utils/storeFront/storeFrontProductUtils";
|
||||
import {
|
||||
assignProducts,
|
||||
createSale,
|
||||
createSaleWithNewProduct,
|
||||
discountOptions
|
||||
discountOptions,
|
||||
} from "../../support/pages/discounts/salesPage";
|
||||
|
||||
xdescribe("Sales discounts for products", () => {
|
||||
|
@ -44,14 +44,14 @@ xdescribe("Sales discounts for products", () => {
|
|||
({
|
||||
productType: productTypeResp,
|
||||
attribute: attributeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
productType = productTypeResp;
|
||||
attribute = attributeResp;
|
||||
category = categoryResp;
|
||||
|
||||
channelsUtils.getDefaultChannel();
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(channel => {
|
||||
defaultChannel = channel;
|
||||
|
@ -62,7 +62,7 @@ xdescribe("Sales discounts for products", () => {
|
|||
channelId: defaultChannel.id,
|
||||
name,
|
||||
address: addresses.plAddress,
|
||||
price: 100
|
||||
price: 100,
|
||||
});
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
|
@ -91,12 +91,12 @@ xdescribe("Sales discounts for products", () => {
|
|||
categoryId: category.id,
|
||||
price: productPrice,
|
||||
discountOption: discountOptions.PERCENTAGE,
|
||||
discountValue
|
||||
discountValue,
|
||||
}).then(price => {
|
||||
const expectedPrice = (productPrice * discountValue) / 100;
|
||||
expect(expectedPrice).to.be.eq(price);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -116,12 +116,12 @@ xdescribe("Sales discounts for products", () => {
|
|||
categoryId: category.id,
|
||||
price: productPrice,
|
||||
discountOption: discountOptions.FIXED,
|
||||
discountValue
|
||||
discountValue,
|
||||
}).then(price => {
|
||||
const expectedPrice = productPrice - discountValue;
|
||||
expect(expectedPrice).to.be.eq(price);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -135,7 +135,7 @@ xdescribe("Sales discounts for products", () => {
|
|||
const productPrice = 100;
|
||||
|
||||
createChannel({ name: saleName }).then(
|
||||
channelResp => (channel = channelResp)
|
||||
channelResp => (channel = channelResp),
|
||||
);
|
||||
productsUtils
|
||||
.createProductInChannel({
|
||||
|
@ -145,13 +145,13 @@ xdescribe("Sales discounts for products", () => {
|
|||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
price: productPrice
|
||||
price: productPrice,
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
product = productResp;
|
||||
updateChannelInProduct({
|
||||
productId: product.id,
|
||||
channelId: channel.id
|
||||
channelId: channel.id,
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
|
@ -165,12 +165,12 @@ xdescribe("Sales discounts for products", () => {
|
|||
createSale({
|
||||
saleName,
|
||||
channelName: channel.name,
|
||||
discountValue
|
||||
discountValue,
|
||||
});
|
||||
assignProducts(product.name);
|
||||
getProductPrice(product.id, defaultChannel.slug);
|
||||
})
|
||||
.then(price => expect(price).to.equal(productPrice));
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -8,11 +8,11 @@ import { deleteSalesStartsWith } from "../../support/api/utils/discounts/salesUt
|
|||
import * as productsUtils from "../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../support/api/utils/shippingUtils";
|
||||
import {
|
||||
createSaleWithNewVariant,
|
||||
discountOptions
|
||||
discountOptions,
|
||||
} from "../../support/pages/discounts/salesPage";
|
||||
|
||||
xdescribe("Sales discounts for variant", () => {
|
||||
|
@ -37,14 +37,14 @@ xdescribe("Sales discounts for variant", () => {
|
|||
({
|
||||
productType: productTypeResp,
|
||||
attribute: attributeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
productType = productTypeResp;
|
||||
attribute = attributeResp;
|
||||
category = categoryResp;
|
||||
|
||||
channelsUtils.getDefaultChannel();
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(channel => {
|
||||
defaultChannel = channel;
|
||||
|
@ -55,7 +55,7 @@ xdescribe("Sales discounts for variant", () => {
|
|||
channelId: defaultChannel.id,
|
||||
name,
|
||||
address: addresses.plAddress,
|
||||
price: 100
|
||||
price: 100,
|
||||
});
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
|
@ -84,13 +84,13 @@ xdescribe("Sales discounts for variant", () => {
|
|||
categoryId: category.id,
|
||||
price: productPrice,
|
||||
discountOption: discountOptions.PERCENTAGE,
|
||||
discountValue
|
||||
discountValue,
|
||||
}).then(({ pricing }) => {
|
||||
const priceInResponse = pricing.price.gross.amount;
|
||||
const expectedPrice = (productPrice * discountValue) / 100;
|
||||
expect(expectedPrice).to.be.eq(priceInResponse);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -110,12 +110,12 @@ xdescribe("Sales discounts for variant", () => {
|
|||
categoryId: category.id,
|
||||
price: productPrice,
|
||||
discountOption: discountOptions.FIXED,
|
||||
discountValue
|
||||
discountValue,
|
||||
}).then(({ pricing }) => {
|
||||
const priceInResponse = pricing.price.gross.amount;
|
||||
const expectedPrice = productPrice - discountValue;
|
||||
expect(expectedPrice).to.be.eq(priceInResponse);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -10,14 +10,14 @@ import * as channelsUtils from "../../../support/api/utils/channelsUtils";
|
|||
import { deleteVouchersStartsWith } from "../../../support/api/utils/discounts/vouchersUtils";
|
||||
import {
|
||||
addPayment,
|
||||
createCheckoutWithVoucher
|
||||
createCheckoutWithVoucher,
|
||||
} from "../../../support/api/utils/ordersUtils";
|
||||
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
|
||||
import filterTests from "../../../support/filterTests";
|
||||
import {
|
||||
createVoucher,
|
||||
discountOptions,
|
||||
loginAndCreateCheckoutForVoucherWithDiscount
|
||||
loginAndCreateCheckoutForVoucherWithDiscount,
|
||||
} from "../../../support/pages/discounts/vouchersPage";
|
||||
|
||||
describe("As an admin I want to create voucher", () => {
|
||||
|
@ -44,14 +44,14 @@ describe("As an admin I want to create voucher", () => {
|
|||
variantsList: variantsResp,
|
||||
defaultChannel: channel,
|
||||
shippingMethod: shippingMethodResp,
|
||||
address: addressResp
|
||||
address: addressResp,
|
||||
}) => {
|
||||
variants = variantsResp;
|
||||
defaultChannel = channel;
|
||||
shippingMethod = shippingMethodResp;
|
||||
address = addressResp;
|
||||
createChannel({ name });
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(channel => {
|
||||
createdChannel = channel;
|
||||
|
@ -60,7 +60,7 @@ describe("As an admin I want to create voucher", () => {
|
|||
variantsList: variants,
|
||||
address,
|
||||
shippingMethodName: shippingMethod.name,
|
||||
auth: "token"
|
||||
auth: "token",
|
||||
};
|
||||
});
|
||||
});
|
||||
|
@ -79,11 +79,11 @@ describe("As an admin I want to create voucher", () => {
|
|||
voucherValue,
|
||||
voucherCode,
|
||||
channelName: defaultChannel.name,
|
||||
dataForCheckout
|
||||
dataForCheckout,
|
||||
})
|
||||
.then(({ addPromoCodeResp, checkout: checkoutResp }) => {
|
||||
expect(addPromoCodeResp.checkout.totalPrice.gross.amount).to.be.eq(
|
||||
expectedAmount
|
||||
expectedAmount,
|
||||
);
|
||||
dataForCheckout.voucherCode = voucherCode;
|
||||
checkout = checkoutResp;
|
||||
|
@ -95,7 +95,7 @@ describe("As an admin I want to create voucher", () => {
|
|||
.then(({ order }) => {
|
||||
expect(order.id).to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -113,11 +113,11 @@ describe("As an admin I want to create voucher", () => {
|
|||
voucherValue,
|
||||
voucherCode,
|
||||
channelName: defaultChannel.name,
|
||||
dataForCheckout
|
||||
dataForCheckout,
|
||||
})
|
||||
.then(({ addPromoCodeResp, checkout: checkoutResp }) => {
|
||||
expect(addPromoCodeResp.checkout.totalPrice.gross.amount).to.be.eq(
|
||||
expectedAmount
|
||||
expectedAmount,
|
||||
);
|
||||
dataForCheckout.voucherCode = voucherCode;
|
||||
checkout = checkoutResp;
|
||||
|
@ -129,7 +129,7 @@ describe("As an admin I want to create voucher", () => {
|
|||
.then(({ order }) => {
|
||||
expect(order.id).to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -144,11 +144,11 @@ describe("As an admin I want to create voucher", () => {
|
|||
discount: discountOptions.SHIPPING,
|
||||
voucherCode,
|
||||
channelName: defaultChannel.name,
|
||||
dataForCheckout
|
||||
dataForCheckout,
|
||||
})
|
||||
.then(({ addPromoCodeResp, checkout: checkoutResp }) => {
|
||||
expect(addPromoCodeResp.checkout.totalPrice.gross.amount).to.be.eq(
|
||||
expectedAmount
|
||||
expectedAmount,
|
||||
);
|
||||
dataForCheckout.voucherCode = voucherCode;
|
||||
checkout = checkoutResp;
|
||||
|
@ -160,7 +160,7 @@ describe("As an admin I want to create voucher", () => {
|
|||
.then(({ order }) => {
|
||||
expect(order.id).to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -178,15 +178,15 @@ describe("As an admin I want to create voucher", () => {
|
|||
voucherCode: randomName,
|
||||
voucherValue,
|
||||
discountOption: discountOptions.PERCENTAGE,
|
||||
channelName: createdChannel.name
|
||||
channelName: createdChannel.name,
|
||||
});
|
||||
dataForCheckout.voucherCode = randomName;
|
||||
createCheckoutWithVoucher(dataForCheckout).then(
|
||||
({ addPromoCodeResp }) => {
|
||||
const errorField = addPromoCodeResp.errors[0].field;
|
||||
expect(errorField).to.be.eq("promoCode");
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -8,12 +8,12 @@ import * as channelsUtils from "../../../support/api/utils/channelsUtils";
|
|||
import { deleteVouchersStartsWith } from "../../../support/api/utils/discounts/vouchersUtils";
|
||||
import {
|
||||
addPayment,
|
||||
createCheckoutWithVoucher
|
||||
createCheckoutWithVoucher,
|
||||
} from "../../../support/api/utils/ordersUtils";
|
||||
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
discountOptions,
|
||||
loginAndCreateCheckoutForVoucherWithDiscount
|
||||
loginAndCreateCheckoutForVoucherWithDiscount,
|
||||
} from "../../../support/pages/discounts/vouchersPage";
|
||||
|
||||
describe("As an admin I want to create voucher", () => {
|
||||
|
@ -39,7 +39,7 @@ describe("As an admin I want to create voucher", () => {
|
|||
variantsList: variantsResp,
|
||||
defaultChannel: channel,
|
||||
shippingMethod: shippingMethodResp,
|
||||
address: addressResp
|
||||
address: addressResp,
|
||||
}) => {
|
||||
variants = variantsResp;
|
||||
defaultChannel = channel;
|
||||
|
@ -50,9 +50,9 @@ describe("As an admin I want to create voucher", () => {
|
|||
variantsList: variants,
|
||||
address,
|
||||
shippingMethodName: shippingMethod.name,
|
||||
auth: "token"
|
||||
auth: "token",
|
||||
};
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -71,7 +71,7 @@ describe("As an admin I want to create voucher", () => {
|
|||
voucherCode,
|
||||
channelName: defaultChannel.name,
|
||||
dataForCheckout,
|
||||
usageLimit
|
||||
usageLimit,
|
||||
})
|
||||
.then(({ checkout, addPromoCodeResp }) => {
|
||||
expect(addPromoCodeResp.errors).to.be.empty;
|
||||
|
@ -88,10 +88,10 @@ describe("As an admin I want to create voucher", () => {
|
|||
.then(({ addPromoCodeResp }) => {
|
||||
const errorField = addPromoCodeResp.errors[0].field;
|
||||
expect(errorField, "error in promo code should occur").to.be.eq(
|
||||
"promoCode"
|
||||
"promoCode",
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -109,7 +109,7 @@ describe("As an admin I want to create voucher", () => {
|
|||
voucherCode,
|
||||
channelName: defaultChannel.name,
|
||||
dataForCheckout,
|
||||
applyOnePerCustomer: true
|
||||
applyOnePerCustomer: true,
|
||||
})
|
||||
.then(({ checkout, addPromoCodeResp }) => {
|
||||
expect(addPromoCodeResp.errors).to.be.empty;
|
||||
|
@ -127,7 +127,7 @@ describe("As an admin I want to create voucher", () => {
|
|||
.then(({ addPromoCodeResp }) => {
|
||||
const errorField = addPromoCodeResp.errors[0].field;
|
||||
expect(errorField, "error in promo code should occur").to.be.eq(
|
||||
"promoCode"
|
||||
"promoCode",
|
||||
);
|
||||
|
||||
// Create new checkout as other not logged in customer - voucher should be available for other customer
|
||||
|
@ -140,7 +140,7 @@ describe("As an admin I want to create voucher", () => {
|
|||
const errorField = addPromoCodeResp.errors;
|
||||
expect(errorField, "No errors when adding promo code").to.be.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
xit(
|
||||
|
@ -158,7 +158,7 @@ describe("As an admin I want to create voucher", () => {
|
|||
voucherCode,
|
||||
channelName: defaultChannel.name,
|
||||
dataForCheckout,
|
||||
onlyStaff: true
|
||||
onlyStaff: true,
|
||||
})
|
||||
.then(({ checkout, addPromoCodeResp }) => {
|
||||
expect(addPromoCodeResp.errors).to.be.empty;
|
||||
|
@ -176,10 +176,10 @@ describe("As an admin I want to create voucher", () => {
|
|||
.then(({ addPromoCodeResp }) => {
|
||||
const errorField = addPromoCodeResp.errors[0].field;
|
||||
expect(errorField, "error in promo code should occur").to.be.eq(
|
||||
"promoCode"
|
||||
"promoCode",
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
xit(
|
||||
|
@ -197,14 +197,14 @@ describe("As an admin I want to create voucher", () => {
|
|||
voucherCode,
|
||||
channelName: defaultChannel.name,
|
||||
dataForCheckout,
|
||||
minOrderValue
|
||||
minOrderValue,
|
||||
})
|
||||
.then(({ addPromoCodeResp }) => {
|
||||
const errorField = addPromoCodeResp.errors[0].field;
|
||||
dataForCheckout.voucherCode = voucherCode;
|
||||
|
||||
expect(errorField, "error in promo code should occur").to.be.eq(
|
||||
"promoCode"
|
||||
"promoCode",
|
||||
);
|
||||
dataForCheckout.productQuantity = 2;
|
||||
createCheckoutWithVoucher(dataForCheckout);
|
||||
|
@ -213,7 +213,7 @@ describe("As an admin I want to create voucher", () => {
|
|||
const errorField = addPromoCodeResp.errors;
|
||||
expect(errorField, "No errors when adding promo code").to.be.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
xit("should create voucher with min product quantity. TC: SALEOR_1911", () => {
|
||||
|
@ -228,14 +228,14 @@ describe("As an admin I want to create voucher", () => {
|
|||
voucherCode,
|
||||
channelName: defaultChannel.name,
|
||||
dataForCheckout,
|
||||
minAmountOfItems
|
||||
minAmountOfItems,
|
||||
})
|
||||
.then(({ addPromoCodeResp }) => {
|
||||
const errorField = addPromoCodeResp.errors[0].field;
|
||||
dataForCheckout.voucherCode = voucherCode;
|
||||
|
||||
expect(errorField, "error in promo code should occur").to.be.eq(
|
||||
"promoCode"
|
||||
"promoCode",
|
||||
);
|
||||
dataForCheckout.productQuantity = 2;
|
||||
createCheckoutWithVoucher(dataForCheckout);
|
||||
|
|
|
@ -8,7 +8,7 @@ import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
|
|||
import { voucherDetailsUrl } from "../../../fixtures/urlList";
|
||||
import {
|
||||
createVoucherInChannel,
|
||||
deleteVouchersStartsWith
|
||||
deleteVouchersStartsWith,
|
||||
} from "../../../support/api/utils/discounts/vouchersUtils";
|
||||
import { createCheckoutWithVoucher } from "../../../support/api/utils/ordersUtils";
|
||||
import * as productsUtils from "../../../support/api/utils/products/productsUtils";
|
||||
|
@ -36,7 +36,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
defaultChannel: channel,
|
||||
shippingMethod: shippingMethodResp,
|
||||
address: addressResp,
|
||||
product: productResp
|
||||
product: productResp,
|
||||
}) => {
|
||||
defaultChannel = channel;
|
||||
product = productResp;
|
||||
|
@ -46,9 +46,9 @@ describe("As an admin I want to update vouchers", () => {
|
|||
variantsList: variantsResp,
|
||||
address: addressResp,
|
||||
shippingMethodName: shippingMethodResp.name,
|
||||
auth: "token"
|
||||
auth: "token",
|
||||
};
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -66,7 +66,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
name,
|
||||
productId: product.id,
|
||||
channelId: defaultChannel.id,
|
||||
value: voucherValue
|
||||
value: voucherValue,
|
||||
})
|
||||
.then(voucherResp => {
|
||||
voucher = voucherResp;
|
||||
|
@ -85,7 +85,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
const errorField = addPromoCodeResp.errors[0].field;
|
||||
expect(errorField).to.be.eq("promoCode");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -107,7 +107,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
name,
|
||||
productId: product.id,
|
||||
channelId: defaultChannel.id,
|
||||
value: voucherValue
|
||||
value: voucherValue,
|
||||
})
|
||||
.then(voucherResp => {
|
||||
voucher = voucherResp;
|
||||
|
@ -128,7 +128,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
const amount = addPromoCodeResp.checkout.totalPrice.gross.amount;
|
||||
expect(amount).to.be.eq(expectedOrderAmount);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -149,7 +149,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
name,
|
||||
productId: product.id,
|
||||
channelId: defaultChannel.id,
|
||||
value: voucherValue
|
||||
value: voucherValue,
|
||||
})
|
||||
.then(voucherResp => {
|
||||
voucher = voucherResp;
|
||||
|
@ -168,7 +168,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
.then(({ addPromoCodeResp }) => {
|
||||
expect(addPromoCodeResp.errors).to.be.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -189,7 +189,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
name,
|
||||
productId: product.id,
|
||||
channelId: defaultChannel.id,
|
||||
value: voucherValue
|
||||
value: voucherValue,
|
||||
})
|
||||
.then(voucherResp => {
|
||||
voucher = voucherResp;
|
||||
|
@ -198,7 +198,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
voucherId: voucher.id,
|
||||
endDate: todayDate,
|
||||
endTime: formatTime(today),
|
||||
hasEndDate: true
|
||||
hasEndDate: true,
|
||||
});
|
||||
dataForCheckout.voucherCode = voucher.code;
|
||||
createCheckoutWithVoucher(dataForCheckout);
|
||||
|
@ -209,7 +209,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
setVoucherDate({
|
||||
voucherId: voucher.id,
|
||||
endDate: tomorrowDate,
|
||||
endTime: formatTime(tomorrow)
|
||||
endTime: formatTime(tomorrow),
|
||||
});
|
||||
dataForCheckout.voucherCode = voucher.code;
|
||||
createCheckoutWithVoucher(dataForCheckout);
|
||||
|
@ -217,7 +217,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
.then(({ addPromoCodeResp }) => {
|
||||
expect(addPromoCodeResp.errors).to.be.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -236,7 +236,7 @@ describe("As an admin I want to update vouchers", () => {
|
|||
channelId: defaultChannel.id,
|
||||
value: voucherValue,
|
||||
type: "SHIPPING",
|
||||
country: "US"
|
||||
country: "US",
|
||||
})
|
||||
.then(voucherResp => {
|
||||
voucher = voucherResp;
|
||||
|
@ -268,6 +268,6 @@ describe("As an admin I want to update vouchers", () => {
|
|||
const errorField = addPromoCodeResp.errors[0].field;
|
||||
expect(errorField).to.be.eq("promoCode");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -12,9 +12,9 @@ describe("Displaying welcome message on home page", () => {
|
|||
() => {
|
||||
cy.loginUserViaRequest().visit(urlList.homePage);
|
||||
expectWelcomeMessageIncludes(
|
||||
`${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}`
|
||||
`${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}`,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -23,7 +23,7 @@ describe("Displaying welcome message on home page", () => {
|
|||
() => {
|
||||
cy.loginUserViaRequest("auth", USER_WITHOUT_NAME).visit(urlList.homePage);
|
||||
expectWelcomeMessageIncludes(`${USER_WITHOUT_NAME.email}`);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -35,8 +35,8 @@ describe("Displaying welcome message on home page", () => {
|
|||
.waitForProgressBarToNotExist()
|
||||
.reload(true);
|
||||
expectWelcomeMessageIncludes(
|
||||
`${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}`
|
||||
`${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}`,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -9,7 +9,7 @@ import { createCustomer } from "../../support/api/requests/Customer";
|
|||
import * as homePageUtils from "../../support/api/utils/homePageUtils";
|
||||
import {
|
||||
createReadyToFulfillOrder,
|
||||
createWaitingForCaptureOrder
|
||||
createWaitingForCaptureOrder,
|
||||
} from "../../support/api/utils/ordersUtils";
|
||||
import * as productsUtils from "../../support/api/utils/products/productsUtils";
|
||||
import filterTests from "../../support/filterTests";
|
||||
|
@ -19,7 +19,7 @@ import {
|
|||
getOrdersReadyToFulfillRegex,
|
||||
getProductsOutOfStockRegex,
|
||||
getSalesAmountRegex,
|
||||
getTodaysOrdersRegex
|
||||
getTodaysOrdersRegex,
|
||||
} from "../../support/pages/homePage";
|
||||
|
||||
describe("As an admin I want to see correct information on dashboard home page", () => {
|
||||
|
@ -52,7 +52,7 @@ describe("As an admin I want to see correct information on dashboard home page",
|
|||
name: randomName,
|
||||
productPrice,
|
||||
shippingPrice,
|
||||
newChannel: true
|
||||
newChannel: true,
|
||||
})
|
||||
.then(resp => {
|
||||
createdVariants = resp.variantsList;
|
||||
|
@ -65,7 +65,7 @@ describe("As an admin I want to see correct information on dashboard home page",
|
|||
productType = resp.productType;
|
||||
|
||||
createCustomer(randomEmail, randomName, address).then(
|
||||
customerResp => (customer = customerResp)
|
||||
customerResp => (customer = customerResp),
|
||||
);
|
||||
|
||||
homePageUtils
|
||||
|
@ -73,7 +73,7 @@ describe("As an admin I want to see correct information on dashboard home page",
|
|||
.then(ordersReadyToFulfillBefore => {
|
||||
ordersReadyToFulfillRegexp = getOrdersReadyToFulfillRegex(
|
||||
ordersReadyToFulfillBefore,
|
||||
1
|
||||
1,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -82,7 +82,7 @@ describe("As an admin I want to see correct information on dashboard home page",
|
|||
.then(ordersReadyForCaptureBefore => {
|
||||
ordersReadyForCaptureRegexp = getOrdersReadyForCaptureRegex(
|
||||
ordersReadyForCaptureBefore,
|
||||
1
|
||||
1,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -91,14 +91,14 @@ describe("As an admin I want to see correct information on dashboard home page",
|
|||
.then(productsOutOfStockBefore => {
|
||||
productsOutOfStockRegexp = getProductsOutOfStockRegex(
|
||||
productsOutOfStockBefore,
|
||||
1
|
||||
1,
|
||||
);
|
||||
});
|
||||
|
||||
homePageUtils.getSalesAmount(defaultChannel.slug).then(salesAmount => {
|
||||
salesAmountRegexp = getSalesAmountRegex(
|
||||
salesAmount,
|
||||
productPrice * 2 + shippingPrice
|
||||
productPrice * 2 + shippingPrice,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -114,7 +114,7 @@ describe("As an admin I want to see correct information on dashboard home page",
|
|||
shippingMethodId: shippingMethod.id,
|
||||
channelId: defaultChannel.id,
|
||||
variantsList: createdVariants,
|
||||
address
|
||||
address,
|
||||
});
|
||||
|
||||
createWaitingForCaptureOrder({
|
||||
|
@ -122,7 +122,7 @@ describe("As an admin I want to see correct information on dashboard home page",
|
|||
email: randomEmail,
|
||||
variantsList: createdVariants,
|
||||
shippingMethodName: shippingMethod.name,
|
||||
address
|
||||
address,
|
||||
});
|
||||
|
||||
const productOutOfStockRandomName =
|
||||
|
@ -136,7 +136,7 @@ describe("As an admin I want to see correct information on dashboard home page",
|
|||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
price: productPrice
|
||||
price: productPrice,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -154,19 +154,19 @@ describe("As an admin I want to see correct information on dashboard home page",
|
|||
cy.contains(HOMEPAGE_SELECTORS.orders, ordersRegexp).should("be.visible");
|
||||
cy.contains(
|
||||
HOMEPAGE_SELECTORS.ordersReadyToFulfill,
|
||||
ordersReadyToFulfillRegexp
|
||||
ordersReadyToFulfillRegexp,
|
||||
).should("be.visible");
|
||||
cy.contains(
|
||||
HOMEPAGE_SELECTORS.paymentsWaitingForCapture,
|
||||
ordersReadyForCaptureRegexp
|
||||
ordersReadyForCaptureRegexp,
|
||||
).should("be.visible");
|
||||
cy.contains(HOMEPAGE_SELECTORS.sales, salesAmountRegexp).should(
|
||||
"be.visible"
|
||||
"be.visible",
|
||||
);
|
||||
cy.contains(
|
||||
HOMEPAGE_SELECTORS.productsOutOfStock,
|
||||
productsOutOfStockRegexp
|
||||
productsOutOfStockRegexp,
|
||||
).should("be.visible");
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -17,7 +17,7 @@ describe("User authorization", () => {
|
|||
cy.visit(urlList.homePage);
|
||||
cy.loginUser();
|
||||
cy.get(LOGIN_SELECTORS.welcomePage).should("be.visible");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -33,7 +33,7 @@ describe("User authorization", () => {
|
|||
.click()
|
||||
.get(LOGIN_SELECTORS.warningCredentialMessage)
|
||||
.should("be.visible");
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -49,6 +49,6 @@ describe("User authorization", () => {
|
|||
.click()
|
||||
.get(LOGIN_SELECTORS.emailAddressInput)
|
||||
.should("be.visible");
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@ import faker from "faker";
|
|||
|
||||
import {
|
||||
updateMetadata,
|
||||
updatePrivateMetadata
|
||||
updatePrivateMetadata,
|
||||
} from "../support/api/requests/Metadata";
|
||||
import { createDraftOrder, getOrder } from "../support/api/requests/Order";
|
||||
import { getProductMetadata } from "../support/api/requests/storeFront/ProductDetails";
|
||||
|
@ -12,7 +12,7 @@ import { getDefaultChannel } from "../support/api/utils/channelsUtils";
|
|||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../support/api/utils/products/productsUtils";
|
||||
|
||||
describe("Test for metadata", () => {
|
||||
|
@ -36,7 +36,7 @@ describe("Test for metadata", () => {
|
|||
categoryId: category.id,
|
||||
channelId: channel.id,
|
||||
name,
|
||||
productTypeId: productType.id
|
||||
productTypeId: productType.id,
|
||||
});
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
|
@ -56,7 +56,7 @@ describe("Test for metadata", () => {
|
|||
productId: product.id,
|
||||
channelSlug: channel.slug,
|
||||
auth: "auth",
|
||||
withPrivateMetadata: true
|
||||
withPrivateMetadata: true,
|
||||
}).its("data");
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
|
@ -68,7 +68,7 @@ describe("Test for metadata", () => {
|
|||
productId: product.id,
|
||||
channelSlug: channel.slug,
|
||||
auth: "token",
|
||||
withPrivateMetadata: true
|
||||
withPrivateMetadata: true,
|
||||
});
|
||||
})
|
||||
.then(({ errors }) => {
|
||||
|
@ -77,14 +77,14 @@ describe("Test for metadata", () => {
|
|||
productId: product.id,
|
||||
channelSlug: channel.slug,
|
||||
auth: "token",
|
||||
withPrivateMetadata: false
|
||||
withPrivateMetadata: false,
|
||||
}).its("data");
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
expect(productResp.metadata[0].key).to.eq(metadata.key);
|
||||
expect(productResp.metadata[0].value).to.eq(metadata.value);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
it(
|
||||
"should create metadata for order",
|
||||
|
@ -107,6 +107,6 @@ describe("Test for metadata", () => {
|
|||
expect(orderResp.privateMetadata[0].key).to.eq(metadata.key);
|
||||
expect(orderResp.privateMetadata[0].value).to.eq(metadata.value);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import {
|
||||
APP_MENU_SELECTORS,
|
||||
appCommonSelector,
|
||||
LEFT_MENU_SELECTORS
|
||||
LEFT_MENU_SELECTORS,
|
||||
} from "../elements/account/left-menu/left-menu-selectors";
|
||||
import { PERMISSIONS_OPTIONS } from "../fixtures/permissionsUsers";
|
||||
import * as permissionsSteps from "../support/pages/permissionsPage";
|
||||
|
@ -28,13 +28,13 @@ describe("As a staff user I want to navigate through shop using different permis
|
|||
appPermissions = {
|
||||
parent: {
|
||||
parentMenuSelector: LEFT_MENU_SELECTORS.appSection,
|
||||
parentSelectors: [APP_MENU_SELECTORS]
|
||||
parentSelectors: [APP_MENU_SELECTORS],
|
||||
},
|
||||
permissionSelectors: [APP_MENU_SELECTORS.app]
|
||||
permissionSelectors: [APP_MENU_SELECTORS.app],
|
||||
};
|
||||
} else {
|
||||
appPermissions = {
|
||||
permissionSelectors: [LEFT_MENU_SELECTORS.app]
|
||||
permissionSelectors: [LEFT_MENU_SELECTORS.app],
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -53,14 +53,14 @@ describe("As a staff user I want to navigate through shop using different permis
|
|||
const permissions = permissionOption.permissions;
|
||||
cy.clearSessionData();
|
||||
permissionsSteps.navigateToAllAvailablePageAndCheckIfDisplayed(
|
||||
permissionOption
|
||||
permissionOption,
|
||||
);
|
||||
permissionsSteps
|
||||
.getDisplayedSelectors()
|
||||
.then(selectors => {
|
||||
permissionsSteps.expectAllSelectorsPermitted(
|
||||
permissions,
|
||||
selectors
|
||||
selectors,
|
||||
);
|
||||
})
|
||||
.then(() => {
|
||||
|
@ -73,19 +73,19 @@ describe("As a staff user I want to navigate through shop using different permis
|
|||
.click()
|
||||
.then(() => {
|
||||
permissionsSteps.getDisplayedSelectors(
|
||||
permission.parent.parentSelectors
|
||||
permission.parent.parentSelectors,
|
||||
);
|
||||
})
|
||||
.then(parentSelectors => {
|
||||
permissionsSteps.expectAllSelectorsPermitted(
|
||||
permissions,
|
||||
parentSelectors
|
||||
parentSelectors,
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -97,8 +97,8 @@ describe("As a staff user I want to navigate through shop using different permis
|
|||
const permissionOption = permissionsOptions.all;
|
||||
cy.clearSessionData();
|
||||
permissionsSteps.navigateToAllAvailablePageAndCheckIfDisplayed(
|
||||
permissionOption
|
||||
permissionOption,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@ import { createChannel } from "../../support/api/requests/Channels";
|
|||
import * as channelsUtils from "../../support/api/utils/channelsUtils";
|
||||
import {
|
||||
selectChannelInHeader,
|
||||
selectChannelInPicker
|
||||
selectChannelInPicker,
|
||||
} from "../../support/pages/channelsPage";
|
||||
|
||||
xdescribe("Channels in draft orders", () => {
|
||||
|
@ -49,7 +49,7 @@ xdescribe("Channels in draft orders", () => {
|
|||
cy.getTextFromElement(HEADER_SELECTORS.channelSelect).then(
|
||||
channelInHeader => {
|
||||
channelName = channelInHeader;
|
||||
}
|
||||
},
|
||||
);
|
||||
cy.visit(urlList.orders)
|
||||
.get(ORDERS_SELECTORS.createOrder)
|
||||
|
@ -57,15 +57,15 @@ xdescribe("Channels in draft orders", () => {
|
|||
cy.getTextFromElement(CHANNEL_FORM_SELECTORS.channelSelect).then(
|
||||
selectedChannelName => {
|
||||
expect(channelName).to.contains(selectedChannelName);
|
||||
}
|
||||
},
|
||||
);
|
||||
cy.get(CHANNEL_FORM_SELECTORS.confirmButton).click();
|
||||
cy.getTextFromElement(DRAFT_ORDER_SELECTORS.salesChannel).then(
|
||||
channelNameInDraftOrder => {
|
||||
expect(channelName).to.contains(channelNameInDraftOrder);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -79,15 +79,15 @@ xdescribe("Channels in draft orders", () => {
|
|||
cy.getTextFromElement(CHANNEL_FORM_SELECTORS.channelSelect).then(
|
||||
channelInSelect => {
|
||||
expect(channelInSelect).to.be.eq(otherChannel.name);
|
||||
}
|
||||
},
|
||||
);
|
||||
cy.get(CHANNEL_FORM_SELECTORS.confirmButton).click();
|
||||
cy.getTextFromElement(DRAFT_ORDER_SELECTORS.salesChannel).then(
|
||||
channelInDraftOrder => {
|
||||
expect(channelInDraftOrder).to.be.eq(otherChannel.name);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -101,14 +101,14 @@ xdescribe("Channels in draft orders", () => {
|
|||
cy.getTextFromElement(CHANNEL_FORM_SELECTORS.channelSelect).then(
|
||||
channelInSelect => {
|
||||
expect(channelInSelect).to.be.eq(defaultChannel.name);
|
||||
}
|
||||
},
|
||||
);
|
||||
selectChannelInPicker(otherChannel.name);
|
||||
cy.getTextFromElement(DRAFT_ORDER_SELECTORS.salesChannel).then(
|
||||
channelInDraftOrder => {
|
||||
expect(channelInDraftOrder).to.be.eq(otherChannel.name);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -8,14 +8,14 @@ import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors";
|
|||
import { urlList } from "../../fixtures/urlList";
|
||||
import {
|
||||
createCustomer,
|
||||
deleteCustomersStartsWith
|
||||
deleteCustomersStartsWith,
|
||||
} from "../../support/api/requests/Customer";
|
||||
import { updateOrdersSettings } from "../../support/api/requests/Order";
|
||||
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
|
||||
import * as productsUtils from "../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../support/api/utils/shippingUtils";
|
||||
import { selectChannelInPicker } from "../../support/pages/channelsPage";
|
||||
import { finalizeDraftOrder } from "../../support/pages/draftOrderPage";
|
||||
|
@ -48,25 +48,25 @@ xdescribe("Draft orders", () => {
|
|||
`${randomName}@example.com`,
|
||||
randomName,
|
||||
addresses.plAddress,
|
||||
true
|
||||
true,
|
||||
);
|
||||
createShipping({
|
||||
channelId: defaultChannel.id,
|
||||
name: randomName,
|
||||
address: addresses.plAddress
|
||||
address: addresses.plAddress,
|
||||
});
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
warehouse = warehouseResp;
|
||||
productsUtils.createTypeAttributeAndCategoryForProduct({
|
||||
name: randomName
|
||||
name: randomName,
|
||||
});
|
||||
})
|
||||
.then(
|
||||
({
|
||||
productType: productTypeResp,
|
||||
attribute: attributeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
productsUtils.createProductInChannel({
|
||||
name: randomName,
|
||||
|
@ -74,9 +74,9 @@ xdescribe("Draft orders", () => {
|
|||
warehouseId: warehouse.id,
|
||||
productTypeId: productTypeResp.id,
|
||||
attributeId: attributeResp.id,
|
||||
categoryId: categoryResp.id
|
||||
categoryId: categoryResp.id,
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -97,16 +97,16 @@ xdescribe("Draft orders", () => {
|
|||
cy.contains(ORDERS_SELECTORS.orderRow, draftOrderNumber).should(
|
||||
$order => {
|
||||
expect($order).to.be.visible;
|
||||
}
|
||||
},
|
||||
);
|
||||
cy.visit(urlList.draftOrders);
|
||||
cy.contains(
|
||||
DRAFT_ORDERS_LIST_SELECTORS.draftOrderRow,
|
||||
draftOrderNumber
|
||||
draftOrderNumber,
|
||||
).should($draftOrder => {
|
||||
expect($draftOrder).to.not.exist;
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -9,15 +9,15 @@ import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
|
|||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../support/api/utils/shippingUtils";
|
||||
import {
|
||||
enterSiteSettingAndSetStockReservation,
|
||||
userType
|
||||
userType,
|
||||
} from "../../support/pages/siteSettings";
|
||||
|
||||
xdescribe("As an admin I want to manage stock reservation", () => {
|
||||
|
@ -26,7 +26,7 @@ xdescribe("As an admin I want to manage stock reservation", () => {
|
|||
const productQuantity = 10;
|
||||
const customerType = {
|
||||
authenticated: "auth",
|
||||
anonymous: "token"
|
||||
anonymous: "token",
|
||||
};
|
||||
|
||||
let defaultChannel;
|
||||
|
@ -51,7 +51,7 @@ xdescribe("As an admin I want to manage stock reservation", () => {
|
|||
createShipping({
|
||||
channelId: defaultChannel.id,
|
||||
name,
|
||||
address
|
||||
address,
|
||||
});
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
|
@ -62,12 +62,12 @@ xdescribe("As an admin I want to manage stock reservation", () => {
|
|||
({
|
||||
attribute: attributeResp,
|
||||
category: categoryResp,
|
||||
productType: productTypeResp
|
||||
productType: productTypeResp,
|
||||
}) => {
|
||||
attribute = attributeResp;
|
||||
category = categoryResp;
|
||||
productType = productTypeResp;
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -83,14 +83,14 @@ xdescribe("As an admin I want to manage stock reservation", () => {
|
|||
name: productName,
|
||||
productTypeId: productType.id,
|
||||
warehouseId: warehouse.id,
|
||||
quantityInWarehouse: productQuantity
|
||||
quantityInWarehouse: productQuantity,
|
||||
}).then(({ variantsList }) => {
|
||||
dataForCheckout = {
|
||||
email: "example@example.pl",
|
||||
address,
|
||||
channelSlug: defaultChannel.slug,
|
||||
variantsList,
|
||||
productQuantity
|
||||
productQuantity,
|
||||
};
|
||||
});
|
||||
});
|
||||
|
@ -115,10 +115,10 @@ xdescribe("As an admin I want to manage stock reservation", () => {
|
|||
.empty;
|
||||
expect(
|
||||
resp.errors[0].field,
|
||||
"error should be on field quantity"
|
||||
"error should be on field quantity",
|
||||
).to.be.eq("quantity");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -141,10 +141,10 @@ xdescribe("As an admin I want to manage stock reservation", () => {
|
|||
.empty;
|
||||
expect(
|
||||
resp.errors[0].field,
|
||||
"error should be on field quantity"
|
||||
"error should be on field quantity",
|
||||
).to.be.eq("quantity");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -166,7 +166,7 @@ xdescribe("As an admin I want to manage stock reservation", () => {
|
|||
expect(resp.errors, "there should be no errors in response").to.be
|
||||
.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -188,6 +188,6 @@ xdescribe("As an admin I want to manage stock reservation", () => {
|
|||
expect(resp.errors, "there should be no errors in response").to.be
|
||||
.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -11,22 +11,22 @@ import { urlList } from "../../fixtures/urlList";
|
|||
import { ONE_PERMISSION_USERS } from "../../fixtures/users";
|
||||
import {
|
||||
createCustomer,
|
||||
deleteCustomersStartsWith
|
||||
deleteCustomersStartsWith,
|
||||
} from "../../support/api/requests/Customer";
|
||||
import {
|
||||
getOrder,
|
||||
updateOrdersSettings
|
||||
updateOrdersSettings,
|
||||
} from "../../support/api/requests/Order";
|
||||
import { getDefaultChannel } from "../../support/api/utils/channelsUtils";
|
||||
import {
|
||||
createFulfilledOrder,
|
||||
createOrder,
|
||||
createReadyToFulfillOrder
|
||||
createReadyToFulfillOrder,
|
||||
} from "../../support/api/utils/ordersUtils";
|
||||
import * as productsUtils from "../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../support/api/utils/shippingUtils";
|
||||
import { selectChannelInPicker } from "../../support/pages/channelsPage";
|
||||
import { finalizeDraftOrder } from "../../support/pages/draftOrderPage";
|
||||
|
@ -65,7 +65,7 @@ describe("Orders", () => {
|
|||
createShipping({
|
||||
channelId: defaultChannel.id,
|
||||
name: randomName,
|
||||
address
|
||||
address,
|
||||
});
|
||||
})
|
||||
.then(
|
||||
|
@ -73,15 +73,15 @@ describe("Orders", () => {
|
|||
shippingMethod = shippingMethodResp;
|
||||
warehouse = warehouseResp;
|
||||
productsUtils.createTypeAttributeAndCategoryForProduct({
|
||||
name: randomName
|
||||
name: randomName,
|
||||
});
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(
|
||||
({
|
||||
productType: productTypeResp,
|
||||
attribute: attributeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
productsUtils.createProductInChannel({
|
||||
name: randomName,
|
||||
|
@ -89,9 +89,9 @@ describe("Orders", () => {
|
|||
warehouseId: warehouse.id,
|
||||
productTypeId: productTypeResp.id,
|
||||
attributeId: attributeResp.id,
|
||||
categoryId: categoryResp.id
|
||||
categoryId: categoryResp.id,
|
||||
});
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(({ variantsList: variantsResp }) => {
|
||||
variantsList = variantsResp;
|
||||
|
@ -101,7 +101,7 @@ describe("Orders", () => {
|
|||
beforeEach(() => {
|
||||
cy.clearSessionData().loginUserViaRequest(
|
||||
"auth",
|
||||
ONE_PERMISSION_USERS.order
|
||||
ONE_PERMISSION_USERS.order,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -117,10 +117,10 @@ describe("Orders", () => {
|
|||
cy.visit(urlList.orders);
|
||||
cy.contains(ORDERS_SELECTORS.orderRow, draftOrderNumber).click();
|
||||
cy.contains(ORDERS_SELECTORS.salesChannel, defaultChannel.name).should(
|
||||
"be.visible"
|
||||
"be.visible",
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -132,7 +132,7 @@ describe("Orders", () => {
|
|||
channelId: defaultChannel.id,
|
||||
shippingMethodId: shippingMethod.id,
|
||||
variantsList,
|
||||
address
|
||||
address,
|
||||
}).then(order => {
|
||||
cy.visit(urlList.orders);
|
||||
cy.contains(ORDERS_SELECTORS.orderRow, order.number).click();
|
||||
|
@ -140,7 +140,7 @@ describe("Orders", () => {
|
|||
.find("[button]")
|
||||
.should("not.exist");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it("should cancel fulfillment", { tags: ["@orders", "@allEnv"] }, () => {
|
||||
|
@ -151,7 +151,7 @@ describe("Orders", () => {
|
|||
shippingMethodId: shippingMethod.id,
|
||||
variantsList,
|
||||
address,
|
||||
warehouse: warehouse.id
|
||||
warehouse: warehouse.id,
|
||||
})
|
||||
.then(({ order: orderResp }) => {
|
||||
order = orderResp;
|
||||
|
@ -164,7 +164,7 @@ describe("Orders", () => {
|
|||
.click()
|
||||
.fillAutocompleteSelect(
|
||||
ORDERS_SELECTORS.cancelFulfillmentSelectField,
|
||||
warehouse.name
|
||||
warehouse.name,
|
||||
)
|
||||
.addAliasToGraphRequest("OrderFulfillmentCancel")
|
||||
.get(BUTTON_SELECTORS.submit)
|
||||
|
@ -187,7 +187,7 @@ describe("Orders", () => {
|
|||
channelId: defaultChannel.id,
|
||||
shippingMethodId: shippingMethod.id,
|
||||
variantsList,
|
||||
address
|
||||
address,
|
||||
})
|
||||
.then(({ order: orderResp }) => {
|
||||
order = orderResp;
|
||||
|
@ -202,13 +202,13 @@ describe("Orders", () => {
|
|||
cy.get(BUTTON_SELECTORS.submit)
|
||||
.click()
|
||||
.waitForRequestAndCheckIfNoErrors(
|
||||
"@OrderFulfillmentRefundProducts"
|
||||
"@OrderFulfillmentRefundProducts",
|
||||
);
|
||||
getOrder(order.id);
|
||||
})
|
||||
.then(orderResp => {
|
||||
expect(orderResp.paymentStatus).to.be.eq("FULLY_REFUNDED");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -11,7 +11,7 @@ import { pageTypeDetailsUrl, urlList } from "../../fixtures/urlList";
|
|||
import { createAttribute } from "../../support/api/requests/Attribute";
|
||||
import {
|
||||
createPageType,
|
||||
getPageType
|
||||
getPageType,
|
||||
} from "../../support/api/requests/PageType";
|
||||
|
||||
describe("Tests for page types", () => {
|
||||
|
@ -44,7 +44,7 @@ describe("Tests for page types", () => {
|
|||
.then(pageType => {
|
||||
expect(pageType.name).to.eq(randomName);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
xit("should assign attribute", { tags: ["@pages", "@allEnv"] }, () => {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { pageDetailsUrl } from "../../fixtures/urlList";
|
|||
import { createAttribute } from "../../support/api/requests/Attribute";
|
||||
import {
|
||||
createPage as createPageRequest,
|
||||
getPage
|
||||
getPage,
|
||||
} from "../../support/api/requests/Page";
|
||||
import { createPageType } from "../../support/api/requests/PageType";
|
||||
import { deleteAttributesStartsWith } from "../../support/api/utils/attributes/attributeUtils";
|
||||
|
@ -27,7 +27,7 @@ describe("Tests for pages", () => {
|
|||
RICH_TEXT: faker.lorem.sentence(),
|
||||
DROPDOWN: "value",
|
||||
MULTISELECT: "value",
|
||||
BOOLEAN: true
|
||||
BOOLEAN: true,
|
||||
};
|
||||
|
||||
before(() => {
|
||||
|
@ -63,7 +63,7 @@ describe("Tests for pages", () => {
|
|||
expect(page.attributes[0].attribute.id).to.eq(attribute.id);
|
||||
getPage(page.id, "token").should("be.null");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -75,7 +75,7 @@ describe("Tests for pages", () => {
|
|||
createPage({
|
||||
pageName: randomName,
|
||||
pageTypeName: name,
|
||||
isPublished: true
|
||||
isPublished: true,
|
||||
})
|
||||
.then(page => {
|
||||
getPage(page.id, "token");
|
||||
|
@ -85,7 +85,7 @@ describe("Tests for pages", () => {
|
|||
expect(page.isPublished).to.be.true;
|
||||
expect(page.attributes[0].attribute.id).to.eq(attribute.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Object.keys(attributesTypes).forEach(attributeType => {
|
||||
|
@ -99,7 +99,7 @@ describe("Tests for pages", () => {
|
|||
name: randomName,
|
||||
type: "PAGE_TYPE",
|
||||
inputType: attributeType,
|
||||
attributeValues
|
||||
attributeValues,
|
||||
}).then(attributeResp => {
|
||||
attribute = attributeResp;
|
||||
createPageType({ name: randomName, attributeId: attribute.id });
|
||||
|
@ -108,7 +108,7 @@ describe("Tests for pages", () => {
|
|||
pageName: randomName,
|
||||
pageTypeName: randomName,
|
||||
attributeType,
|
||||
attributeValue: attributeValuesOnPage[attributeType]
|
||||
attributeValue: attributeValuesOnPage[attributeType],
|
||||
})
|
||||
.then(page => {
|
||||
getPage(page.id);
|
||||
|
@ -117,15 +117,15 @@ describe("Tests for pages", () => {
|
|||
expect(page.attributes[0].values[0].inputType).to.eq(attributeType);
|
||||
if (attributeType !== "BOOLEAN") {
|
||||
expect(page.attributes[0].values[0].name).to.eq(
|
||||
attributeValuesOnPage[attributeType].toString()
|
||||
attributeValuesOnPage[attributeType].toString(),
|
||||
);
|
||||
} else {
|
||||
expect(page.attributes[0].values[0].name).to.includes(
|
||||
"Yes".toString()
|
||||
"Yes".toString(),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -134,7 +134,7 @@ describe("Tests for pages", () => {
|
|||
|
||||
createPageRequest({
|
||||
pageTypeId: pageType.id,
|
||||
title: randomName
|
||||
title: randomName,
|
||||
}).then(({ page }) => {
|
||||
cy.visit(pageDetailsUrl(page.id))
|
||||
.get(BUTTON_SELECTORS.deleteButton)
|
||||
|
@ -153,7 +153,7 @@ describe("Tests for pages", () => {
|
|||
|
||||
createPageRequest({
|
||||
pageTypeId: pageType.id,
|
||||
title: randomName
|
||||
title: randomName,
|
||||
})
|
||||
.then(({ page }) => {
|
||||
cy.visit(pageDetailsUrl(page.id))
|
||||
|
|
|
@ -10,7 +10,7 @@ import { productDetailsUrl, variantDetailsUrl } from "../../fixtures/urlList";
|
|||
import {
|
||||
activatePreorderOnVariant,
|
||||
deactivatePreorderOnVariant,
|
||||
getVariant
|
||||
getVariant,
|
||||
} from "../../support/api/requests/Product";
|
||||
import { createWaitingForCaptureOrder } from "../../support/api/utils/ordersUtils";
|
||||
import { createProductWithShipping } from "../../support/api/utils/products/productsUtils";
|
||||
|
@ -20,7 +20,7 @@ import {
|
|||
fillUpVariantAttributeAndSku,
|
||||
saveVariant,
|
||||
selectChannelForVariantAndFillUpPrices,
|
||||
setUpPreorderEndDate
|
||||
setUpPreorderEndDate,
|
||||
} from "../../support/pages/catalog/products/VariantsPage";
|
||||
|
||||
describe("Creating variants in preorder", () => {
|
||||
|
@ -43,7 +43,7 @@ describe("Creating variants in preorder", () => {
|
|||
address: resp.address,
|
||||
channelSlug: resp.defaultChannel.slug,
|
||||
email: "example@example.com",
|
||||
shippingMethodName: resp.shippingMethod.name
|
||||
shippingMethodName: resp.shippingMethod.name,
|
||||
};
|
||||
defaultChannel = resp.defaultChannel;
|
||||
product = resp.product;
|
||||
|
@ -66,7 +66,7 @@ describe("Creating variants in preorder", () => {
|
|||
.click();
|
||||
fillUpVariantAttributeAndSku({
|
||||
attributeName: attributeValues[1],
|
||||
sku: attributeValues[1]
|
||||
sku: attributeValues[1],
|
||||
});
|
||||
enablePreorderWithThreshold(threshold);
|
||||
setUpPreorderEndDate(endDate, endTime);
|
||||
|
@ -81,7 +81,7 @@ describe("Creating variants in preorder", () => {
|
|||
selectChannelForVariantAndFillUpPrices({
|
||||
channelName: defaultChannel.name,
|
||||
attributeName: attributeValues[1],
|
||||
price: 10
|
||||
price: 10,
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
|
@ -100,7 +100,7 @@ describe("Creating variants in preorder", () => {
|
|||
expect(endDate).to.eq(formatDate(respEndDate));
|
||||
expect(endTime).to.eq(formatTime(respEndDate));
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -123,7 +123,7 @@ describe("Creating variants in preorder", () => {
|
|||
expect(preorder.globalThreshold).to.eq(threshold);
|
||||
expect(preorder.globalSoldUnits).to.eq(1);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -142,6 +142,6 @@ describe("Creating variants in preorder", () => {
|
|||
expect(endDate).to.eq(formatDate(respEndDate));
|
||||
expect(endTime).to.eq(formatTime(respEndDate));
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -11,7 +11,7 @@ import { deleteCollectionsStartsWith } from "../../support/api/utils/catalog/col
|
|||
import { createWaitingForCaptureOrder } from "../../support/api/utils/ordersUtils";
|
||||
import {
|
||||
createProductWithShipping,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../support/api/utils/products/productsUtils";
|
||||
import { saveVariant } from "../../support/pages/catalog/products/VariantsPage";
|
||||
|
||||
|
@ -19,7 +19,7 @@ describe("Stocks and threshold in preorder variants", () => {
|
|||
const startsWith = "StocksThreshold";
|
||||
const attributeValues = ["value1", "value2"];
|
||||
const preorder = {
|
||||
globalThreshold: 15
|
||||
globalThreshold: 15,
|
||||
};
|
||||
|
||||
let defaultChannel;
|
||||
|
@ -35,14 +35,14 @@ describe("Stocks and threshold in preorder variants", () => {
|
|||
createProductWithShipping({
|
||||
name: startsWith,
|
||||
attributeValues,
|
||||
preorder
|
||||
preorder,
|
||||
}).then(resp => {
|
||||
checkoutData = {
|
||||
address: resp.address,
|
||||
channelSlug: resp.defaultChannel.slug,
|
||||
email: "example@example.com",
|
||||
shippingMethodName: resp.shippingMethod.name,
|
||||
variantsList: resp.variantsList
|
||||
variantsList: resp.variantsList,
|
||||
};
|
||||
warehouse = resp.warehouse;
|
||||
defaultChannel = resp.defaultChannel;
|
||||
|
@ -69,7 +69,7 @@ describe("Stocks and threshold in preorder variants", () => {
|
|||
createCheckout(checkoutData).then(({ errors }) => {
|
||||
expect(errors[0].field).to.eq("quantity");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -84,7 +84,7 @@ describe("Stocks and threshold in preorder variants", () => {
|
|||
createCheckout(checkoutData).then(({ errors }) => {
|
||||
expect(errors[0].field).to.eq("quantity");
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -102,18 +102,18 @@ describe("Stocks and threshold in preorder variants", () => {
|
|||
.get(BUTTON_SELECTORS.submit)
|
||||
.click()
|
||||
.waitForRequestAndCheckIfNoErrors(
|
||||
"@ProductVariantPreorderDeactivate"
|
||||
"@ProductVariantPreorderDeactivate",
|
||||
);
|
||||
getVariant(variantsList[0].id, defaultChannel.slug);
|
||||
})
|
||||
.then(variantResp => {
|
||||
expect(
|
||||
variantResp.stocks[0].quantityAllocated,
|
||||
"product is allocated with correct quantity"
|
||||
"product is allocated with correct quantity",
|
||||
).to.eq(1);
|
||||
expect(
|
||||
variantResp.stocks[0].warehouse.id,
|
||||
"product is allocated to correct warehouse"
|
||||
"product is allocated to correct warehouse",
|
||||
).to.eq(warehouse.id);
|
||||
})
|
||||
.then(() => {
|
||||
|
@ -121,12 +121,12 @@ describe("Stocks and threshold in preorder variants", () => {
|
|||
orderId: order.id,
|
||||
warehouse: warehouse.id,
|
||||
quantity: 1,
|
||||
linesId: order.lines
|
||||
linesId: order.lines,
|
||||
});
|
||||
})
|
||||
.then(({ errors }) => {
|
||||
expect(errors, "no errors when fulfilling order").to.be.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -12,12 +12,12 @@ import { createAttribute } from "../../support/api/requests/Attribute";
|
|||
import { createTypeProduct } from "../../support/api/requests/ProductType";
|
||||
import {
|
||||
expectCorrectProductInformation,
|
||||
expectCorrectProductVariantInformation
|
||||
expectCorrectProductVariantInformation,
|
||||
} from "../../support/api/utils/products/checkProductInfo";
|
||||
import { metadataForms } from "../../support/pages/catalog/metadataComponent";
|
||||
import {
|
||||
fillUpPriceList,
|
||||
priceInputLists
|
||||
priceInputLists,
|
||||
} from "../../support/pages/catalog/products/priceListComponent";
|
||||
import { fillUpCommonFieldsForAllProductTypes } from "../../support/pages/catalog/products/productDetailsPage";
|
||||
import { selectChannelInDetailsPages } from "../../support/pages/channelsPage";
|
||||
|
@ -28,23 +28,23 @@ describe("As an admin I should be able to create product", () => {
|
|||
const generalInfo = {
|
||||
name: `${startsWith}${faker.datatype.number()}`,
|
||||
description: faker.lorem.sentence(),
|
||||
rating: 2
|
||||
rating: 2,
|
||||
};
|
||||
const seo = {
|
||||
title: "testTitle",
|
||||
description: generalInfo.description
|
||||
description: generalInfo.description,
|
||||
};
|
||||
const metadata = {
|
||||
public: {
|
||||
metadataForm: metadataForms.public,
|
||||
name: "metadataName",
|
||||
value: "metadataValue"
|
||||
value: "metadataValue",
|
||||
},
|
||||
private: {
|
||||
metadataForm: metadataForms.private,
|
||||
name: "privateMetadataName",
|
||||
value: "privateMetadataValue"
|
||||
}
|
||||
value: "privateMetadataValue",
|
||||
},
|
||||
};
|
||||
let attribute;
|
||||
|
||||
|
@ -69,10 +69,10 @@ describe("As an admin I should be able to create product", () => {
|
|||
seo,
|
||||
metadata,
|
||||
productOrganization: { productType: randomName },
|
||||
attribute
|
||||
attribute,
|
||||
};
|
||||
createTpeAndFillUpProductFields(randomName, true, productData).then(
|
||||
productOrgResp => (productData.productOrganization = productOrgResp)
|
||||
productOrgResp => (productData.productOrganization = productOrgResp),
|
||||
);
|
||||
cy.addAliasToGraphRequest("ProductDetails")
|
||||
.get(BUTTON_SELECTORS.confirm)
|
||||
|
@ -91,7 +91,7 @@ describe("As an admin I should be able to create product", () => {
|
|||
}
|
||||
expectCorrectProductInformation(productResp, productData);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -106,10 +106,10 @@ describe("As an admin I should be able to create product", () => {
|
|||
seo,
|
||||
metadata,
|
||||
productOrganization: { productType: randomName },
|
||||
attribute
|
||||
attribute,
|
||||
};
|
||||
createTpeAndFillUpProductFields(randomName, false, productData).then(
|
||||
productOrgResp => (productData.productOrganization = productOrgResp)
|
||||
productOrgResp => (productData.productOrganization = productOrgResp),
|
||||
);
|
||||
selectChannelInDetailsPages();
|
||||
fillUpPriceList(prices.sellingPrice);
|
||||
|
@ -135,21 +135,21 @@ describe("As an admin I should be able to create product", () => {
|
|||
expectCorrectProductVariantInformation(
|
||||
productResp.variants,
|
||||
randomName,
|
||||
prices
|
||||
prices,
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
function createTpeAndFillUpProductFields(
|
||||
randomName,
|
||||
hasVariants,
|
||||
productData
|
||||
productData,
|
||||
) {
|
||||
createTypeProduct({
|
||||
name: randomName,
|
||||
attributeId: attribute.id,
|
||||
hasVariants
|
||||
hasVariants,
|
||||
});
|
||||
cy.clearSessionData()
|
||||
.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product)
|
||||
|
|
|
@ -24,7 +24,7 @@ xdescribe("Tests for images", () => {
|
|||
.its("response.body")
|
||||
.then(resp => {
|
||||
const data = resp.find(element =>
|
||||
element.data.hasOwnProperty("products")
|
||||
element.data.hasOwnProperty("products"),
|
||||
).data;
|
||||
const products = data.products.edges;
|
||||
cy.expectSkeletonIsVisible()
|
||||
|
@ -49,7 +49,7 @@ xdescribe("Tests for images", () => {
|
|||
.should("have.length", expectedProductsSvgAvatars);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it("Should display product image", { tags: ["@products", "@allEnv"] }, () => {
|
||||
|
|
|
@ -35,7 +35,7 @@ describe("Products available in listings", () => {
|
|||
shippingUtils.createShipping({
|
||||
channelId: defaultChannel.id,
|
||||
name,
|
||||
address: addressesFixture.plAddress
|
||||
address: addressesFixture.plAddress,
|
||||
});
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
|
@ -48,19 +48,19 @@ describe("Products available in listings", () => {
|
|||
({
|
||||
attribute: attributeResp,
|
||||
productType: productTypeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
productType = productTypeResp;
|
||||
attribute = attributeResp;
|
||||
category = categoryResp;
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
cy.clearSessionData().loginUserViaRequest(
|
||||
"auth",
|
||||
ONE_PERMISSION_USERS.product
|
||||
ONE_PERMISSION_USERS.product,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -79,7 +79,7 @@ describe("Products available in listings", () => {
|
|||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
isAvailableForPurchase: false
|
||||
isAvailableForPurchase: false,
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
product = productResp;
|
||||
|
@ -92,7 +92,7 @@ describe("Products available in listings", () => {
|
|||
.then(resp => {
|
||||
expect(isProductAvailableForPurchase(resp)).to.be.eq(true);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -109,7 +109,7 @@ describe("Products available in listings", () => {
|
|||
warehouseId: warehouse.id,
|
||||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id
|
||||
categoryId: category.id,
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
product = productResp;
|
||||
|
@ -122,6 +122,6 @@ describe("Products available in listings", () => {
|
|||
.then(resp => {
|
||||
expect(isProductAvailableForPurchase(resp)).to.be.eq(false);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -28,13 +28,13 @@ describe("Published products", () => {
|
|||
({
|
||||
attribute: attributeResp,
|
||||
productType: productTypeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
productType = productTypeResp;
|
||||
attribute = attributeResp;
|
||||
category = categoryResp;
|
||||
getDefaultChannel();
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(channel => {
|
||||
defaultChannel = channel;
|
||||
|
@ -44,7 +44,7 @@ describe("Published products", () => {
|
|||
beforeEach(() => {
|
||||
cy.clearSessionData().loginUserViaRequest(
|
||||
"auth",
|
||||
ONE_PERMISSION_USERS.product
|
||||
ONE_PERMISSION_USERS.product,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -62,7 +62,7 @@ describe("Published products", () => {
|
|||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
isPublished: false,
|
||||
isAvailableForPurchase: false
|
||||
isAvailableForPurchase: false,
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
const product = productResp;
|
||||
|
@ -74,7 +74,7 @@ describe("Published products", () => {
|
|||
const isVisible = isProductVisible(resp, productName);
|
||||
expect(isVisible).to.be.eq(true);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -90,7 +90,7 @@ describe("Published products", () => {
|
|||
channelId: defaultChannel.id,
|
||||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id
|
||||
categoryId: category.id,
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
product = productResp;
|
||||
|
@ -110,6 +110,6 @@ describe("Published products", () => {
|
|||
const isVisible = isProductVisible(resp, productName);
|
||||
expect(isVisible).to.be.eq(true);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -27,13 +27,13 @@ describe("Products displayed in listings", () => {
|
|||
({
|
||||
attribute: attributeResp,
|
||||
productType: productTypeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
productType = productTypeResp;
|
||||
attribute = attributeResp;
|
||||
category = categoryResp;
|
||||
getDefaultChannel();
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(channel => {
|
||||
defaultChannel = channel;
|
||||
|
@ -43,7 +43,7 @@ describe("Products displayed in listings", () => {
|
|||
beforeEach(() => {
|
||||
cy.clearSessionData().loginUserViaRequest(
|
||||
"auth",
|
||||
ONE_PERMISSION_USERS.product
|
||||
ONE_PERMISSION_USERS.product,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -61,7 +61,7 @@ describe("Products displayed in listings", () => {
|
|||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
visibleInListings: false,
|
||||
isAvailableForPurchase: false
|
||||
isAvailableForPurchase: false,
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
const product = productResp;
|
||||
|
@ -72,11 +72,11 @@ describe("Products displayed in listings", () => {
|
|||
.then(resp => {
|
||||
const isProductVisible = isProductVisibleInSearchResult(
|
||||
resp,
|
||||
productName
|
||||
productName,
|
||||
);
|
||||
expect(isProductVisible).to.be.eq(true);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -92,7 +92,7 @@ describe("Products displayed in listings", () => {
|
|||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
visibleInListings: true
|
||||
visibleInListings: true,
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
const product = productResp;
|
||||
|
@ -102,7 +102,7 @@ describe("Products displayed in listings", () => {
|
|||
searchInShop(productName).then(resp => {
|
||||
const isProductVisible = isProductVisibleInSearchResult(
|
||||
resp,
|
||||
productName
|
||||
productName,
|
||||
);
|
||||
expect(isProductVisible).to.be.eq(false);
|
||||
});
|
||||
|
@ -114,10 +114,10 @@ describe("Products displayed in listings", () => {
|
|||
.then(resp => {
|
||||
const isProductVisible = isProductVisibleInSearchResult(
|
||||
resp,
|
||||
productName
|
||||
productName,
|
||||
);
|
||||
expect(isProductVisible).to.be.eq(true);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -11,16 +11,16 @@ import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
|
|||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../../support/api/utils/shippingUtils";
|
||||
import {
|
||||
selectChannel,
|
||||
selectFilterOption,
|
||||
selectProductsOutOfStock
|
||||
selectProductsOutOfStock,
|
||||
} from "../../../support/pages/catalog/products/productsListPage";
|
||||
|
||||
describe("Filtering products", () => {
|
||||
|
@ -43,15 +43,15 @@ describe("Filtering products", () => {
|
|||
({
|
||||
attribute: attributeResp,
|
||||
productType: productTypeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
attribute = attributeResp;
|
||||
productType = productTypeResp;
|
||||
category = categoryResp;
|
||||
}
|
||||
},
|
||||
);
|
||||
createCollection(name).then(
|
||||
collectionResp => (collection = collectionResp)
|
||||
collectionResp => (collection = collectionResp),
|
||||
);
|
||||
getDefaultChannel()
|
||||
.then(channelResp => {
|
||||
|
@ -62,7 +62,7 @@ describe("Filtering products", () => {
|
|||
createShipping({
|
||||
channelId: channel.id,
|
||||
name,
|
||||
address: addresses.plAddress
|
||||
address: addresses.plAddress,
|
||||
});
|
||||
})
|
||||
.then(({ warehouse: warehouseResp }) => {
|
||||
|
@ -75,7 +75,7 @@ describe("Filtering products", () => {
|
|||
price,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
productTypeId: productType.id
|
||||
productTypeId: productType.id,
|
||||
});
|
||||
})
|
||||
.then(({ product: product }) => {
|
||||
|
@ -101,7 +101,7 @@ describe("Filtering products", () => {
|
|||
cy.getTextFromElement(PRODUCTS_LIST.productsNames).then(product => {
|
||||
expect(product).to.includes(name);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -119,7 +119,7 @@ describe("Filtering products", () => {
|
|||
productTypeId: productType.id,
|
||||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
price
|
||||
price,
|
||||
});
|
||||
cy.waitForProgressBarToNotExist();
|
||||
selectChannel(channel.slug);
|
||||
|
@ -131,6 +131,6 @@ describe("Filtering products", () => {
|
|||
.then(product => {
|
||||
expect(product).to.includes(productOutOfStock);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@ import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
|
|||
import { urlList } from "../../../fixtures/urlList";
|
||||
import {
|
||||
getDisplayedColumnArray,
|
||||
isNumberOfProductsSameAsInSelectResultsOnPage
|
||||
isNumberOfProductsSameAsInSelectResultsOnPage,
|
||||
} from "../../../support/pages/catalog/products/productsListPage";
|
||||
|
||||
describe("Products", () => {
|
||||
|
@ -26,7 +26,7 @@ describe("Products", () => {
|
|||
.should("be.disabled");
|
||||
let firstPageProducts;
|
||||
getDisplayedColumnArray("name").then(
|
||||
productsList => (firstPageProducts = productsList)
|
||||
productsList => (firstPageProducts = productsList),
|
||||
);
|
||||
cy.addAliasToGraphRequest("ProductList")
|
||||
.get(PRODUCTS_LIST.nextPageButton)
|
||||
|
@ -45,10 +45,10 @@ describe("Products", () => {
|
|||
.should("not.exist");
|
||||
getDisplayedColumnArray("name").then(productsList => {
|
||||
expect(
|
||||
JSON.stringify(productsList) === JSON.stringify(firstPageProducts)
|
||||
JSON.stringify(productsList) === JSON.stringify(firstPageProducts),
|
||||
).to.be.true;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -59,12 +59,12 @@ describe("Products", () => {
|
|||
isNumberOfProductsSameAsInSelectResultsOnPage().then(
|
||||
isTheSame =>
|
||||
expect(isTheSame, "check if number of displayed products is correct")
|
||||
.to.be.true
|
||||
.to.be.true,
|
||||
);
|
||||
cy.get(PRODUCTS_LIST.resultsOnPageSelect)
|
||||
.click()
|
||||
.get(
|
||||
`${PRODUCTS_LIST.rowNumberOption}${BUTTON_SELECTORS.notSelectedOption}`
|
||||
`${PRODUCTS_LIST.rowNumberOption}${BUTTON_SELECTORS.notSelectedOption}`,
|
||||
)
|
||||
.first()
|
||||
.click()
|
||||
|
@ -73,9 +73,9 @@ describe("Products", () => {
|
|||
isTheSame =>
|
||||
expect(
|
||||
isTheSame,
|
||||
"check if number of displayed products is correct, after changing results number in table footer"
|
||||
).to.be.true
|
||||
"check if number of displayed products is correct, after changing results number in table footer",
|
||||
).to.be.true,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -30,7 +30,7 @@ describe("Sorting products", () => {
|
|||
.waitForProgressBarToNotExist()
|
||||
.waitForRequestAndCheckIfNoErrors("@ProductList");
|
||||
expectProductsSortedBy(sortBy, false);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,14 +8,14 @@ import { ONE_PERMISSION_USERS } from "../../fixtures/users";
|
|||
import { createChannel } from "../../support/api/requests/Channels";
|
||||
import {
|
||||
createProduct,
|
||||
updateChannelInProduct
|
||||
updateChannelInProduct,
|
||||
} from "../../support/api/requests/Product";
|
||||
import * as productUtils from "../../support/api/utils/products/productsUtils";
|
||||
import { getProductVariants } from "../../support/api/utils/storeFront/storeFrontProductUtils";
|
||||
import {
|
||||
createFirstVariant,
|
||||
createVariant,
|
||||
variantsShouldBeVisible
|
||||
variantsShouldBeVisible,
|
||||
} from "../../support/pages/catalog/products/VariantsPage";
|
||||
import { selectChannelInHeader } from "../../support/pages/channelsPage";
|
||||
|
||||
|
@ -52,7 +52,7 @@ describe("As an admin I should be able to create variant", () => {
|
|||
beforeEach(() => {
|
||||
cy.clearSessionData().loginUserViaRequest(
|
||||
"auth",
|
||||
ONE_PERMISSION_USERS.product
|
||||
ONE_PERMISSION_USERS.product,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -68,23 +68,23 @@ describe("As an admin I should be able to create variant", () => {
|
|||
attributeId: attribute.id,
|
||||
name,
|
||||
productTypeId: productType.id,
|
||||
categoryId: category.id
|
||||
categoryId: category.id,
|
||||
})
|
||||
.then(resp => {
|
||||
createdProduct = resp;
|
||||
updateChannelInProduct({
|
||||
productId: createdProduct.id,
|
||||
channelId: defaultChannel.id
|
||||
channelId: defaultChannel.id,
|
||||
});
|
||||
updateChannelInProduct({
|
||||
productId: createdProduct.id,
|
||||
channelId: newChannel.id
|
||||
channelId: newChannel.id,
|
||||
});
|
||||
cy.visit(`${urlList.products}${createdProduct.id}`);
|
||||
createFirstVariant({
|
||||
sku: name,
|
||||
price,
|
||||
attribute: attributeValues[0]
|
||||
attribute: attributeValues[0],
|
||||
});
|
||||
selectChannelInHeader(defaultChannel.name);
|
||||
variantsShouldBeVisible({ name, price });
|
||||
|
@ -106,7 +106,7 @@ describe("As an admin I should be able to create variant", () => {
|
|||
expect(variant).to.have.property("name", attributeValues[0]);
|
||||
expect(variant).to.have.property("price", price);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -126,7 +126,7 @@ describe("As an admin I should be able to create variant", () => {
|
|||
warehouseId: warehouse.id,
|
||||
productTypeId: productType.id,
|
||||
categoryId: category.id,
|
||||
price: variants[0].price
|
||||
price: variants[0].price,
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
createdProduct = productResp;
|
||||
|
@ -135,14 +135,14 @@ describe("As an admin I should be able to create variant", () => {
|
|||
sku: secondVariantSku,
|
||||
attributeName: variants[1].name,
|
||||
price: variants[1].price,
|
||||
channelName: defaultChannel.name
|
||||
channelName: defaultChannel.name,
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
selectChannelInHeader(defaultChannel.name);
|
||||
variantsShouldBeVisible({
|
||||
name: variants[1].name,
|
||||
price: variants[1].price
|
||||
price: variants[1].price,
|
||||
});
|
||||
getProductVariants(createdProduct.id, defaultChannel.slug);
|
||||
})
|
||||
|
@ -151,6 +151,6 @@ describe("As an admin I should be able to create variant", () => {
|
|||
expect(secondVariant).to.have.property("name", variants[1].name);
|
||||
expect(secondVariant).to.have.property("price", variants[1].price);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -11,12 +11,12 @@ import { urlList } from "../../../fixtures/urlList";
|
|||
import { ONE_PERMISSION_USERS } from "../../../fixtures/users";
|
||||
import {
|
||||
createProduct,
|
||||
updateChannelInProduct
|
||||
updateChannelInProduct,
|
||||
} from "../../../support/api/requests/Product";
|
||||
import { createTypeProduct } from "../../../support/api/requests/ProductType";
|
||||
import {
|
||||
deleteChannelsStartsWith,
|
||||
getDefaultChannel
|
||||
getDefaultChannel,
|
||||
} from "../../../support/api/utils/channelsUtils";
|
||||
import { createWaitingForCaptureOrder } from "../../../support/api/utils/ordersUtils";
|
||||
import * as productUtils from "../../../support/api/utils/products/productsUtils";
|
||||
|
@ -24,7 +24,7 @@ import * as shippingUtils from "../../../support/api/utils/shippingUtils";
|
|||
import { getProductVariants } from "../../../support/api/utils/storeFront/storeFrontProductUtils";
|
||||
import {
|
||||
createFirstVariant,
|
||||
createVariant
|
||||
createVariant,
|
||||
} from "../../../support/pages/catalog/products/VariantsPage";
|
||||
import { selectChannelInDetailsPages } from "../../../support/pages/channelsPage";
|
||||
|
||||
|
@ -59,14 +59,14 @@ describe("Creating variants", () => {
|
|||
shippingUtils.createShipping({
|
||||
channelId: defaultChannel.id,
|
||||
name,
|
||||
address
|
||||
address,
|
||||
});
|
||||
})
|
||||
.then(
|
||||
({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => {
|
||||
warehouse = warehouseResp;
|
||||
shippingMethod = shippingMethodResp;
|
||||
}
|
||||
},
|
||||
);
|
||||
productUtils
|
||||
.createTypeAttributeAndCategoryForProduct({ name, attributeValues })
|
||||
|
@ -74,7 +74,7 @@ describe("Creating variants", () => {
|
|||
({
|
||||
attribute: attributeResp,
|
||||
productType: productTypeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
attribute = attributeResp;
|
||||
productType = productTypeResp;
|
||||
|
@ -82,9 +82,9 @@ describe("Creating variants", () => {
|
|||
createTypeProduct({
|
||||
name: simpleProductTypeName,
|
||||
attributeId: attribute.id,
|
||||
hasVariants: false
|
||||
hasVariants: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(type => {
|
||||
simpleProductType = type;
|
||||
|
@ -94,7 +94,7 @@ describe("Creating variants", () => {
|
|||
beforeEach(() => {
|
||||
cy.clearSessionData().loginUserViaRequest(
|
||||
"auth",
|
||||
ONE_PERMISSION_USERS.product
|
||||
ONE_PERMISSION_USERS.product,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -110,19 +110,19 @@ describe("Creating variants", () => {
|
|||
attributeId: attribute.id,
|
||||
name,
|
||||
productTypeId: productType.id,
|
||||
categoryId: category.id
|
||||
categoryId: category.id,
|
||||
})
|
||||
.then(resp => {
|
||||
createdProduct = resp;
|
||||
updateChannelInProduct({
|
||||
productId: createdProduct.id,
|
||||
channelId: defaultChannel.id
|
||||
channelId: defaultChannel.id,
|
||||
});
|
||||
cy.visit(`${urlList.products}${createdProduct.id}`);
|
||||
cy.waitForProgressBarToNotBeVisible();
|
||||
createFirstVariant({
|
||||
price,
|
||||
attribute: attributeValues[0]
|
||||
attribute: attributeValues[0],
|
||||
});
|
||||
getProductVariants(createdProduct.id, defaultChannel.slug);
|
||||
})
|
||||
|
@ -134,13 +134,13 @@ describe("Creating variants", () => {
|
|||
email: "example@example.com",
|
||||
variantsList: [variant],
|
||||
shippingMethodName: shippingMethod.name,
|
||||
address
|
||||
address,
|
||||
});
|
||||
})
|
||||
.then(({ order }) => {
|
||||
expect(order.id).to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
xit(
|
||||
|
@ -159,7 +159,7 @@ describe("Creating variants", () => {
|
|||
warehouseId: warehouse.id,
|
||||
productTypeId: productType.id,
|
||||
categoryId: category.id,
|
||||
price: variants[0].price
|
||||
price: variants[0].price,
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
createdProduct = productResp;
|
||||
|
@ -168,7 +168,7 @@ describe("Creating variants", () => {
|
|||
warehouseName: warehouse.name,
|
||||
attributeName: variants[1].name,
|
||||
price: variants[1].price,
|
||||
channelName: defaultChannel.name
|
||||
channelName: defaultChannel.name,
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
|
@ -183,13 +183,13 @@ describe("Creating variants", () => {
|
|||
email: "example@example.com",
|
||||
variantsList: [secondVariant],
|
||||
shippingMethodName: shippingMethod.name,
|
||||
address
|
||||
address,
|
||||
});
|
||||
})
|
||||
.then(({ order }) => {
|
||||
expect(order.id).to.be.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -204,7 +204,7 @@ describe("Creating variants", () => {
|
|||
.type(name)
|
||||
.fillAutocompleteSelect(
|
||||
PRODUCT_DETAILS.productTypeInput,
|
||||
simpleProductType.name
|
||||
simpleProductType.name,
|
||||
)
|
||||
.fillAutocompleteSelect(PRODUCT_DETAILS.categoryInput);
|
||||
selectChannelInDetailsPages(defaultChannel.name);
|
||||
|
@ -220,11 +220,11 @@ describe("Creating variants", () => {
|
|||
.get(AVAILABLE_CHANNELS_FORM.assignedChannels)
|
||||
.click()
|
||||
.get(
|
||||
`${AVAILABLE_CHANNELS_FORM.availableForPurchaseRadioButtons}${AVAILABLE_CHANNELS_FORM.radioButtonsValueTrue}`
|
||||
`${AVAILABLE_CHANNELS_FORM.availableForPurchaseRadioButtons}${AVAILABLE_CHANNELS_FORM.radioButtonsValueTrue}`,
|
||||
)
|
||||
.click()
|
||||
.get(
|
||||
`${AVAILABLE_CHANNELS_FORM.publishedRadioButtons}${AVAILABLE_CHANNELS_FORM.radioButtonsValueTrue}`
|
||||
`${AVAILABLE_CHANNELS_FORM.publishedRadioButtons}${AVAILABLE_CHANNELS_FORM.radioButtonsValueTrue}`,
|
||||
)
|
||||
.click()
|
||||
.addAliasToGraphRequest("VariantCreate")
|
||||
|
@ -234,16 +234,16 @@ describe("Creating variants", () => {
|
|||
.wait("@VariantCreate")
|
||||
.then(({ response }) => {
|
||||
const variants = [
|
||||
response.body.data.productVariantCreate.productVariant
|
||||
response.body.data.productVariantCreate.productVariant,
|
||||
];
|
||||
createWaitingForCaptureOrder({
|
||||
channelSlug: defaultChannel.slug,
|
||||
email: "example@example.com",
|
||||
variantsList: variants,
|
||||
shippingMethodName: shippingMethod.name,
|
||||
address
|
||||
address,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -26,14 +26,14 @@ describe("As an admin I should be able to create order with variant without SKU"
|
|||
variantsList,
|
||||
defaultChannel,
|
||||
shippingMethod,
|
||||
address: addressResp
|
||||
address: addressResp,
|
||||
}) => {
|
||||
variants = variantsList;
|
||||
channel = defaultChannel;
|
||||
shippingMethodId = shippingMethod.id;
|
||||
address = addressResp;
|
||||
createCustomer(`${name}@example.com`, name, address, true);
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(customerResp => {
|
||||
const customer = customerResp.user;
|
||||
|
@ -42,12 +42,12 @@ describe("As an admin I should be able to create order with variant without SKU"
|
|||
channelId: channel.id,
|
||||
customerId: customer.id,
|
||||
shippingMethodId,
|
||||
variantsList: variants
|
||||
variantsList: variants,
|
||||
});
|
||||
})
|
||||
.then(({ errors }) => {
|
||||
expect(errors, "check if no errors").to.be.empty;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -9,26 +9,26 @@ import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors";
|
|||
import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
|
||||
import {
|
||||
productDetailsUrl,
|
||||
productVariantDetailUrl
|
||||
productVariantDetailUrl,
|
||||
} from "../../../fixtures/urlList";
|
||||
import {
|
||||
createVariant,
|
||||
getVariant
|
||||
getVariant,
|
||||
} from "../../../support/api/requests/Product";
|
||||
import {
|
||||
createTypeProduct,
|
||||
productAttributeAssignmentUpdate
|
||||
productAttributeAssignmentUpdate,
|
||||
} from "../../../support/api/requests/ProductType";
|
||||
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
|
||||
import { createWaitingForCaptureOrder } from "../../../support/api/utils/ordersUtils";
|
||||
import {
|
||||
createProductInChannelWithoutVariants,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../../support/api/utils/products/productsUtils";
|
||||
import {
|
||||
createShipping,
|
||||
deleteShippingStartsWith
|
||||
deleteShippingStartsWith,
|
||||
} from "../../../support/api/utils/shippingUtils";
|
||||
|
||||
describe("Updating products without sku", () => {
|
||||
|
@ -63,7 +63,7 @@ describe("Updating products without sku", () => {
|
|||
createShipping({
|
||||
channelId: defaultChannel.id,
|
||||
name,
|
||||
address
|
||||
address,
|
||||
});
|
||||
})
|
||||
.then(
|
||||
|
@ -71,40 +71,40 @@ describe("Updating products without sku", () => {
|
|||
warehouse = warehouseResp;
|
||||
shippingMethod = shippingMethodResp;
|
||||
createTypeAttributeAndCategoryForProduct({ name, attributeValues });
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(
|
||||
({
|
||||
attribute: attributeResp,
|
||||
productType: productTypeResp,
|
||||
category: categoryResp
|
||||
category: categoryResp,
|
||||
}) => {
|
||||
attribute = attributeResp;
|
||||
productTypeWithVariants = productTypeResp;
|
||||
category = categoryResp;
|
||||
productAttributeAssignmentUpdate({
|
||||
productTypeId: productTypeWithVariants.id,
|
||||
attributeId: attribute.id
|
||||
attributeId: attribute.id,
|
||||
});
|
||||
createTypeProduct({
|
||||
name: productTypeWithoutVariantsName,
|
||||
attributeId: attribute.id,
|
||||
hasVariants: false
|
||||
hasVariants: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(productTypeResp => {
|
||||
productTypeWithoutVariants = productTypeResp;
|
||||
productAttributeAssignmentUpdate({
|
||||
productTypeId: productTypeWithoutVariants.id,
|
||||
attributeId: attribute.id
|
||||
attributeId: attribute.id,
|
||||
});
|
||||
createProductInChannelWithoutVariants({
|
||||
name,
|
||||
channelId: defaultChannel.id,
|
||||
attributeId: attribute.id,
|
||||
productTypeId: productTypeWithVariants.id,
|
||||
categoryId: category.id
|
||||
categoryId: category.id,
|
||||
});
|
||||
})
|
||||
.then(productResp => (product = productResp));
|
||||
|
@ -126,7 +126,7 @@ describe("Updating products without sku", () => {
|
|||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
channelId: defaultChannel.id,
|
||||
productTypeId: productTypeWithoutVariants.id
|
||||
productTypeId: productTypeWithoutVariants.id,
|
||||
})
|
||||
.then(productResp => {
|
||||
simpleProduct = productResp;
|
||||
|
@ -134,12 +134,12 @@ describe("Updating products without sku", () => {
|
|||
productId: simpleProduct.id,
|
||||
channelId: defaultChannel.id,
|
||||
warehouseId: warehouse.id,
|
||||
quantityInWarehouse: 10
|
||||
quantityInWarehouse: 10,
|
||||
});
|
||||
})
|
||||
.then(variantsList => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productDetailsUrl(simpleProduct.id)
|
||||
productDetailsUrl(simpleProduct.id),
|
||||
)
|
||||
.get(SHARED_ELEMENTS.skeleton)
|
||||
.should("not.exist")
|
||||
|
@ -154,7 +154,7 @@ describe("Updating products without sku", () => {
|
|||
.then(variantResp => {
|
||||
expect(variantResp.sku).to.eq(sku);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -169,12 +169,12 @@ describe("Updating products without sku", () => {
|
|||
productId: product.id,
|
||||
quantityInWarehouse: 10,
|
||||
warehouseId: warehouse.id,
|
||||
attributeName: attributeValues[0]
|
||||
attributeName: attributeValues[0],
|
||||
})
|
||||
.then(variantResp => {
|
||||
variant = variantResp[0];
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productVariantDetailUrl(product.id, variant.id)
|
||||
productVariantDetailUrl(product.id, variant.id),
|
||||
)
|
||||
.get(SHARED_ELEMENTS.skeleton)
|
||||
.should("not.exist")
|
||||
|
@ -189,7 +189,7 @@ describe("Updating products without sku", () => {
|
|||
.then(variantResp => {
|
||||
expect(variantResp.sku).to.equal(sku);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -204,12 +204,12 @@ describe("Updating products without sku", () => {
|
|||
quantityInWarehouse: 10,
|
||||
warehouseId: warehouse.id,
|
||||
sku: name,
|
||||
attributeName: attributeValues[1]
|
||||
attributeName: attributeValues[1],
|
||||
})
|
||||
.then(variantResp => {
|
||||
variant = variantResp[0];
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productVariantDetailUrl(product.id, variant.id)
|
||||
productVariantDetailUrl(product.id, variant.id),
|
||||
)
|
||||
.get(SHARED_ELEMENTS.skeleton)
|
||||
.should("not.exist")
|
||||
|
@ -225,7 +225,7 @@ describe("Updating products without sku", () => {
|
|||
expect(variantResp.sku).to.be.null;
|
||||
checkIfCheckoutForVariantCanBeCompleted(variantResp);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -239,7 +239,7 @@ describe("Updating products without sku", () => {
|
|||
attributeId: attribute.id,
|
||||
categoryId: category.id,
|
||||
channelId: defaultChannel.id,
|
||||
productTypeId: productTypeWithoutVariants.id
|
||||
productTypeId: productTypeWithoutVariants.id,
|
||||
})
|
||||
.then(productResp => {
|
||||
simpleProduct = productResp;
|
||||
|
@ -248,12 +248,12 @@ describe("Updating products without sku", () => {
|
|||
channelId: defaultChannel.id,
|
||||
sku: simpleProductName,
|
||||
quantityInWarehouse: 10,
|
||||
warehouseId: warehouse.id
|
||||
warehouseId: warehouse.id,
|
||||
});
|
||||
})
|
||||
.then(variantsList => {
|
||||
cy.visitAndWaitForProgressBarToDisappear(
|
||||
productDetailsUrl(simpleProduct.id)
|
||||
productDetailsUrl(simpleProduct.id),
|
||||
)
|
||||
.get(SHARED_ELEMENTS.skeleton)
|
||||
.should("not.exist")
|
||||
|
@ -269,7 +269,7 @@ describe("Updating products without sku", () => {
|
|||
expect(variantResp.sku).to.be.null;
|
||||
checkIfCheckoutForVariantCanBeCompleted(variantResp);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
function checkIfCheckoutForVariantCanBeCompleted(variant) {
|
||||
|
@ -278,7 +278,7 @@ describe("Updating products without sku", () => {
|
|||
channelSlug: defaultChannel.slug,
|
||||
email,
|
||||
shippingMethodName: shippingMethod.name,
|
||||
variantsList: [variant]
|
||||
variantsList: [variant],
|
||||
}).then(({ order }) => {
|
||||
expect(order.id).to.be.ok;
|
||||
});
|
||||
|
|
|
@ -16,7 +16,7 @@ import { expectCorrectProductInformation } from "../../support/api/utils/product
|
|||
import {
|
||||
createProductInChannel,
|
||||
createTypeAttributeAndCategoryForProduct,
|
||||
deleteProductsStartsWith
|
||||
deleteProductsStartsWith,
|
||||
} from "../../support/api/utils/products/productsUtils";
|
||||
import { metadataForms } from "../../support/pages/catalog/metadataComponent";
|
||||
import { fillUpCommonFieldsForAllProductTypes } from "../../support/pages/catalog/products/productDetailsPage";
|
||||
|
@ -53,7 +53,7 @@ describe("Update products", () => {
|
|||
channelId: defaultChannel.id,
|
||||
name,
|
||||
collectionId: collection.id,
|
||||
description
|
||||
description,
|
||||
});
|
||||
})
|
||||
.then(({ product: productResp }) => {
|
||||
|
@ -76,29 +76,29 @@ describe("Update products", () => {
|
|||
generalInfo: {
|
||||
name: updatedName,
|
||||
description: faker.lorem.sentence(),
|
||||
rating: 3
|
||||
rating: 3,
|
||||
},
|
||||
seo: {
|
||||
slug: updatedName,
|
||||
title: "newTitle",
|
||||
description: "New description."
|
||||
description: "New description.",
|
||||
},
|
||||
metadata: {
|
||||
private: {
|
||||
metadataForm: metadataForms.private,
|
||||
name: "newPrivate",
|
||||
value: "value1"
|
||||
value: "value1",
|
||||
},
|
||||
public: {
|
||||
metadataForm: metadataForms.public,
|
||||
name: "newPublic",
|
||||
value: "value2"
|
||||
}
|
||||
value: "value2",
|
||||
},
|
||||
},
|
||||
productOrganization: {
|
||||
category: updatedCategory.name,
|
||||
collection: updatedCollection.name
|
||||
}
|
||||
collection: updatedCollection.name,
|
||||
},
|
||||
};
|
||||
cy.clearSessionData()
|
||||
.loginUserViaRequest("auth", ONE_PERMISSION_USERS.product)
|
||||
|
@ -120,7 +120,7 @@ describe("Update products", () => {
|
|||
cy.loginUserViaRequest("token")
|
||||
.then(() => {
|
||||
getProductDetails(product.id, defaultChannel.slug, "auth").its(
|
||||
"body.data.product"
|
||||
"body.data.product",
|
||||
);
|
||||
})
|
||||
.then(resp => {
|
||||
|
@ -148,8 +148,8 @@ describe("Update products", () => {
|
|||
})
|
||||
.then(
|
||||
productResp =>
|
||||
expect(productResp.product, "Check if product exist").to.be.null
|
||||
expect(productResp.product, "Check if product exist").to.be.null,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -12,19 +12,19 @@ import { urlList, userDetailsUrl } from "../fixtures/urlList";
|
|||
import { updatePlugin } from "../support/api/requests/Plugins";
|
||||
import {
|
||||
deleteStaffMembersStartsWith,
|
||||
updateStaffMember
|
||||
updateStaffMember,
|
||||
} from "../support/api/requests/StaffMembers";
|
||||
import {
|
||||
getMailActivationLinkForUser,
|
||||
getMailActivationLinkForUserAndSubject,
|
||||
inviteStaffMemberWithFirstPermission
|
||||
inviteStaffMemberWithFirstPermission,
|
||||
} from "../support/api/utils/users";
|
||||
import { expectWelcomeMessageIncludes } from "../support/pages/homePage";
|
||||
import { getDisplayedSelectors } from "../support/pages/permissionsPage";
|
||||
import {
|
||||
fillUpSetPassword,
|
||||
fillUpUserDetails,
|
||||
updateUserActiveFlag
|
||||
updateUserActiveFlag,
|
||||
} from "../support/pages/userPage";
|
||||
|
||||
describe("Staff members", () => {
|
||||
|
@ -82,11 +82,11 @@ describe("Staff members", () => {
|
|||
.then(tokenCreate => {
|
||||
expect(
|
||||
tokenCreate.errors[0].code,
|
||||
"logging in should return error"
|
||||
"logging in should return error",
|
||||
).to.be.eq("INACTIVE");
|
||||
expect(tokenCreate.token).to.be.not.ok;
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it("should activate user", { tags: ["@staffMembers", "@stagedOnly"] }, () => {
|
||||
|
@ -117,10 +117,10 @@ describe("Staff members", () => {
|
|||
getDisplayedSelectors().then(displayedSelectors => {
|
||||
expect(Object.values(displayedSelectors)).to.have.length(1);
|
||||
expect(Object.values(displayedSelectors)[0]).to.eq(
|
||||
LEFT_MENU_SELECTORS.home
|
||||
LEFT_MENU_SELECTORS.home,
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -131,7 +131,7 @@ describe("Staff members", () => {
|
|||
updatePlugin(
|
||||
"mirumee.notifications.admin_email",
|
||||
"staff_password_reset_subject",
|
||||
"Reset"
|
||||
"Reset",
|
||||
)
|
||||
.then(() => {
|
||||
cy.clearSessionData()
|
||||
|
@ -156,6 +156,6 @@ describe("Staff members", () => {
|
|||
.should("be.visible")
|
||||
.loginUserViaRequest({ email, password: newPassword });
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@ import faker from "faker";
|
|||
import {
|
||||
createCategory,
|
||||
getCategory,
|
||||
updateCategoryTranslation
|
||||
updateCategoryTranslation,
|
||||
} from "../support/api/requests/Category";
|
||||
import { deleteCategoriesStartsWith } from "../support/api/utils/catalog/categoryUtils";
|
||||
import { updateTranslationToCategory } from "../support/pages/translationsPage";
|
||||
|
@ -22,7 +22,7 @@ xdescribe("As an admin I want to manage translations", () => {
|
|||
cy.clearSessionData().loginUserViaRequest();
|
||||
deleteCategoriesStartsWith(startsWith);
|
||||
createCategory({ name: startsWith }).then(
|
||||
categoryResp => (category = categoryResp)
|
||||
categoryResp => (category = categoryResp),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -44,19 +44,19 @@ xdescribe("As an admin I want to manage translations", () => {
|
|||
translatedName,
|
||||
translatedDescription,
|
||||
translatedSeoTitle,
|
||||
translatedSeoDescription
|
||||
translatedSeoDescription,
|
||||
});
|
||||
getCategory(category.id, "PL").then(({ translation }) => {
|
||||
expect(translation.name).to.eq(`TranslatedName${randomNumber}`);
|
||||
expect(translation.description).to.includes(
|
||||
`TranslatedDescription${randomNumber}`
|
||||
`TranslatedDescription${randomNumber}`,
|
||||
);
|
||||
expect(translation.seoTitle).to.eq(`TranslatedSeoTitle${randomNumber}`);
|
||||
expect(translation.seoDescription).to.eq(
|
||||
`TranslatedSeoDescription${randomNumber}`
|
||||
`TranslatedSeoDescription${randomNumber}`,
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it(
|
||||
|
@ -76,7 +76,7 @@ xdescribe("As an admin I want to manage translations", () => {
|
|||
seoTitle: "test",
|
||||
seoDescription: "test",
|
||||
name: "test",
|
||||
description: "test"
|
||||
description: "test",
|
||||
})
|
||||
.then(() => {
|
||||
updateTranslationToCategory({
|
||||
|
@ -84,7 +84,7 @@ xdescribe("As an admin I want to manage translations", () => {
|
|||
translatedName: nameUpdate,
|
||||
translatedDescription: descriptionUpdate,
|
||||
translatedSeoTitle: seoTitleUpdate,
|
||||
translatedSeoDescription: seoDescriptionUpdate
|
||||
translatedSeoDescription: seoDescriptionUpdate,
|
||||
});
|
||||
getCategory(category.id, "PL");
|
||||
})
|
||||
|
@ -94,6 +94,6 @@ xdescribe("As an admin I want to manage translations", () => {
|
|||
expect(translation.seoTitle).to.eq(seoTitleUpdate);
|
||||
expect(translation.seoDescription).to.includes(seoDescriptionUpdate);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -5,8 +5,8 @@ export function expectCorrectDataInAttribute(
|
|||
attributeType,
|
||||
entityType = null,
|
||||
unit = null,
|
||||
valueRequired = true
|
||||
}
|
||||
valueRequired = true,
|
||||
},
|
||||
) {
|
||||
expect(attribute.name).to.eq(attributeName);
|
||||
expect(attribute.slug).to.eq(attributeName);
|
||||
|
|
|
@ -4,7 +4,7 @@ export function expectCorrectProductInformation(productResp, productData) {
|
|||
expectCorrectMetadataInfo(productResp.metadata, productData.metadata.public);
|
||||
expectCorrectMetadataInfo(
|
||||
productResp.privateMetadata,
|
||||
productData.metadata.private
|
||||
productData.metadata.private,
|
||||
);
|
||||
expectCorrectProductOrgInfo(productResp, productData.productOrganization);
|
||||
expectCorrectAttribute(productResp.attributes, productData.attribute);
|
||||
|
@ -13,22 +13,22 @@ export function expectCorrectProductInformation(productResp, productData) {
|
|||
export function expectCorrectProductVariantInformation(
|
||||
variantsResp,
|
||||
variantName,
|
||||
prices
|
||||
prices,
|
||||
) {
|
||||
expect(variantsResp).to.have.length(1);
|
||||
expect(variantsResp[0].sku).to.be.eq(variantName);
|
||||
expect(variantsResp[0].channelListings[0].costPrice.amount).to.be.eq(
|
||||
prices.costPrice
|
||||
prices.costPrice,
|
||||
);
|
||||
expect(variantsResp[0].channelListings[0].price.amount).to.be.eq(
|
||||
prices.sellingPrice
|
||||
prices.sellingPrice,
|
||||
);
|
||||
}
|
||||
|
||||
function expectCorrectGeneralInformation(productResp, generalInfo) {
|
||||
expect(productResp.name, "Check product name").to.be.eq(generalInfo.name);
|
||||
expect(productResp.description, "Check product description").includes(
|
||||
generalInfo.description
|
||||
generalInfo.description,
|
||||
);
|
||||
expect(productResp.rating, "Check product rate").to.be.eq(generalInfo.rating);
|
||||
}
|
||||
|
@ -37,39 +37,39 @@ function expectCorrectSeoInfo(productResp, seo) {
|
|||
expect(productResp.slug, "Check product slug").to.be.eq(seo.slug);
|
||||
expect(productResp.seoTitle, "Check product seo title").to.be.eq(seo.title);
|
||||
expect(productResp.seoDescription, "Check product seo description").to.be.eq(
|
||||
seo.description
|
||||
seo.description,
|
||||
);
|
||||
}
|
||||
|
||||
function expectCorrectMetadataInfo(metadataResp, expectedMetadata) {
|
||||
expect(metadataResp, "Check metadata fields length").to.have.length(1);
|
||||
expect(metadataResp[0].key, "Check product metadata key").to.be.eq(
|
||||
expectedMetadata.name
|
||||
expectedMetadata.name,
|
||||
);
|
||||
expect(metadataResp[0].value, "Check product metadata value").to.be.eq(
|
||||
expectedMetadata.value
|
||||
expectedMetadata.value,
|
||||
);
|
||||
}
|
||||
|
||||
function expectCorrectProductOrgInfo(productResp, productOrganization) {
|
||||
expect(productResp.productType.name, "Check product type name").to.be.eq(
|
||||
productOrganization.productType
|
||||
productOrganization.productType,
|
||||
);
|
||||
expect(productResp.category.name, "Check category name").to.be.eq(
|
||||
productOrganization.category
|
||||
productOrganization.category,
|
||||
);
|
||||
expect(
|
||||
productResp.collections,
|
||||
"Check length of assigned collections"
|
||||
"Check length of assigned collections",
|
||||
).to.have.length(1);
|
||||
expect(productResp.collections[0].name, "Check collection name").to.be.eq(
|
||||
productOrganization.collection
|
||||
productOrganization.collection,
|
||||
);
|
||||
}
|
||||
|
||||
function expectCorrectAttribute(attributes, attribute) {
|
||||
expect(attributes).to.have.length(1);
|
||||
expect(attributes[0].attribute.name, "Check attribute name").to.be.eq(
|
||||
attribute.name
|
||||
attribute.name,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements";
|
|||
|
||||
Cypress.Commands.add("assertVisibility", selector => {
|
||||
cy.get(selector).then(
|
||||
element => expect(element, "element should be visible").to.be.visible
|
||||
element => expect(element, "element should be visible").to.be.visible,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -10,26 +10,26 @@ Cypress.Commands.add(
|
|||
"expectCorrectBasicAddress",
|
||||
(responseAddress, expectedAddress) => {
|
||||
expect(responseAddress.city.toUpperCase()).to.eq(
|
||||
expectedAddress.city.toUpperCase()
|
||||
expectedAddress.city.toUpperCase(),
|
||||
);
|
||||
expect(responseAddress).to.have.property(
|
||||
"countryArea",
|
||||
expectedAddress.countryArea
|
||||
expectedAddress.countryArea,
|
||||
);
|
||||
expect(responseAddress).to.have.property("phone", expectedAddress.phone);
|
||||
expect(responseAddress).to.have.property(
|
||||
"postalCode",
|
||||
expectedAddress.postalCode
|
||||
expectedAddress.postalCode,
|
||||
);
|
||||
expect(responseAddress).to.have.property(
|
||||
"streetAddress1",
|
||||
expectedAddress.streetAddress1
|
||||
expectedAddress.streetAddress1,
|
||||
);
|
||||
expect(responseAddress).to.have.property(
|
||||
"streetAddress2",
|
||||
expectedAddress.streetAddress2
|
||||
expectedAddress.streetAddress2,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Cypress.Commands.add(
|
||||
|
@ -37,14 +37,14 @@ Cypress.Commands.add(
|
|||
(responseAddress, expectedAddress) => {
|
||||
expect(responseAddress).to.have.property(
|
||||
"firstName",
|
||||
expectedAddress.firstName
|
||||
expectedAddress.firstName,
|
||||
);
|
||||
expect(responseAddress).to.have.property(
|
||||
"firstName",
|
||||
expectedAddress.lastName
|
||||
expectedAddress.lastName,
|
||||
);
|
||||
cy.expectCorrectBasicAddress(responseAddress, expectedAddress);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Cypress.Commands.add("expectSkeletonIsVisible", () => {
|
||||
|
@ -55,7 +55,7 @@ Cypress.Commands.add("expectSkeletonIsVisible", () => {
|
|||
cy.assertVisibility(SHARED_ELEMENTS.skeleton);
|
||||
} else {
|
||||
expect(
|
||||
$body.find(SHARED_ELEMENTS.skeleton, "skeleton should exist").length
|
||||
$body.find(SHARED_ELEMENTS.skeleton, "skeleton should exist").length,
|
||||
).to.be.eq(1);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -58,7 +58,7 @@ function cypressGrepPlugin(config) {
|
|||
const specFiles = globby.sync(specPattern, {
|
||||
cwd: integrationFolder,
|
||||
ignore: excludeSpecPattern,
|
||||
absolute: true
|
||||
absolute: true,
|
||||
});
|
||||
debug("found %d spec files", specFiles.length);
|
||||
debug("%o", specFiles);
|
||||
|
@ -66,7 +66,7 @@ function cypressGrepPlugin(config) {
|
|||
if (grep) {
|
||||
console.log(
|
||||
'cypress-grep: filtering specs using "%s" in the title',
|
||||
grep
|
||||
grep,
|
||||
);
|
||||
const parsedGrep = parseGrep(grep);
|
||||
debug("parsed grep %o", parsedGrep);
|
||||
|
|
|
@ -91,7 +91,7 @@ function cypressGrep() {
|
|||
parsedGrep,
|
||||
nameToGrep,
|
||||
tagsToGrep,
|
||||
grepUntagged
|
||||
grepUntagged,
|
||||
);
|
||||
|
||||
if (tagsToGrep && tagsToGrep.length) {
|
||||
|
@ -99,7 +99,7 @@ function cypressGrep() {
|
|||
'should test "%s" with tags %s run? %s',
|
||||
name,
|
||||
tagsToGrep.join(","),
|
||||
shouldRun
|
||||
shouldRun,
|
||||
);
|
||||
} else {
|
||||
debug('should test "%s" run? %s', nameToGrep, shouldRun);
|
||||
|
|
|
@ -16,12 +16,12 @@ function parseTitleGrep(s) {
|
|||
if (s.startsWith("-")) {
|
||||
return {
|
||||
title: s.substring(1),
|
||||
invert: true
|
||||
invert: true,
|
||||
};
|
||||
}
|
||||
return {
|
||||
title: s,
|
||||
invert: false
|
||||
invert: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ function parseTagsGrep(s) {
|
|||
if (part.startsWith("--")) {
|
||||
explicitNotTags.push({
|
||||
tag: part.slice(2),
|
||||
invert: true
|
||||
invert: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -63,12 +63,12 @@ function parseTagsGrep(s) {
|
|||
if (tag.startsWith("-")) {
|
||||
return {
|
||||
tag: tag.slice(1),
|
||||
invert: true
|
||||
invert: true,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
tag,
|
||||
invert: false
|
||||
invert: false,
|
||||
};
|
||||
}
|
||||
});
|
||||
|
@ -162,7 +162,7 @@ function shouldTestRun(parsedGrep, testName, tags = [], grepUntagged = false) {
|
|||
function parseGrep(titlePart, tags) {
|
||||
return {
|
||||
title: parseFullTitleGrep(titlePart),
|
||||
tags: parseTagsGrep(tags)
|
||||
tags: parseTagsGrep(tags),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -178,8 +178,8 @@ function resolveConfig(config) {
|
|||
resolvedConfig: {
|
||||
specPattern,
|
||||
excludeSpecPattern,
|
||||
integrationFolder
|
||||
}
|
||||
integrationFolder,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -191,5 +191,5 @@ module.exports = {
|
|||
resolveConfig,
|
||||
shouldTestRun,
|
||||
shouldTestRunTags,
|
||||
shouldTestRunTitle
|
||||
shouldTestRunTitle,
|
||||
};
|
||||
|
|
|
@ -54,26 +54,26 @@ Cypress.Commands.add(
|
|||
.request({
|
||||
body: {
|
||||
variables,
|
||||
query
|
||||
query,
|
||||
},
|
||||
headers: {
|
||||
Authorization: `JWT ${window.sessionStorage.getItem(authorization)}`
|
||||
Authorization: `JWT ${window.sessionStorage.getItem(authorization)}`,
|
||||
},
|
||||
method: "POST",
|
||||
url: urlList.apiUri,
|
||||
log: true
|
||||
log: true,
|
||||
})
|
||||
.then(response => {
|
||||
const respInSting = JSON.stringify(response.body);
|
||||
if (respInSting.includes(`"errors":[{`)) {
|
||||
cy.log(query).log(JSON.stringify(response.body));
|
||||
}
|
||||
})
|
||||
}),
|
||||
);
|
||||
Cypress.on(
|
||||
"uncaught:exception",
|
||||
(err, runnable) =>
|
||||
// returning false here prevents Cypress from
|
||||
// failing the test
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
|
12
cypress/support/index.d.ts
vendored
12
cypress/support/index.d.ts
vendored
|
@ -5,21 +5,21 @@ declare namespace Cypress {
|
|||
element: {},
|
||||
deleteFunction: function,
|
||||
startsWith: string,
|
||||
name: string
|
||||
name: string,
|
||||
): Chainable<any>;
|
||||
deleteElementsStartsWith(
|
||||
deleteFunction: function,
|
||||
getFunction: function,
|
||||
startsWith: string,
|
||||
name? = string
|
||||
name? = string,
|
||||
): Chainable<any>;
|
||||
expectCorrectFullAddress(
|
||||
responseAddress: string,
|
||||
expectedAddress: string
|
||||
expectedAddress: string,
|
||||
): Chainable<any>;
|
||||
expectCorrectBasicAddress(
|
||||
responseAddress: string,
|
||||
expectedAddress: string
|
||||
expectedAddress: string,
|
||||
): Chainable<any>;
|
||||
getTextFromElement(element: {}): Chainable<any>;
|
||||
clearAndType(subject: {}, text: string): Chainable<any>;
|
||||
|
@ -38,7 +38,7 @@ declare namespace Cypress {
|
|||
fillBaseSelect(selectSelector: string, value: string): Chainable<any>;
|
||||
fillAutocompleteSelect(
|
||||
selectSelector: string,
|
||||
option?: string
|
||||
option?: string,
|
||||
): Chainable<any>;
|
||||
addAliasToGraphRequest(alias: string): Chainable<any>;
|
||||
sendRequestWithQuery(query: string): Chainable<any>;
|
||||
|
@ -48,7 +48,7 @@ declare namespace Cypress {
|
|||
elementsGraphqlAlias: string,
|
||||
elementsName: string,
|
||||
elementsIds: string,
|
||||
actionFunction
|
||||
actionFunction,
|
||||
}): Chainable<any>;
|
||||
searchInTable(query: string): Chainable<any>;
|
||||
waitForRequestAndCheckIfNoErrors(alias: string): Chainable<any>;
|
||||
|
|
|
@ -2,7 +2,7 @@ import { PRODUCTS_LIST } from "../../../../elements/catalog/products/products-li
|
|||
import { BUTTON_SELECTORS } from "../../../../elements/shared/button-selectors";
|
||||
import {
|
||||
getElementByDataTestId,
|
||||
SHARED_ELEMENTS
|
||||
SHARED_ELEMENTS,
|
||||
} from "../../../../elements/shared/sharedElements";
|
||||
import { urlList } from "../../../../fixtures/urlList";
|
||||
|
||||
|
@ -21,7 +21,7 @@ export function isNumberOfProductsSameAsInSelectResultsOnPage() {
|
|||
getDisplayedColumnArray("name");
|
||||
})
|
||||
.then(
|
||||
productsList => productsList.length === parseInt(numberOfResults, 10)
|
||||
productsList => productsList.length === parseInt(numberOfResults, 10),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ export function selectAttributeFilter(attributeSlug, attributeValue) {
|
|||
cy.get(
|
||||
`${getElementByDataTestId(attributeSlug)}${
|
||||
PRODUCTS_LIST.filters.filterField.filterField
|
||||
}`
|
||||
}`,
|
||||
)
|
||||
.find(PRODUCTS_LIST.filters.filterOption)
|
||||
.should("be.visible")
|
||||
|
@ -87,7 +87,7 @@ export function selectFilterByAttribute(attributeSlug) {
|
|||
.get(
|
||||
`${getElementByDataTestId(attributeSlug)}${
|
||||
SHARED_ELEMENTS.filters.filterGroupActivateCheckbox
|
||||
}`
|
||||
}`,
|
||||
)
|
||||
.click();
|
||||
}
|
||||
|
|
|
@ -10,14 +10,14 @@ import { selectChannelInDetailsPages } from "../channelsPage";
|
|||
|
||||
export const discountOptions = {
|
||||
PERCENTAGE: SALES_SELECTORS.percentageOption,
|
||||
FIXED: SALES_SELECTORS.fixedOption
|
||||
FIXED: SALES_SELECTORS.fixedOption,
|
||||
};
|
||||
|
||||
export function createSale({
|
||||
saleName,
|
||||
channelName,
|
||||
discountValue = 10,
|
||||
discountOption = discountOptions.PERCENTAGE
|
||||
discountOption = discountOptions.PERCENTAGE,
|
||||
}) {
|
||||
const todaysDate = formatDate(new Date());
|
||||
|
||||
|
@ -83,7 +83,7 @@ export function createSaleWithNewProduct({
|
|||
categoryId,
|
||||
price,
|
||||
discountOption,
|
||||
discountValue
|
||||
discountValue,
|
||||
}) {
|
||||
return createProductInChannel({
|
||||
name,
|
||||
|
@ -92,7 +92,7 @@ export function createSaleWithNewProduct({
|
|||
productTypeId,
|
||||
attributeId,
|
||||
categoryId,
|
||||
price
|
||||
price,
|
||||
}).then(({ product: productResp }) => {
|
||||
/* Uncomment after fixing SALEOR-3367 bug
|
||||
cy.clearSessionData()
|
||||
|
@ -106,7 +106,7 @@ export function createSaleWithNewProduct({
|
|||
saleName: name,
|
||||
channelName: channel.name,
|
||||
discountValue,
|
||||
discountOption
|
||||
discountOption,
|
||||
});
|
||||
assignProducts(product.name);
|
||||
return getProductPrice(product.id, channel.slug);
|
||||
|
@ -122,7 +122,7 @@ export function createSaleWithNewVariant({
|
|||
categoryId,
|
||||
price,
|
||||
discountValue,
|
||||
discountOption
|
||||
discountOption,
|
||||
}) {
|
||||
return createProductInChannel({
|
||||
name,
|
||||
|
@ -131,7 +131,7 @@ export function createSaleWithNewVariant({
|
|||
productTypeId,
|
||||
attributeId,
|
||||
categoryId,
|
||||
price
|
||||
price,
|
||||
}).then(({ variantsList: variantsListResp, product }) => {
|
||||
/* Uncomment after fixing SALEOR-3367 bug
|
||||
cy.clearSessionData()
|
||||
|
@ -144,7 +144,7 @@ export function createSaleWithNewVariant({
|
|||
saleName: name,
|
||||
channelName: channel.name,
|
||||
discountValue,
|
||||
discountOption
|
||||
discountOption,
|
||||
});
|
||||
assignVariants(product.name, variant.name);
|
||||
return getVariant(variant.id, channel.slug, "token");
|
||||
|
|
|
@ -8,7 +8,7 @@ import { selectChannelInDetailsPages } from "../channelsPage";
|
|||
export const discountOptions = {
|
||||
PERCENTAGE: VOUCHERS_SELECTORS.percentageDiscountRadioButton,
|
||||
FIXED: VOUCHERS_SELECTORS.fixedDiscountRadioButton,
|
||||
SHIPPING: VOUCHERS_SELECTORS.shippingDiscountRadioButton
|
||||
SHIPPING: VOUCHERS_SELECTORS.shippingDiscountRadioButton,
|
||||
};
|
||||
|
||||
export function createVoucher({
|
||||
|
@ -20,7 +20,7 @@ export function createVoucher({
|
|||
applyOnePerCustomer,
|
||||
onlyStaff,
|
||||
minOrderValue,
|
||||
minAmountOfItems
|
||||
minAmountOfItems,
|
||||
}) {
|
||||
cy.get(VOUCHERS_SELECTORS.createVoucherButton).click();
|
||||
selectChannelInDetailsPages(channelName);
|
||||
|
@ -64,7 +64,7 @@ export function setVoucherDate({
|
|||
startDate,
|
||||
endDate,
|
||||
endTime,
|
||||
hasEndDate = false
|
||||
hasEndDate = false,
|
||||
}) {
|
||||
cy.visit(voucherDetailsUrl(voucherId)).waitForProgressBarToNotBeVisible();
|
||||
if (startDate) {
|
||||
|
@ -95,7 +95,7 @@ export function loginAndCreateCheckoutForVoucherWithDiscount({
|
|||
applyOnePerCustomer,
|
||||
onlyStaff,
|
||||
minOrderValue,
|
||||
minAmountOfItems
|
||||
minAmountOfItems,
|
||||
}) {
|
||||
cy.clearSessionData()
|
||||
.loginUserViaRequest("auth", ONE_PERMISSION_USERS.discount)
|
||||
|
@ -110,7 +110,7 @@ export function loginAndCreateCheckoutForVoucherWithDiscount({
|
|||
applyOnePerCustomer,
|
||||
onlyStaff,
|
||||
minOrderValue,
|
||||
minAmountOfItems
|
||||
minAmountOfItems,
|
||||
});
|
||||
dataForCheckout.voucherCode = voucherCode;
|
||||
return createCheckoutWithVoucher(dataForCheckout);
|
||||
|
|
Loading…
Reference in a new issue