Skip to content

Commit

Permalink
FRW-9368 Merged fresh master, adjustments after review
Browse files Browse the repository at this point in the history
  • Loading branch information
olhalivitchuk committed Dec 5, 2024
2 parents 2de90d5 + f1ae015 commit a5ee998
Show file tree
Hide file tree
Showing 244 changed files with 6,309 additions and 328 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ build/Release

# Dependency directories
node_modules/
vendor/
jspm_packages/

# TypeScript v1 declaration files
Expand Down Expand Up @@ -66,7 +67,6 @@ typings/

# dotenv environment variable files
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand Down
49 changes: 49 additions & 0 deletions cypress/e2e/api/cms/cms-page-search-dms.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { container } from '@utils';
import { CmsPageSearchDmsDynamicFixtures, CmsPageSearchDmsStaticFixtures } from '@interfaces/api';
import { CreateCmsPageScenario, CreateStoreScenario, UserLoginScenario } from '@scenarios/backoffice';

describeIfDynamicStoreEnabled('cms page search dms', { tags: ['@api', '@cms', '@dms'] }, () => {
const userLoginScenario = container.get(UserLoginScenario);
const createStoreScenario = container.get(CreateStoreScenario);
const createCmsPageScenario = container.get(CreateCmsPageScenario);

let staticFixtures: CmsPageSearchDmsStaticFixtures;
let dynamicFixtures: CmsPageSearchDmsDynamicFixtures;

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

it('should be able to see the cms page for new store', (): void => {
cy.request({
method: 'GET',
url: Cypress.env().glueUrl + '/cms-pages',
headers: {
Store: staticFixtures.store.name,
},
}).then((response) => {
expect(response.status).to.eq(200);
const hasCmsPage = response.body.data.some(
(item: { type: string; attributes: { name: string } }) => item.attributes.name === staticFixtures.cmsPageName
);
expect(hasCmsPage).to.be.true;
});
});

function createStoreAndCmsPage(): void {
userLoginScenario.execute({
username: dynamicFixtures.rootUser.username,
password: staticFixtures.defaultPassword,
});

createStoreScenario.execute({ store: staticFixtures.store, shouldTriggerPublishAndSync: true });

staticFixtures.cmsPageName = `${staticFixtures.cmsPageName}-${Date.now()}`;
createCmsPageScenario.execute({ cmsPageName: staticFixtures.cmsPageName, shouldTriggerPublishAndSync: true });
}
});

function describeIfDynamicStoreEnabled(title: string, options: { tags: string[] }, fn: () => void): void {
(Cypress.env('isDynamicStoreEnabled') ? describe : describe.skip)(title, fn);
}
6 changes: 2 additions & 4 deletions cypress/e2e/backoffice/category/category-edit.cy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { container } from '@utils';
import { CategoryEditStaticFixtures } from '@interfaces/backoffice';
import { CategoryEditPage } from '@pages/backoffice';
import { CategoryListPage } from '@pages/backoffice';
import { CategoryEditPage, CategoryListPage, ActionEnum } from '@pages/backoffice';
import { UserLoginScenario } from '@scenarios/backoffice';
import { ActionEnum } from '../../../support/pages/backoffice';

