diff --git a/.github/workflows/quarantine-tests.yaml b/.github/workflows/quarantine-tests.yaml new file mode 100644 index 000000000..83673eb39 --- /dev/null +++ b/.github/workflows/quarantine-tests.yaml @@ -0,0 +1,72 @@ +name: Quarantine Tests + +on: + push: + branches: + - main + +permissions: + contents: read + packages: read + +jobs: + quarantine tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Enable corepack + run: corepack enable + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: '20.5' + cache: 'yarn' + registry-url: "https://npm.pkg.github.com" + + - name: Set yarn version + run: | + yarn set version stable + yarn set version 3.6.4 + + - name: Setup .yarnrc.yml + run: | + yarn config set nodeLinker node-modules + yarn config set npmScopes.plentymarkets.npmRegistryServer "https://npm.pkg.github.com" + yarn config set npmScopes.plentymarkets.npmAlwaysAuth true + yarn config set npmScopes.plentymarkets.npmAuthToken $NODE_AUTH_TOKEN + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Dependencies + run: yarn --immutable + + - name: Set environment + run: | + touch apps/web/.env + cat <> apps/web/.env + API_SECURITY_TOKEN=${{ secrets.API_SECURITY_TOKEN }} + API_ENDPOINT=https://mevofvd5omld.c01-14.plentymarkets.com + CLOUDFLARE_TURNSTILE_SITE_KEY="0x4AAAAAAANx3aXDh7UR35x0" >> apps/web/.env + ${{ vars.CONFIG }} + EOT + + - name: E2E tests + uses: cypress-io/github-action@v5 + with: + build: yarn build + install: false + command: yarn test:cypress-quarantine + env: + PAYPAL_EMAIL: ${{ secrets.PAYPAL_EMAIL }} + PAYPAL_PASSWORD: ${{ secrets.PAYPAL_PASSWORD }} + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-screenshots + path: apps/web/__tests__/report/screenshots + if-no-files-found: ignore diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8fb0475e3..db856fa35 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -43,7 +43,7 @@ jobs: - name: Install Dependencies run: yarn --immutable - - name: Unit tests + - name: Set environment run: | touch apps/web/.env cat <> apps/web/.env @@ -52,6 +52,9 @@ jobs: CLOUDFLARE_TURNSTILE_SITE_KEY="0x4AAAAAAANx3aXDh7UR35x0" >> apps/web/.env ${{ vars.CONFIG }} EOT + + - name: Unit tests + run: | pushd ${{ github.workspace }}/apps/server/ yarn start & pushd ${{ github.workspace }}/apps/web/ @@ -62,8 +65,8 @@ jobs: uses: cypress-io/github-action@v5 with: build: yarn build - command: yarn test:cypress install: false + command: yarn test:cypress env: PAYPAL_EMAIL: ${{ secrets.PAYPAL_EMAIL }} PAYPAL_PASSWORD: ${{ secrets.PAYPAL_PASSWORD }} diff --git a/apps/web/__tests__/test/quarantine/paypalCreditCard.spec.cy.ts b/apps/web/__tests__/test/quarantine/paypalCreditCard.spec.cy.ts new file mode 100644 index 000000000..4f2a2eba3 --- /dev/null +++ b/apps/web/__tests__/test/quarantine/paypalCreditCard.spec.cy.ts @@ -0,0 +1,39 @@ +import { CartPageObject } from '../../support/pageObjects/CartPageObject'; +import { CheckoutPageObject } from '../../support/pageObjects/CheckoutPageObject'; +import { HomePageObject } from '../../support/pageObjects/HomePageObject'; +import { ProductListPageObject } from '../../support/pageObjects/ProductListPageObject'; +import { paths } from '../../../utils/paths'; + +const checkout = new CheckoutPageObject(); +const cart = new CartPageObject(); +const homePage = new HomePageObject(); +const productListPage = new ProductListPageObject(); + +describe('Smoke: PayPal credit card order', () => { + beforeEach(() => { + cy.setCookie('vsf-locale', 'en'); + cy.setCookie('consent-cookie', '{"Essentials":{"Session":true,"Consent":true,"Session2":true},"External Media":{"Session":false,"Consent":false,"Session2":false},"Functional":{"Session":false,"Consent":false,"Session2":false},"Marketing":{"Session":false,"Consent":false,"Session2":false}}') + }); + + it('[smoke] Check if status on order gets updated when paying with paypal credit card', () => { + cy.visitAndHydrate(paths.home); + + homePage.goToCategory(); + productListPage.addToCart(); + + cart.openCart(); + checkout + .goToGuestCheckout() + .goToCheckout() + .fillContactInformationForm() + .addBillingAddress() + .fillBillingAddressForm() + .acceptTerms() + .checkCreditCard() + .placeOrderButton() + .fillCreditCardForm() + .payCreditCard() + .displaySuccessPage() + .displayFullyPaid(); + }); +}); diff --git a/apps/web/__tests__/test/smoke/categoryPage.cy.ts b/apps/web/__tests__/test/smoke/categoryPage.cy.ts index e5aaffd23..db83782ab 100644 --- a/apps/web/__tests__/test/smoke/categoryPage.cy.ts +++ b/apps/web/__tests__/test/smoke/categoryPage.cy.ts @@ -9,7 +9,7 @@ describe('Smoke: Category Page', () => { }); it('[smoke] Category filters should trigger a product data reload', () => { - // We should configure the system so that the first category is set up with filters. + // We should configure the system so that the first category is set up with filters. // This way we are independet from the language and the url. cy.visitAndHydrate('/living-room'); diff --git a/apps/web/__tests__/test/unit/i18n.spec.ts b/apps/web/__tests__/test/unit/i18n.spec.ts index 3aedce40e..c134325d2 100644 --- a/apps/web/__tests__/test/unit/i18n.spec.ts +++ b/apps/web/__tests__/test/unit/i18n.spec.ts @@ -33,7 +33,7 @@ const haveEqualStructure = (lang1: object, lang2: object) => { const hasAllKeys = (obj1: object, obj2: object) => { const obj1WorkingCopy = structuredClone(obj1) const obj2WorkingCopy = structuredClone(obj2) - + const obj1Skeleton = setValuesToEmptyString(obj1WorkingCopy); const obj2Skeleton = setValuesToEmptyString(obj2WorkingCopy); diff --git a/apps/web/package.json b/apps/web/package.json index 6ef66ca40..eacfd3bae 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -19,7 +19,8 @@ "test": "vitest run", "test:coverage": "vitest run --coverage", "test:watch": "vitest", - "test:cypress": "cypress run --browser chrome --headless", + "test:cypress-quarantine": "cypress run --browser chrome --headless --spec '__tests__/test/quarantine/*.cy.{js,jsx,ts,tsx}'", + "test:cypress": "cypress run --browser chrome --headless --spec '__tests__/test/feature/*.cy.{js,jsx,ts,tsx},__tests__/test/smoke/*.cy.{js,jsx,ts,tsx}'", "test:cypress-dev": "cypress open --e2e" }, "dependencies": { diff --git a/docs/changelog/changelog_en.md b/docs/changelog/changelog_en.md index 1fd988b66..69be82701 100644 --- a/docs/changelog/changelog_en.md +++ b/docs/changelog/changelog_en.md @@ -23,6 +23,10 @@ - Registration without cloudflare turnstile configuration is now possible. - Fixed item image size in recommended product slider. +### Changed + +- Moved paypal credit card test into quarantine folder. + ## v1.4.1 (2024-06-05) Overview of all changes ### New diff --git a/package.json b/package.json index 5c80e57c6..6ece4676b 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "test": "yarn turbo:disable-telemetry && turbo run test", "test:watch": "yarn turbo:disable-telemetry && turbo run test:watch", "test:coverage": "yarn turbo:disable-telemetry && npx turbo run test:coverage", + "test:cypress-quarantine": "concurrently -k -s=first \"yarn wait-on http-get://localhost:3000 && yarn turbo:disable-telemetry && turbo run test:cypress-quarantine\" \"yarn start\"", "test:cypress": "concurrently -k -s=first \"yarn wait-on http-get://localhost:3000 && yarn turbo:disable-telemetry && turbo run test:cypress\" \"yarn start\"", "test:cypress-dev": "concurrently -k -s=first \"yarn wait-on http-get://localhost:3000 && yarn turbo:disable-telemetry && turbo run test:cypress-dev\" \"yarn dev\"", "lhci:mobile": "lhci autorun" diff --git a/turbo.json b/turbo.json index 67642f024..99666c58a 100644 --- a/turbo.json +++ b/turbo.json @@ -41,6 +41,9 @@ "test:watch": { "cache": false }, + "test:cypress-quarantine": { + "cache": false + }, "test:cypress": { "cache": false },