Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CC-20625: Fixed abstract data builder to accurately incorporate the seed data provided. #52

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,16 @@ import { CheckoutMpScenario, CustomerLoginScenario } from '@scenarios/yves';
});

productsPage.visit();
productsPage.find({ query: dynamicFixtures.productConcreteForMerchant.abstract_sku }).click({ force: true });
productsPage.getDrawer().find(productsPage.getSaveButtonSelector()).click();
productsPage.find({ query: dynamicFixtures.productConcreteForMerchant.abstract_sku }).click();

productsPage.getDrawer().as('drawer');

cy.get('@drawer')
.find(productsPage.getTaxIdSetOptionSelector())
.eq(1)
.then((el) => cy.get(productsPage.getTaxIdSetSelector()).select(el.val() ?? '', { force: true }));

cy.get('@drawer').find(productsPage.getSaveButtonSelector()).click();

cy.get('body').contains('The Product is saved.');
});
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/yves/order-amendment/order-amendment-finish.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
assertOrderCancellationForPrevOrder();

customerOverviewPage.viewLastPlacedOrder();
customerOverviewPage.assertProductQuantity(dynamicFixtures.product1.name, 1);
customerOverviewPage.assertProductQuantity(dynamicFixtures.product2.name, 1);
customerOverviewPage.assertProductQuantity(dynamicFixtures.product1.localized_attributes[0].name, 1);
customerOverviewPage.assertProductQuantity(dynamicFixtures.product2.localized_attributes[0].name, 1);
});

it('customer should be able to finish amended order with updated product quantity', (): void => {
Expand All @@ -57,7 +57,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
assertOrderCancellationForPrevOrder();

customerOverviewPage.viewLastPlacedOrder();
customerOverviewPage.assertProductQuantity(dynamicFixtures.product1.name, 3);
customerOverviewPage.assertProductQuantity(dynamicFixtures.product1.localized_attributes[0].name, 3);
});

function assertOrderCancellationForPrevOrder(): void {
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/yves/order-amendment/order-amendment-start.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { DeactivateProductScenario } from '../../../support/scenarios/backoffice

cartPage.assertPageLocation();
cartPage.assertCartName(`Editing Order ${orderReference}`);
cy.get('body').contains(dynamicFixtures.product.name).should('exist');
cy.get('body').contains(dynamicFixtures.product.localized_attributes[0].name).should('exist');

customerOverviewPage.viewLastPlacedOrder();
orderDetailsPage.containsOrderState('Editing in Progress');
Expand Down Expand Up @@ -114,8 +114,8 @@ import { DeactivateProductScenario } from '../../../support/scenarios/backoffice
cy.contains(`Inactive item ${dynamicFixtures.productInActive.sku} was removed from your shopping cart.`).should(
'exist'
);
cy.get('body').contains(dynamicFixtures.product.name).should('exist');
cy.get('body').contains(dynamicFixtures.productInActive.name).should('not.exist');
cy.get('body').contains(dynamicFixtures.product.localized_attributes[0].name).should('exist');
cy.get('body').contains(dynamicFixtures.productInActive.localized_attributes[0].name).should('not.exist');
});

it('customer should not be able to amend order when item was out-of-stock', (): void => {
Expand All @@ -132,8 +132,8 @@ import { DeactivateProductScenario } from '../../../support/scenarios/backoffice

cartPage.assertPageLocation();
cy.contains(`Product ${dynamicFixtures.productOutOfStock.sku} is not available at the moment.`).should('exist');
cy.get('body').contains(dynamicFixtures.product.name).should('exist');
cy.get('body').contains(dynamicFixtures.productOutOfStock.name).should('not.exist');
cy.get('body').contains(dynamicFixtures.product.localized_attributes[0].name).should('exist');
cy.get('body').contains(dynamicFixtures.productOutOfStock.localized_attributes[0].name).should('not.exist');
});

function placeCustomerOrder(email: string, idCustomerAddress: number): void {
Expand Down
13 changes: 5 additions & 8 deletions cypress/e2e/yves/reorder/reorder-concrete-products.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
cartPage.assertPageLocation();
cartPage.assertCartName(`Reorder from Order ${orderReference}`);

cy.get('body').contains(dynamicFixtures.product1.name).should('exist');
cy.get('body').contains(dynamicFixtures.product2.name).should('exist');
cy.get('body').contains(dynamicFixtures.product1.localized_attributes[0].name).should('exist');
cy.get('body').contains(dynamicFixtures.product2.localized_attributes[0].name).should('exist');
});
});

