Test variant selection fix (#3617)
* fixing attribute variants selection tests
This commit is contained in:
parent
2b87e8b141
commit
86932d1cd9
5 changed files with 6118 additions and 6079 deletions
|
@ -48,6 +48,7 @@ describe("As an admin I want to use attributes in variant selection", () => {
|
|||
const name = `${startsWith}${
|
||||
attributeType.key
|
||||
}${faker.datatype.number()}`;
|
||||
const variantName = `cypress_variant_${faker.datatype.number()}`;
|
||||
const inputType = attributeType.key;
|
||||
const attributeValues = ["1", "2"];
|
||||
let productType;
|
||||
|
@ -57,43 +58,41 @@ describe("As an admin I want to use attributes in variant selection", () => {
|
|||
name,
|
||||
inputType,
|
||||
attributeValues,
|
||||
})
|
||||
.then(({ productType: productTypeResp }) => {
|
||||
productType = productTypeResp;
|
||||
}).then(({ productType: productTypeResp }) => {
|
||||
productType = productTypeResp;
|
||||
|
||||
createProductInChannelWithoutVariants({
|
||||
categoryId: category.id,
|
||||
productTypeId: productType.id,
|
||||
name,
|
||||
channelId: channel.id,
|
||||
createProductInChannelWithoutVariants({
|
||||
categoryId: category.id,
|
||||
productTypeId: productType.id,
|
||||
name,
|
||||
channelId: channel.id,
|
||||
})
|
||||
.then(productResp => {
|
||||
product = productResp;
|
||||
|
||||
cy.visit(addVariantUrl(product.id)).addAliasToGraphRequest(
|
||||
"VariantCreate",
|
||||
);
|
||||
|
||||
fillUpVariantDetails({
|
||||
sku: name,
|
||||
attributeName: attributeValues[0],
|
||||
attributeType: inputType,
|
||||
costPrice: 10,
|
||||
price: 10,
|
||||
variantName,
|
||||
});
|
||||
cy.wait("@VariantCreate");
|
||||
})
|
||||
.then(({ response }) => {
|
||||
const variant =
|
||||
response.body.data.productVariantCreate.productVariant;
|
||||
getVariant(variant.id, channel.slug).then(({ attributes }) => {
|
||||
expect(attributes[0].attribute.inputType).to.eq(inputType);
|
||||
cy.confirmationMessageShouldAppear();
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(productResp => {
|
||||
product = productResp;
|
||||
|
||||
cy.visit(addVariantUrl(product.id)).addAliasToGraphRequest(
|
||||
"VariantCreate",
|
||||
);
|
||||
|
||||
fillUpVariantDetails({
|
||||
sku: name,
|
||||
attributeName: attributeValues[0],
|
||||
attributeType: inputType,
|
||||
costPrice: 10,
|
||||
price: 10,
|
||||
});
|
||||
|
||||
cy.wait("@VariantCreate");
|
||||
})
|
||||
.then(({ response }) => {
|
||||
const variant =
|
||||
response.body.data.productVariantCreate.productVariant;
|
||||
getVariant(variant.id, channel.slug);
|
||||
})
|
||||
.then(({ attributes }) => {
|
||||
expect(attributes[0].attribute.inputType).to.eq(inputType);
|
||||
cy.confirmationMessageShouldAppear();
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -161,7 +161,7 @@ export function selectOptionsAttribute(attributeName) {
|
|||
}
|
||||
|
||||
export function selectBooleanAttributeToTrue() {
|
||||
cy.get(VARIANTS_SELECTORS.booleanAttributeCheckbox).click();
|
||||
cy.get(VARIANTS_SELECTORS.attributeSelector).click();
|
||||
}
|
||||
|
||||
export function selectDateAttribute() {
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
const result: PossibleTypesResultData = {
|
||||
"possibleTypes": {
|
||||
"DeliveryMethod": [
|
||||
"ShippingMethod",
|
||||
"Warehouse"
|
||||
"Warehouse",
|
||||
"ShippingMethod"
|
||||
],
|
||||
"Event": [
|
||||
"AddressCreated",
|
||||
|
@ -284,48 +284,48 @@
|
|||
"Order"
|
||||
],
|
||||
"TranslatableItem": [
|
||||
"ProductTranslatableContent",
|
||||
"CollectionTranslatableContent",
|
||||
"CategoryTranslatableContent",
|
||||
"AttributeTranslatableContent",
|
||||
"AttributeValueTranslatableContent",
|
||||
"CategoryTranslatableContent",
|
||||
"CollectionTranslatableContent",
|
||||
"MenuItemTranslatableContent",
|
||||
"PageTranslatableContent",
|
||||
"ProductTranslatableContent",
|
||||
"ProductVariantTranslatableContent",
|
||||
"SaleTranslatableContent",
|
||||
"PageTranslatableContent",
|
||||
"ShippingMethodTranslatableContent",
|
||||
"VoucherTranslatableContent"
|
||||
"SaleTranslatableContent",
|
||||
"VoucherTranslatableContent",
|
||||
"MenuItemTranslatableContent"
|
||||
],
|
||||
"TranslationTypes": [
|
||||
"ProductTranslation",
|
||||
"CollectionTranslation",
|
||||
"CategoryTranslation",
|
||||
"AttributeTranslation",
|
||||
"AttributeValueTranslation",
|
||||
"CategoryTranslation",
|
||||
"CollectionTranslation",
|
||||
"MenuItemTranslation",
|
||||
"PageTranslation",
|
||||
"ProductTranslation",
|
||||
"ProductVariantTranslation",
|
||||
"SaleTranslation",
|
||||
"PageTranslation",
|
||||
"ShippingMethodTranslation",
|
||||
"VoucherTranslation"
|
||||
"SaleTranslation",
|
||||
"VoucherTranslation",
|
||||
"MenuItemTranslation"
|
||||
],
|
||||
"UserOrApp": [
|
||||
"App",
|
||||
"User"
|
||||
"User",
|
||||
"App"
|
||||
],
|
||||
"_Entity": [
|
||||
"Address",
|
||||
"App",
|
||||
"Address",
|
||||
"User",
|
||||
"Group",
|
||||
"ProductVariant",
|
||||
"Product",
|
||||
"ProductType",
|
||||
"ProductMedia",
|
||||
"Category",
|
||||
"Collection",
|
||||
"Group",
|
||||
"Order",
|
||||
"PageType",
|
||||
"Product",
|
||||
"ProductMedia",
|
||||
"ProductType",
|
||||
"ProductVariant",
|
||||
"User"
|
||||
"PageType"
|
||||
]
|
||||
}
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue