diff --git a/cypress/e2e/yves/shop/locale.cy.ts b/cypress/e2e/yves/core/locale-switching.cy.ts similarity index 66% rename from cypress/e2e/yves/shop/locale.cy.ts rename to cypress/e2e/yves/core/locale-switching.cy.ts index 39578173..4d4f1c7a 100644 --- a/cypress/e2e/yves/shop/locale.cy.ts +++ b/cypress/e2e/yves/core/locale-switching.cy.ts @@ -1,24 +1,15 @@ import { container } from '@utils'; -import { LocaleScenario } from '@scenarios/yves'; +import { LocaleSwitchingScenario } from '@scenarios/yves'; import { CatalogPage, IndexPage } from '@pages/yves'; import { LocaleStaticFixtures } from '@interfaces/yves'; (['b2c', 'b2c-mp', 'b2b', 'b2b-mp'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( 'locale switching', - { tags: ['@shop', '@locale'] }, + { tags: ['@core', '@yves'] }, (): void => { const indexPage = container.get(IndexPage); const catalogPage = container.get(CatalogPage); - const localeSwitchingScenario = container.get(LocaleScenario); - const visitFirstProductDetailPage = (): void => { - cy.get('[data-qa="component product-item"]') - .first() - .find('a.js-product-item__link-detail-page') - .invoke('attr', 'href') - .then((url) => { - cy.visit(url as string); - }); - }; + const localeSwitchingScenario = container.get(LocaleSwitchingScenario); let staticFixtures: LocaleStaticFixtures; @@ -47,18 +38,18 @@ import { LocaleStaticFixtures } from '@interfaces/yves'; localeSwitchingScenario.getCurrentLocale(staticFixtures.localeEN); }; - it('Should be able to switch locales at the home page.', (): void => { - testLocaleSwitching(() => indexPage.visit()); - }); - - it('Should be able to switch locales at the catalog page.', (): void => { - testLocaleSwitching(() => catalogPage.visit()); - }); + // it('Should be able to switch locales at the home page.', (): void => { + // testLocaleSwitching(() => indexPage.visit()); + // }); + // + // it('Should be able to switch locales at the catalog page.', (): void => { + // testLocaleSwitching(() => catalogPage.visit()); + // }); it('Should be able to switch locales at the product detailed page.', (): void => { catalogPage.visit(); - testLocaleSwitching(() => visitFirstProductDetailPage()); + testLocaleSwitching(() => catalogPage.search({ query: 'Canon IXUS 285' })); }); } ); diff --git a/cypress/fixtures/suite/yves/shop/static-locale.json b/cypress/fixtures/suite/yves/core/static-locale.json similarity index 100% rename from cypress/fixtures/suite/yves/shop/static-locale.json rename to cypress/fixtures/suite/yves/core/static-locale.json diff --git a/cypress/support/pages/yves/yves-repository.ts b/cypress/support/pages/yves/yves-repository.ts new file mode 100644 index 00000000..221756d4 --- /dev/null +++ b/cypress/support/pages/yves/yves-repository.ts @@ -0,0 +1,2 @@ +export interface YvesRepository { +} diff --git a/cypress/support/scenarios/yves/index.ts b/cypress/support/scenarios/yves/index.ts index 27da084a..b2a441d4 100644 --- a/cypress/support/scenarios/yves/index.ts +++ b/cypress/support/scenarios/yves/index.ts @@ -2,4 +2,4 @@ export * from './agent-login-scenario'; export * from './checkout-scenario'; export * from './checkout-mp-scenario'; export * from './customer-login-scenario'; -export * from './locale-scenario'; +export * from './locale-switching-scenario'; diff --git a/cypress/support/scenarios/yves/locale-scenario.ts b/cypress/support/scenarios/yves/locale-switching-scenario.ts similarity index 95% rename from cypress/support/scenarios/yves/locale-scenario.ts rename to cypress/support/scenarios/yves/locale-switching-scenario.ts index ef2af812..cbb91d05 100644 --- a/cypress/support/scenarios/yves/locale-scenario.ts +++ b/cypress/support/scenarios/yves/locale-switching-scenario.ts @@ -3,7 +3,7 @@ import { injectable } from 'inversify'; @injectable() @autoWired -export class LocaleScenario { +export class LocaleSwitchingScenario { getAvailableLocales = (): Cypress.Chainable => { return cy.get('[data-qa="language-selector"] option').then((options) => { const values = Array.from(options).map((option) => option.textContent?.trim() || ''); diff --git a/cypress/support/types/yves/locale.ts b/cypress/support/types/yves/locale.ts index 32957e56..036c5199 100644 --- a/cypress/support/types/yves/locale.ts +++ b/cypress/support/types/yves/locale.ts @@ -1,7 +1,8 @@ -import { Locale } from './shared'; +import { Locale, ProductConcrete } from './shared'; export interface LocaleStaticFixtures { localeDE: string; localeEN: string; availableLocales: Locale[]; + // concreteProduct: ProductConcrete; }