Skip to content

Commit

Permalink
CC-33308: Resolved conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmiseev committed May 3, 2024
1 parent c4e60dd commit f5727b5
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 59 deletions.
6 changes: 5 additions & 1 deletion cypress/e2e/yves/cart/cart-item-note-management.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ import { CartItemNoteManagementDynamicFixtures, CartItemNoteManagementStaticFixt
import { CartPage } from '@pages/yves';
import { CustomerLoginScenario } from '@scenarios/yves';

describe('cart item note management', { tags: ['@cart'] }, (): void => {
/**
* Yves Cart Update Without Reload checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/4147904521/Yves+Cart+Update+Without+Reload+Checklist}
*/
describe.skip('cart item note management [skip]', { tags: ['@cart'] }, (): void => {
const cartPage = container.get(CartPage);
const customerLoginScenario = container.get(CustomerLoginScenario);

let staticFixtures: CartItemNoteManagementStaticFixtures;
let dynamicFixtures: CartItemNoteManagementDynamicFixtures;

before((): void => {
cy.pause();
({ staticFixtures, dynamicFixtures } = Cypress.env());
});

Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/yves/cart/change-cart-item-quantity.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { ChangeCartItemQuantityStaticFixtures, ChangeCartItemQuantityDynamicFixt
import { CartPage, MultiCartPage } from '@pages/yves';
import { CustomerLoginScenario } from '@scenarios/yves';

describe('change cart item quantity', { tags: ['@cart'] }, (): void => {
/**
* Yves Cart Update Without Reload checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/4147904521/Yves+Cart+Update+Without+Reload+Checklist}
*/
describe.skip('change cart item quantity [skip]', { tags: ['@cart'] }, (): void => {
const cartPage = container.get(CartPage);
const multiCartPage = container.get(MultiCartPage);
const customerLoginScenario = container.get(CustomerLoginScenario);
Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/yves/cart/remove-cart-item.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { RemoveCartItemStaticFixtures, RemoveCartItemDynamicFixtures } from '@in
import { CartPage } from '@pages/yves';
import { CustomerLoginScenario } from '@scenarios/yves';

describe('remove cart item', { tags: ['@cart'] }, (): void => {
/**
* Yves Cart Update Without Reload checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/4147904521/Yves+Cart+Update+Without+Reload+Checklist}
*/
describe.skip('remove cart item [skip]', { tags: ['@cart'] }, (): void => {
const cartPage = container.get(CartPage);
const customerLoginScenario = container.get(CustomerLoginScenario);

Expand Down
122 changes: 66 additions & 56 deletions cypress/e2e/yves/comments/cart-comments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,74 +3,84 @@ import { CartCommentsDynamicFixtures, CartCommentsStaticFixtures } from '@interf
import { CommentCartPage, MultiCartPage } from '@pages/yves';
import { CustomerLoginScenario } from '@scenarios/yves';

(['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)('cart comments', { tags: ['@comments'] }, (): void => {
const multiCartPage = container.get(MultiCartPage);
const commentCartPage = container.get(CommentCartPage);
const loginCustomerScenario = container.get(CustomerLoginScenario);

let dynamicFixtures: CartCommentsDynamicFixtures;
let staticFixtures: CartCommentsStaticFixtures;

before((): void => {
({ staticFixtures, dynamicFixtures } = Cypress.env());
});

beforeEach((): void => {
loginCustomerScenario.execute({
email: dynamicFixtures.customer.email,
password: staticFixtures.defaultPassword,
(['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'cart comments',
{ tags: ['@comments'] },
(): void => {
const multiCartPage = container.get(MultiCartPage);
const commentCartPage = container.get(CommentCartPage);
const loginCustomerScenario = container.get(CustomerLoginScenario);

let dynamicFixtures: CartCommentsDynamicFixtures;
let staticFixtures: CartCommentsStaticFixtures;

before((): void => {
({ staticFixtures, dynamicFixtures } = Cypress.env());
});
});

it('customer should be able to add comments to cart with items', (): void => {
multiCartPage.visit();
multiCartPage.selectCart({ name: dynamicFixtures.quote.name });
beforeEach((): void => {
loginCustomerScenario.execute({
email: dynamicFixtures.customer.email,
password: staticFixtures.defaultPassword,
});
});

it('customer should be able to add comments to cart with items', (): void => {
multiCartPage.visit();
multiCartPage.selectCart({ name: dynamicFixtures.quote.name });

staticFixtures.commentsToAdd.forEach((commentMessage) => {
commentCartPage.add({ message: commentMessage });
commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist');
staticFixtures.commentsToAdd.forEach((commentMessage) => {
commentCartPage.add({ message: commentMessage });
commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist');
});
});
});

it('customer should be able to modify comment in cart with items', (): void => {
commentCartPage.visit();
commentCartPage.add({ message: staticFixtures.commentToModify });
commentCartPage.update({ oldMessage: staticFixtures.commentToModify, newMessage: staticFixtures.modifiedComment });
it('customer should be able to modify comment in cart with items', (): void => {
commentCartPage.visit();
commentCartPage.add({ message: staticFixtures.commentToModify });
commentCartPage.update({
oldMessage: staticFixtures.commentToModify,
newMessage: staticFixtures.modifiedComment,
});

commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist');
});
commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist');
});

it('customer should be able to remove comment in cart with items', (): void => {
commentCartPage.visit();
commentCartPage.add({ message: staticFixtures.commentsToRemove });
commentCartPage.remove({ message: staticFixtures.commentsToRemove });
it('customer should be able to remove comment in cart with items', (): void => {
commentCartPage.visit();
commentCartPage.add({ message: staticFixtures.commentsToRemove });
commentCartPage.remove({ message: staticFixtures.commentsToRemove });

commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentsToRemove).should('not.exist');
});
commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentsToRemove).should('not.exist');
});

it('customer should be able to add comments to empty cart', (): void => {
multiCartPage.visit();
multiCartPage.selectCart({ name: dynamicFixtures.emptyQuote.name });
it('customer should be able to add comments to empty cart', (): void => {
multiCartPage.visit();
multiCartPage.selectCart({ name: dynamicFixtures.emptyQuote.name });

staticFixtures.commentsToAdd.forEach((commentMessage) => {
commentCartPage.add({ message: commentMessage });
commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist');
staticFixtures.commentsToAdd.forEach((commentMessage) => {
commentCartPage.add({ message: commentMessage });
commentCartPage.getCommentThreadListSection().contains(commentMessage).should('exist');
});
});
});

it('customer should be able to modify comment in empty cart', (): void => {
commentCartPage.visit();
commentCartPage.add({ message: staticFixtures.commentToModify });
commentCartPage.update({ oldMessage: staticFixtures.commentToModify, newMessage: staticFixtures.modifiedComment });
it('customer should be able to modify comment in empty cart', (): void => {
commentCartPage.visit();
commentCartPage.add({ message: staticFixtures.commentToModify });
commentCartPage.update({
oldMessage: staticFixtures.commentToModify,
newMessage: staticFixtures.modifiedComment,
});

commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist');
});
commentCartPage.getCommentThreadListSection().contains(staticFixtures.modifiedComment).should('exist');
});

it('customer should be able to remove comment in empty cart', (): void => {
commentCartPage.visit();
commentCartPage.add({ message: staticFixtures.commentsToRemove });
commentCartPage.remove({ message: staticFixtures.commentsToRemove });
it('customer should be able to remove comment in empty cart', (): void => {
commentCartPage.visit();
commentCartPage.add({ message: staticFixtures.commentsToRemove });
commentCartPage.remove({ message: staticFixtures.commentsToRemove });

commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentsToRemove).should('not.exist');
});
});
commentCartPage.getCommentThreadListSection().contains(staticFixtures.commentsToRemove).should('not.exist');
});
}
);
5 changes: 5 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ before(() => {
});

const loadFixture = (): void => {
const currentSuite = Cypress.mocha.getRunner().suite.suites[0];
if (currentSuite.title.includes('[skip]')) {
return;
}

const repositoryId = Cypress.env('repositoryId');
const fixtureFilePath = getFixtureFilePath();
const dynamicFixturesDefaultFilePath = `${repositoryId}/${fixtureFilePath.directoryPart}/dynamic-${fixtureFilePath.filePart}`;
Expand Down
4 changes: 4 additions & 0 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// cypress/support/index.d.ts

declare namespace Cypress {
interface Cypress {
mocha: any; // eslint-disable-line @typescript-eslint/no-explicit-any
}

interface Chainable {
/**
* @example cy.iframe()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,17 @@ export class B2cCartRepository implements CartRepository {
this.findCartItemChangeQuantityForm(sku).find('[data-qa="cart-item-quantity-input"]');
findClearCartForm = (): Cypress.Chainable => cy.get('[data-qa="multi-cart-clear-form"]');
getCheckoutButton = (): Cypress.Chainable => cy.get('[data-qa="cart-go-to-checkout"]:visible');
findCartItemRemovalSubmit = (sku: string): Cypress.Chainable => this.findCartItemRemovalForm(sku).find('button');
getCartDiscountSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-discount-summary"]');
getCartItemChangeQuantitySubmit = (sku: string): Cypress.Chainable =>
this.findCartItemChangeQuantityForm(sku).find('[data-qa="quantity-input-submit"]');
getCartSummary = (): Cypress.Chainable => cy.get('[data-qa="component cart-summary"]');
getCustomOrderReferenceInput = (): Cypress.Chainable =>
cy.get('[data-qa="component order-custom-reference-form"] input[type=text]');
getCustomOrderReferenceSubmitButton = (): Cypress.Chainable =>
cy.get('[data-qa="component order-custom-reference-form"] button[type=submit]');
getFirstCartItemNoteField = (): Cypress.Chainable =>
cy.get('[data-qa="component form quote-item-cart-note-form"]').last().find('textarea').first();
getFirstCartItemNoteSubmitButton = (): Cypress.Chainable =>
cy.get('[data-qa="component form quote-item-cart-note-form"] [data-qa="submit-button"]').last();
}

0 comments on commit f5727b5

Please sign in to comment.