Test variant selection fix (#3617)

* fixing attribute variants selection tests
This commit is contained in:
wojteknowacki 2023-05-10 14:03:33 +02:00 committed by GitHub
parent 2b87e8b141
commit 86932d1cd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6118 additions and 6079 deletions

View file

@ -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,8 +58,7 @@ describe("As an admin I want to use attributes in variant selection", () => {
name,
inputType,
attributeValues,
})
.then(({ productType: productTypeResp }) => {
}).then(({ productType: productTypeResp }) => {
productType = productTypeResp;
createProductInChannelWithoutVariants({
@ -66,7 +66,6 @@ describe("As an admin I want to use attributes in variant selection", () => {
productTypeId: productType.id,
name,
channelId: channel.id,
});
})
.then(productResp => {
product = productResp;
@ -81,19 +80,19 @@ describe("As an admin I want to use attributes in variant selection", () => {
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 }) => {
getVariant(variant.id, channel.slug).then(({ attributes }) => {
expect(attributes[0].attribute.inputType).to.eq(inputType);
cy.confirmationMessageShouldAppear();
});
});
});
},
);
});

View file

@ -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() {

View file

@ -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