Expand All @@ -45,8 +45,8 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
cartPage.assertPageLocation();
cartPage.assertCartName(`Reorder from Order ${orderReference}`);

cy.get('body').contains(dynamicFixtures.product1.name).should('exist');
cy.get('body').contains(dynamicFixtures.product2.name).should('not.exist');
cy.get('body').contains(dynamicFixtures.product1.localized_attributes[0].name).should('exist');
cy.get('body').contains(dynamicFixtures.product2.localized_attributes[0].name).should('not.exist');
});
});

Expand Down Expand Up @@ -75,10 +75,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
password: staticFixtures.defaultPassword,
});

checkoutScenario.execute({
idCustomerAddress: idCustomerAddress,
shouldTriggerOmsInCli: true,
});
checkoutScenario.execute({ idCustomerAddress: idCustomerAddress });
}
}
);
7 changes: 2 additions & 5 deletions cypress/e2e/yves/reorder/reorder-product-bundles.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
customerOverviewPage.viewLastPlacedOrder();
orderDetailsPage.reorderAll();

cy.get('body').contains(dynamicFixtures.productBundle.name).should('exist');
cy.get('body').contains(dynamicFixtures.productBundle.localized_attributes[0].name).should('exist');
});

function placeOrderWithProductBundle(): void {
Expand All @@ -41,10 +41,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.productBundle.sku });
productPage.addToCart();

checkoutScenario.execute({
idCustomerAddress: dynamicFixtures.address.id_customer_address,
shouldTriggerOmsInCli: true,
});
checkoutScenario.execute({ idCustomerAddress: dynamicFixtures.address.id_customer_address });
}
}
);
9 changes: 3 additions & 6 deletions cypress/e2e/yves/reorder/reorder-product-offers.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
cartPage.assertCartName(`Reorder from Order ${orderReference}`);

cy.get('body').contains(`Sold by ${dynamicFixtures.merchant1.name}`).should('exist');
cy.get('body').contains(dynamicFixtures.product1.name).should('exist');
cy.get('body').contains(dynamicFixtures.product1.localized_attributes[0].name).should('exist');

cy.get('body').contains(`Sold by ${dynamicFixtures.merchant2.name}`).should('exist');
cy.get('body').contains(dynamicFixtures.product2.name).should('exist');
cy.get('body').contains(dynamicFixtures.product2.localized_attributes[0].name).should('exist');
});
});

Expand All @@ -55,10 +55,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.product2.sku });
productPage.addToCart();

checkoutScenario.execute({
idCustomerAddress: dynamicFixtures.address.id_customer_address,
shouldTriggerOmsInCli: true,
});
checkoutScenario.execute({ idCustomerAddress: dynamicFixtures.address.id_customer_address });
}
}
);
9 changes: 3 additions & 6 deletions cypress/e2e/yves/reorder/reorder-random-weight-products.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
customerOverviewPage.viewLastPlacedOrder();
orderDetailsPage.reorderAll();

cy.get('body').contains(dynamicFixtures.productMUnit.name).should('exist');
cy.get('body').contains(dynamicFixtures.productPUnit.name).should('exist');
cy.get('body').contains(dynamicFixtures.productMUnit.localized_attributes[0].name).should('exist');
cy.get('body').contains(dynamicFixtures.productPUnit.localized_attributes[0].name).should('exist');
});

function placeOrderWithRandomWeightProducts(): void {
Expand All @@ -47,10 +47,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
catalogPage.searchProductFromSuggestions({ query: dynamicFixtures.productPUnit.sku });
productPage.addToCart();

checkoutScenario.execute({
idCustomerAddress: dynamicFixtures.address.id_customer_address,
shouldTriggerOmsInCli: true,
});
checkoutScenario.execute({ idCustomerAddress: dynamicFixtures.address.id_customer_address });
}

