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}${
|
const name = `${startsWith}${
|
||||||
attributeType.key
|
attributeType.key
|
||||||
}${faker.datatype.number()}`;
|
}${faker.datatype.number()}`;
|
||||||
|
const variantName = `cypress_variant_${faker.datatype.number()}`;
|
||||||
const inputType = attributeType.key;
|
const inputType = attributeType.key;
|
||||||
const attributeValues = ["1", "2"];
|
const attributeValues = ["1", "2"];
|
||||||
let productType;
|
let productType;
|
||||||
|
@ -57,43 +58,41 @@ describe("As an admin I want to use attributes in variant selection", () => {
|
||||||
name,
|
name,
|
||||||
inputType,
|
inputType,
|
||||||
attributeValues,
|
attributeValues,
|
||||||
})
|
}).then(({ productType: productTypeResp }) => {
|
||||||
.then(({ productType: productTypeResp }) => {
|
productType = productTypeResp;
|
||||||
productType = productTypeResp;
|
|
||||||
|
|
||||||
createProductInChannelWithoutVariants({
|
createProductInChannelWithoutVariants({
|
||||||
categoryId: category.id,
|
categoryId: category.id,
|
||||||
productTypeId: productType.id,
|
productTypeId: productType.id,
|
||||||
name,
|
name,
|
||||||
channelId: channel.id,
|
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() {
|
export function selectBooleanAttributeToTrue() {
|
||||||
cy.get(VARIANTS_SELECTORS.booleanAttributeCheckbox).click();
|
cy.get(VARIANTS_SELECTORS.attributeSelector).click();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function selectDateAttribute() {
|
export function selectDateAttribute() {
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
const result: PossibleTypesResultData = {
|
const result: PossibleTypesResultData = {
|
||||||
"possibleTypes": {
|
"possibleTypes": {
|
||||||
"DeliveryMethod": [
|
"DeliveryMethod": [
|
||||||
"ShippingMethod",
|
"Warehouse",
|
||||||
"Warehouse"
|
"ShippingMethod"
|
||||||
],
|
],
|
||||||
"Event": [
|
"Event": [
|
||||||
"AddressCreated",
|
"AddressCreated",
|
||||||
|
@ -284,48 +284,48 @@
|
||||||
"Order"
|
"Order"
|
||||||
],
|
],
|
||||||
"TranslatableItem": [
|
"TranslatableItem": [
|
||||||
|
"ProductTranslatableContent",
|
||||||
|
"CollectionTranslatableContent",
|
||||||
|
"CategoryTranslatableContent",
|
||||||
"AttributeTranslatableContent",
|
"AttributeTranslatableContent",
|
||||||
"AttributeValueTranslatableContent",
|
"AttributeValueTranslatableContent",
|
||||||
"CategoryTranslatableContent",
|
|
||||||
"CollectionTranslatableContent",
|
|
||||||
"MenuItemTranslatableContent",
|
|
||||||
"PageTranslatableContent",
|
|
||||||
"ProductTranslatableContent",
|
|
||||||
"ProductVariantTranslatableContent",
|
"ProductVariantTranslatableContent",
|
||||||
"SaleTranslatableContent",
|
"PageTranslatableContent",
|
||||||
"ShippingMethodTranslatableContent",
|
"ShippingMethodTranslatableContent",
|
||||||
"VoucherTranslatableContent"
|
"SaleTranslatableContent",
|
||||||
|
"VoucherTranslatableContent",
|
||||||
|
"MenuItemTranslatableContent"
|
||||||
],
|
],
|
||||||
"TranslationTypes": [
|
"TranslationTypes": [
|
||||||
|
"ProductTranslation",
|
||||||
|
"CollectionTranslation",
|
||||||
|
"CategoryTranslation",
|
||||||
"AttributeTranslation",
|
"AttributeTranslation",
|
||||||
"AttributeValueTranslation",
|
"AttributeValueTranslation",
|
||||||
"CategoryTranslation",
|
|
||||||
"CollectionTranslation",
|
|
||||||
"MenuItemTranslation",
|
|
||||||
"PageTranslation",
|
|
||||||
"ProductTranslation",
|
|
||||||
"ProductVariantTranslation",
|
"ProductVariantTranslation",
|
||||||
"SaleTranslation",
|
"PageTranslation",
|
||||||
"ShippingMethodTranslation",
|
"ShippingMethodTranslation",
|
||||||
"VoucherTranslation"
|
"SaleTranslation",
|
||||||
|
"VoucherTranslation",
|
||||||
|
"MenuItemTranslation"
|
||||||
],
|
],
|
||||||
"UserOrApp": [
|
"UserOrApp": [
|
||||||
"App",
|
"User",
|
||||||
"User"
|
"App"
|
||||||
],
|
],
|
||||||
"_Entity": [
|
"_Entity": [
|
||||||
"Address",
|
|
||||||
"App",
|
"App",
|
||||||
|
"Address",
|
||||||
|
"User",
|
||||||
|
"Group",
|
||||||
|
"ProductVariant",
|
||||||
|
"Product",
|
||||||
|
"ProductType",
|
||||||
|
"ProductMedia",
|
||||||
"Category",
|
"Category",
|
||||||
"Collection",
|
"Collection",
|
||||||
"Group",
|
|
||||||
"Order",
|
"Order",
|
||||||
"PageType",
|
"PageType"
|
||||||
"Product",
|
|
||||||
"ProductMedia",
|
|
||||||
"ProductType",
|
|
||||||
"ProductVariant",
|
|
||||||
"User"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
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