describe('category edit', { tags: ['@catalog'] }, (): void => {
describe('category edit', { tags: ['@backoffice', '@catalog'] }, (): void => {
const categoryListPage = container.get(CategoryListPage);
const categoryEditPage = container.get(CategoryEditPage);
const userLoginScenario = container.get(UserLoginScenario);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
*/
(['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'request management',
{ tags: ['@merchant-b2b-contract-requests'] },
{ tags: ['@backoffice', '@merchant-b2b-contract-requests'] },
(): void => {
const merchantRelationRequestListPage = container.get(MerchantRelationRequestListPage);
const merchantRelationRequestEditPage = container.get(MerchantRelationRequestEditPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';

(['b2c', 'b2c-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'custom order reference management',
{ tags: ['@order-management'] },
{ tags: ['@backoffice', '@order-management'] },
(): void => {
const cartPage = container.get(CartPage);
const salesIndexPage = container.get(SalesIndexPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CatalogPage, CustomerOverviewPage, ProductPage } from '@pages/yves';
import { UserLoginScenario } from '@scenarios/backoffice';
import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';

describe('order creation', { tags: ['@order-management'] }, (): void => {
describe('order creation', { tags: ['@backoffice', '@order-management'] }, (): void => {
const catalogPage = container.get(CatalogPage);
const productPage = container.get(ProductPage);
const customerOverviewPage = container.get(CustomerOverviewPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CatalogPage, ProductPage } from '@pages/yves';

(['b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'return creation',
{ tags: ['@return-management'] },
{ tags: ['@backoffice', '@return-management'] },
(): void => {
const catalogPage = container.get(CatalogPage);
const productsPage = container.get(ProductPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { MerchantAgentLoginUserScenario } from '@scenarios/mp';
*/
(['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'agent authorization',
{ tags: ['@marketplace-agent-assist'] },
{ tags: ['@mp', '@marketplace-agent-assist'] },
(): void => {
const yvesLoginPage = container.get(LoginPage);
const yvesAgentLoginPage = container.get(AgentLoginPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MerchantAgentLoginUserScenario } from '@scenarios/mp';
*/
(['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'agent dashboard',
{ tags: ['@marketplace-agent-assist'] },
{ tags: ['@mp', '@marketplace-agent-assist'] },
(): void => {
const mpAgentLoginPage = container.get(MpAgentLoginPage);
const mpDashboardPage = container.get(DashboardPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ImpersonateAsMerchantUserScenario } from '@scenarios/mp';
*/
(['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'agent impersonation',
{ tags: ['@marketplace-agent-assist'] },
{ tags: ['@mp', '@marketplace-agent-assist'] },
(): void => {
const yvesLoginPage = container.get(LoginPage);
const mpLoginPage = container.get(MpLoginPage);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/mp/marketplace-agent-assist/agent-login.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { MerchantAgentLoginUserScenario } from '@scenarios/mp';
*/
(['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'agent login',
{ tags: ['@marketplace-agent-assist'] },
{ tags: ['@mp', '@marketplace-agent-assist'] },
(): void => {
const mpLoginPage = container.get(MpLoginPage);
const mpAgentLoginPage = container.get(MpAgentLoginPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { CheckoutMpScenario, CustomerLoginScenario } from '@scenarios/yves';
*/
(['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'agent merchant portal',
{ tags: ['@marketplace-agent-assist'] },
{ tags: ['@mp', '@marketplace-agent-assist'] },
(): void => {
const salesIndexPage = container.get(SalesIndexPage);
const salesDetailPage = container.get(SalesDetailPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { UserLoginScenario } from '@scenarios/backoffice';
*/
(['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'agent permission',
{ tags: ['@marketplace-agent-assist'] },
{ tags: ['@mp', '@marketplace-agent-assist'] },
(): void => {
const backofficeUserIndexPage = container.get(UserIndexPage);
const backofficeUserUpdatePage = container.get(UserUpdatePage);
Expand Down Expand Up @@ -69,15 +69,15 @@ import { UserLoginScenario } from '@scenarios/backoffice';
it('backoffice user should be able to see imported user with "Agent Customer" permission', (): void => {
backofficeUserIndexPage.visit();
backofficeUserIndexPage
.find({ query: dynamicFixtures.customerAgentUser.username })
.findUser({ query: dynamicFixtures.customerAgentUser.username })
.contains('Agent')
.should('have.length', 1);
});

it('backoffice user should be able to see imported user with "Agent Merchant" permission', (): void => {
backofficeUserIndexPage.visit();
backofficeUserIndexPage
.find({ query: dynamicFixtures.merchantAgentUser.username })
.findUser({ query: dynamicFixtures.merchantAgentUser.username })
.contains('Agent')
.should('have.length', 1);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { CatalogPage, MultiCartPage, ProductPage } from '@pages/yves';
*/
(['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'commission calculation',
{ tags: ['@marketplace-merchant-commission'] },
{ tags: ['@mp', '@marketplace-merchant-commission'] },
(): void => {
const catalogPage = container.get(CatalogPage);
const productPage = container.get(ProductPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MerchantUserLoginScenario } from '@scenarios/mp';

(['b2b', 'b2c'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'product concretes management',
{ tags: ['@merchant-product-concretes'] },
{ tags: ['@mp', '@merchant-product-concretes'] },
(): void => {
const variantsPage = container.get(VariantsPage);
const merchantUserLoginScenario = container.get(MerchantUserLoginScenario);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MerchantUserLoginScenario } from '@scenarios/mp';
*/
(['b2c', 'b2b', 'b2c-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'request management',
{ tags: ['@merchant-b2b-contract-requests'] },
{ tags: ['@mp', '@merchant-b2b-contract-requests'] },
(): void => {
const merchantRelationRequestsPage = container.get(MerchantRelationRequestsPage);
const merchantRelationsPage = container.get(MerchantRelationsPage);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/smoke/api/health-check.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Reminder: Use only static fixtures for smoke tests, don't use dynamic fixtures, cli commands.
*/
describe('health check', { tags: '@smoke' }, () => {
describe('health check', { tags: ['@smoke', '@api'] }, () => {
it('GLUE endpoint should return 200', () => {
cy.request(Cypress.env().glueUrl + '/catalog-search')
.its('status')
Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/smoke/catalog/product-search.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { CatalogPage, ProductPage } from '@pages/yves';
import { ProductSearchStaticFixtures } from '@interfaces/smoke';
import { CustomerLoginScenario } from '@scenarios/yves';

describe('product search', { tags: ['@smoke'] }, (): void => {
/**
* Reminder: Use only static fixtures for smoke tests, don't use dynamic fixtures, cli commands.
*/
describe('product search', { tags: ['@smoke', '@catalog'] }, (): void => {
const catalogPage = container.get(CatalogPage);
const productPage = container.get(ProductPage);
const customerLoginScenario = container.get(CustomerLoginScenario);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/smoke/checkout/basic-checkout.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
/**
* Reminder: Use only static fixtures for smoke tests, don't use dynamic fixtures, cli commands.
*/
describe('basic checkout', { tags: ['@smoke'] }, (): void => {
describe('basic checkout', { tags: ['@smoke', '@checkout'] }, (): void => {
const catalogPage = container.get(CatalogPage);
const productPage = container.get(ProductPage);
const customerOverviewPage = container.get(CustomerOverviewPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CustomerAuthStaticFixtures } from '@interfaces/smoke';
/**
* Reminder: Use only static fixtures for smoke tests, don't use dynamic fixtures, cli commands.
*/
describe('customer auth', { tags: ['@smoke'] }, (): void => {
describe('customer auth', { tags: ['@smoke', '@customer-account-management'] }, (): void => {
const loginPage = container.get(LoginPage);
const customerOverviewPage = container.get(CustomerOverviewPage);

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/smoke/merchant-portal/login.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { LoginStaticFixtures } from '@interfaces/smoke';
*/
(['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'login',
{ tags: ['@smoke'] },
{ tags: ['@smoke', '@merchant-portal'] },
(): void => {
const loginPage = container.get(LoginPage);
const dashboardPage = container.get(DashboardPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CheckoutScenario, CustomerLoginScenario } from '@scenarios/yves';
*/
(['b2c-mp', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'dummy payment OMS flow',
{ tags: ['@smoke'] },
{ tags: ['@smoke', '@order-management'] },
(): void => {
const catalogPage = container.get(CatalogPage);
const productsPage = container.get(ProductPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { CatalogPage, ProductPage } from '@pages/yves';
*/
(['b2c', 'b2b'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)(
'marketplace payment OMS flow',
{ tags: ['@smoke'] },
{ tags: ['@smoke', '@order-management'] },
(): void => {
const catalogPage = container.get(CatalogPage);
const productsPage = container.get(ProductPage);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/smoke/product/publish-and-synchronize.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CustomerLoginScenario } from '@scenarios/yves';
/**
* Reminder: Use only static fixtures for smoke tests, don't use dynamic fixtures, cli commands.
*/
describe('publish and synchronize', { tags: ['@smoke'] }, (): void => {
describe('publish and synchronize', { tags: ['@smoke', '@product'] }, (): void => {
const catalogPage = container.get(CatalogPage);
const productPage = container.get(ProductPage);
const userLoginScenario = container.get(UserLoginScenario);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/yves/cart/cart-item-note-management.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CustomerLoginScenario } from '@scenarios/yves';
/**
* Yves Cart Update Without Reload checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/4147904521/Yves+Cart+Update+Without+Reload+Checklist}
*/
describe('cart item note management', { tags: ['@cart'] }, (): void => {
describe('cart item note management', { tags: ['@yves', '@cart'] }, (): void => {
const cartPage = container.get(CartPage);
const customerLoginScenario = container.get(CustomerLoginScenario);

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/yves/cart/change-cart-item-quantity.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CustomerLoginScenario } from '@scenarios/yves';
/**
* Yves Cart Update Without Reload checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/4147904521/Yves+Cart+Update+Without+Reload+Checklist}
*/
describe('change cart item quantity', { tags: ['@cart'] }, (): void => {
describe('change cart item quantity', { tags: ['@yves', '@cart'] }, (): void => {
const cartPage = container.get(CartPage);
const catalogPage = container.get(CatalogPage);
const productPage = container.get(ProductPage);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/yves/cart/remove-cart-item.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CustomerLoginScenario } from '@scenarios/yves';
/**
* Yves Cart Update Without Reload checklists: {@link https://spryker.atlassian.net/wiki/spaces/CCS/pages/4147904521/Yves+Cart+Update+Without+Reload+Checklist}
*/
describe('remove cart item', { tags: ['@cart'] }, (): void => {
describe('remove cart item', { tags: ['@yves', '@cart'] }, (): void => {
const cartPage = container.get(CartPage);
const catalogPage = container.get(CatalogPage);
const productPage = container.get(ProductPage);
Expand Down
Loading

0 comments on commit a5ee998

Please sign in to comment.