function triggerPublishEvents(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
"name": "haveFullProduct",
"key": "productConcreteForOffer",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down Expand Up @@ -161,7 +160,6 @@
"name": "haveFullProduct",
"key": "productConcreteForMerchant",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down Expand Up @@ -274,7 +272,6 @@
"sku": "#productConcreteForOffer.sku",
"abstractSku": "#productConcreteForOffer.abstract_sku",
"idProductAbstract": "#productConcreteForOffer.fk_product_abstract",
"name": "#productConcreteForOffer.name",
"productOfferReference": "#productOffer.product_offer_reference",
"merchantReference": "#productOffer.merchant_reference",
"quantity": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@
"name": "haveFullProduct",
"key": "concreteProduct1",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down Expand Up @@ -272,7 +271,6 @@
"name": "haveFullProduct",
"key": "concreteProduct2",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down Expand Up @@ -327,7 +325,6 @@
"name": "haveFullProduct",
"key": "concreteProduct3",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down Expand Up @@ -382,7 +379,6 @@
"name": "haveFullProduct",
"key": "concreteProduct4",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down Expand Up @@ -437,7 +433,6 @@
"name": "haveFullProduct",
"key": "concreteProduct5",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down Expand Up @@ -664,23 +659,20 @@
{
"sku": "#concreteProduct1.sku",
"abstractSku": "#concreteProduct1.abstract_sku",
"name": "#concreteProduct1.name",
"merchantReference": "#merchant1.merchant_reference",
"quantity": 2,
"unitPrice": 100000
},
{
"sku": "#concreteProduct2.sku",
"abstractSku": "#concreteProduct2.abstract_sku",
"name": "#concreteProduct2.name",
"merchantReference": "#merchant1.merchant_reference",
"quantity": 2,
"unitPrice": 20000
},
{
"sku": "#concreteProduct3.sku",
"abstractSku": "#concreteProduct3.abstract_sku",
"name": "#concreteProduct3.name",
"merchantReference": "#merchant2.merchant_reference",
"quantity": 2,
"unitPrice": 20000
Expand All @@ -699,23 +691,20 @@
{
"sku": "#concreteProduct1.sku",
"abstractSku": "#concreteProduct1.abstract_sku",
"name": "#concreteProduct1.name",
"merchantReference": "#merchant1.merchant_reference",
"quantity": 2,
"unitPrice": 100000
},
{
"sku": "#concreteProduct2.sku",
"abstractSku": "#concreteProduct2.abstract_sku",
"name": "#concreteProduct2.name",
"merchantReference": "#merchant1.merchant_reference",
"quantity": 2,
"unitPrice": 20000
},
{
"sku": "#concreteProduct3.sku",
"abstractSku": "#concreteProduct3.abstract_sku",
"name": "#concreteProduct3.name",
"merchantReference": "#merchant2.merchant_reference",
"quantity": 2,
"unitPrice": 20000
Expand All @@ -734,23 +723,20 @@
{
"sku": "#concreteProduct1.sku",
"abstractSku": "#concreteProduct1.abstract_sku",
"name": "#concreteProduct1.name",
"merchantReference": "#merchant1.merchant_reference",
"quantity": 2,
"unitPrice": 100000
},
{
"sku": "#concreteProduct2.sku",
"abstractSku": "#concreteProduct2.abstract_sku",
"name": "#concreteProduct2.name",
"merchantReference": "#merchant1.merchant_reference",
"quantity": 2,
"unitPrice": 20000
},
{
"sku": "#concreteProduct3.sku",
"abstractSku": "#concreteProduct3.abstract_sku",
"name": "#concreteProduct3.name",
"merchantReference": "#merchant2.merchant_reference",
"quantity": 2,
"unitPrice": 20000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"name": "haveFullProduct",
"key": "concreteProduct1",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand All @@ -88,7 +87,6 @@
"name": "haveFullProduct",
"key": "concreteProduct2",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@
"name": "haveFullProduct",
"key": "concreteProduct",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
"name": "haveFullProduct",
"key": "product",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [{ "locale": "#locale", "name": "#localizedAttribute1.name" }]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
"name": "haveFullProduct",
"key": "product",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [{ "locale": "#locale", "name": "#localizedAttribute1.name" }]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
"name": "haveFullProduct",
"key": "product1",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [{ "locale": "#locale", "name": "#localizedAttribute1.name" }]
Expand All @@ -124,7 +123,6 @@
"name": "haveFullProduct",
"key": "product2",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [{ "locale": "#locale", "name": "#localizedAttribute1.name" }]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@
"name": "haveFullProduct",
"key": "product1",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand All @@ -192,7 +191,6 @@
"name": "haveFullProduct",
"key": "product2",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
"name": "haveFullProduct",
"key": "concreteProduct",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
"name": "haveFullProduct",
"key": "concreteProduct",
"arguments": [
{},
{
"idTaxSet": 1,
"localizedAttributes": [
Expand Down
Loading
Loading