Cypress Test Writing for Shopsys Storefront
You are an expert Cypress test writer for the Shopsys Platform storefront. Follow these conventions when writing, reviewing, or fixing tests.
Choose coverage before writing a spec
Apply .agents/skills/test-writing/SKILL.md and the scenario ownership rules reached
through .agents/skills/storefront-tests/SKILL.md before adding or removing coverage.
Those skills own the cross-layer decision; this skill owns Cypress implementation.
Name the real integration/browser risk and reuse an existing flow when it covers it.
A screenshot needs its own visual purpose; important outcomes also need explicit assertions.
Historical specs and the examples below are not permission to bypass these rules:
- Wait for an expected observable state or the relevant request, not an arbitrary delay. Preserve scrolling/readiness required by the custom deferred system; replace an existing wait only after establishing what it protects.
- Do not add
force: trueto hide a covered, disabled or unready control. Use an established forced interaction only when the component intentionally hides its native control, and verify the resulting state. - Do not conditionally skip a required assertion because the expected element was not found. Establish optional states from controlled setup; missing required content must fail.
- Check the outcome promised by the title. A URL change, successful request or screenshot alone does not verify product identity, quantities, persistence or filtering results.
- Do not resolve unexplained flakiness by raising retries/tolerances, skipping tests or updating baselines. Diagnose the missing readiness/data contract and report anything unverified.
Project Structure
project-base/storefront/cypress/
tids.ts # TID enum — central registry of all data-tid values
cypress.config.ts # Cypress configuration
cypress.d.ts # Custom command type declarations
fixtures/demodata.ts # Static test data (users, products, categories, URLs)
fixtures/translationKeys.ts # Translation key constants
support/index.ts # Custom commands, helpers, SNAPSHOT_GROUP enum
support/api.ts # GraphQL API commands (login, addToCart, createOrder)
support/navigation.ts # Entity navigation helpers (visitEntityByUuid)
support/translations.ts # Translation loading and lookup
e2e/
featureName/
featureName.cy.ts # Test file
featureNameSupport.ts # Support helpers for this feature
Existing Test Categories
| Directory | Tests | Support File |
| -------------------- | ---------------------------------------------------------------------------- | ----------------------------- |
| authentication/ | login, registration | authenticationSupport.ts |
| b2bComplaints/ | complaints | complaintsSupport.ts |
| b2bUser/ | accountantViewOnly, editProfileB2b, orderWithdrawal | b2bSupport.ts |
| cart/ | cartInHeader, cartLogin, cartPage, productAddToCart | cartSupport.ts |
| comparison/ | productComparison | comparisonSupport.ts |
| customerUsers/ | customerUsers | customerUsersSupport.ts |
| deliveryOptions/ | deliveryOptionsPopup | deliveryOptionsSupport.ts |
| filterAndSort/ | categoryDetailFilterAndSort, parameterFilter | — |
| freeShipping/ | freeShipping | freeShippingSupport.ts |
| giftVouchers/ | giftVouchers | giftVouchersSupport.ts |
| giftWithProduct/ | giftWithProduct | giftWithProductSupport.ts |
| graphql/ | graphQLErrorHandling | — |
| limitedUser/ | limitedUser | limitedUserSupport.ts |
| matrix/ | matrixTest | — |
| order/ | contactInformation, createOrder, createOrderWithDeliveryAddress, orderRepeat | orderSupport.ts |
| productLists/ | comparisonRaceCondition, wishlistRaceCondition | — |
| seoCategory/ | seoCategory | — |
| ssr/ | serverSideRendering | — |
| stores/ | stores | storesSupport.ts |
| transportAndPayment/ | lastOrderTransportAndPayment, paymentSelect, transportSelect | transportAndPaymentSupport.ts |
| visits/ | blogArticle, fixedHeader, repeatedVisits, simpleVisitsWithScreenshots | visitsSupport.ts |
| watchdog/ | watchdog | — |
Running Tests
# Manual GUI regression mode (auto-reloads .cy.ts files)
make open-acceptance-tests-regression
# Headless specific test
make run-specific-test-regression SPEC=e2e/path/to/test.cy.ts
# All regression tests headless
make run-acceptance-tests-regression
# Specific group
make selected-acceptance-tests-regression # Interactive group selection
# Functional-only run (also supported by selected, specific and GUI regression targets)
make run-acceptance-tests-regression SKIP_SNAPSHOTS=1
make run-specific-test-regression SPEC=e2e/cart/cartLogin.cy.ts SKIP_SNAPSHOTS=1
Use make help-tests for the primary commands and advanced reference-generation modes.
All local acceptance commands build the Cypress image before changing the environment,
then prepare test data and recreate the test storefront. A shared exit/signal handler
attempts every cleanup step after setup/test failure or interruption and preserves failure.
prepare-data-for-acceptance-tests, cypress-prepare and cypress-cleanup also work
as explicit targets; manual setup requires explicit cleanup.
These are commands for the user, not agent execution. The base variants generate
references rather than validating them; keep monorepo reference generation on CI.
SKIP_SNAPSHOTS defaults to 0. Both Makefiles pass it explicitly to the Cypress
container; 1 enables the existing skipSnapshots helper shortcut. It skips visual
capture/comparison and the helper's screenshot-only preparation, not the scenario's
functional assertions. Automatic screenshots on test failure remain enabled. Invalid
values and skipping snapshots in base mode are rejected. A functional-only green
run is not visual approval. The Makefile returns a failure after cleanup when Cypress
fails (including interactive selection and smoke). GitHub CI explicitly pins
SKIP_SNAPSHOTS=0 for regression and regeneration. The project GitLab template defaults
to 0 and forwards an optional pipeline variable only to regression; its manual
regeneration job always uses 0. The shared container entrypoint validates modes
before dependency installation; a typo must never fall back to reference generation.
Targeted non-browser coverage lives in vitest/cypress/snapshotMode.test.ts and
vitest/cypress/entrypoint.test.ts; the latter uses a stub npm command, not Cypress.
Reference site for inspecting page structure: https://19-0.odin.shopsys.cloud/
CI reference regeneration
- On same-repository PRs, manually adding
regenerate screenshotsstarts a new Docker build and cancels the previous run for that PR. Other label events do not restart it. This restarts the full pipeline, not only Cypress. - The run uses the labels captured in its triggering event, so removing the label cannot change the mode halfway through the matrix. Failed regeneration leaves the label in place; remove and re-add it to retry after diagnosing the failure.
- All regeneration groups must pass before publication. The publishing job checks that the PR is still open, its head and base are unchanged, and the request label remains. It commits only generated PNG references, removes the label, and pushes without rewriting history using the existing CI push token.
- Before replacing an existing reference, a separate read-only preparation job uses the locked Pixelmatch CLI with color threshold
0andincludeAA: false. Zero detected differences preserve the original PNG bytes; new images, changed dimensions and any detected differing pixel are included. Comparison errors stop publication. This excludes detected antialiasing only, not an allowed percentage of the image; never reuse the regression threshold0.005as an update filter. This protects Git diffs, not rendering determinism, and still requires human review of visual changes. - Run the comparator with
--no-maglev --no-concurrent-sparkplugto avoid the Node V8 shutdown deadlock, and enforce a per-image timeout so a stalled process cannot hold publication for hours. These flags do not change Pixelmatch thresholds. Keep PR dependency execution away from the fresh publishing runner that receives the push token. Transfer only prepared PNG data by the preparation job's artifact ID; reject non-PNG files and symlink destinations before staging. The prepared artifact must not match the raw artifact download pattern, and rerunning preparation must replace its previous artifact. Targeted workflow checks:docker compose exec -T php-fpm node --test .github/tests/cypress-snapshot-publication.test.cjs. - Snapshot publication refuses
master,mainand version-like head branches matching[0-9]*.[0-9]*before removing the request label or pushing; use a topic branch for regeneration. - The existing
Check standardsCI job runs the snapshot publication safeguard tests after installing PHP-container Node dependencies. It checks out and copies only the test and workflow files because.githubis excluded from the PHP image. A failed safeguard blocks the job and the requiredBuild successfulcheck; do not make this step advisory or move it into the privileged publishing job. - Checkouts in both Cypress execution jobs, snapshot preparation and publication use
persist-credentials: false; the safeguard tests cover all four jobs so PR-authored test code cannot inherit checkout credentials. - The publishing job grants
GITHUB_TOKENpull-requests: writeto remove the request label from the PR. Keep this permission scoped to that job; Git pushes still use the existing CI push token. - The snapshot commit triggers ordinary CI. When references are unchanged, ordinary regression runs in the current build instead. Successful regeneration alone is not a substitute for regression checks or human visual approval.
- The label-only matrix is named
Generate screenshot references (label only). ThePrepare variables and artifactsjob summary distinguishes regeneration, verification of aregenerated Cypress snapshotshead commit, and ordinary reference verification. It links the reference commit and explains intentionally skipped regeneration jobs; the summary is not a test-success claim. - If a concurrent push wins after the final check, publication fails safely; after checking the latest branch, re-add the label if it was already removed. There is no background queue or automatic retry controller.
- Review the snapshot commit against its parent in Git history and relate the changes to code/demo data; reverting commits is unnecessary. Do not approve unexplained visual differences by regeneration. Fork PRs retain their artifact-only regeneration flow without bot publication.
CRITICAL RULE: Search Existing Interaction Patterns First
Before writing or changing a Cypress interaction, search the whole Cypress codebase for the same component,
TID, helper, and interaction type. Trace the complete user flow — setup, opening, input, submission, closing,
navigation, and assertions — rather than copying only its primary action.
- Reuse an established helper or support-file pattern whenever one exists.
- Search for equivalent real-event usage such as
realMouseMove,realPress, or other interaction-specific
commands before introducing trigger() or custom event simulation.
- Inspect the relevant React component when lifecycle behavior matters. Verify desktop/mobile variants,
popovers versus drawers, portals, mounted versus merely hidden content, disabled/loading states, debounce,
and animations before choosing assertions.
- For transport/payment selection, wait until the outgoing option list is removed before changing the
selection again. After clearing payment, assert that every option label is visible inside the payment
section; mounted enabled radios alone do not prove that the animated list has expanded for a screenshot.
- Add a new interaction pattern only when no project pattern fits, and model it on the closest verified flow.
Use cy.getByTID()
Locate elements with cy.getByTID(), or scope from a TID with .find(); form-library IDs are the one exception (see below). Raw data-tid, text, title or aria-label selectors drift with markup and translations.
How getByTID works
// Single TID → [data-tid=value]
cy.getByTID([TIDs.store_list]);
// TID with suffix → [data-tid=prefix_suffix]
cy.getByTID([[TIDs.blocks_product_list_listeditem_, '9177759']]);
// Nested (descendant) → [data-tid=parent] [data-tid=child]
cy.getByTID([[TIDs.blocks_product_list_listeditem_, catnum], TIDs.product_compare_button]);
Important: getByTID uses EXACT match (=), NOT starts-with (^=). You cannot use it to match all items with a prefix.
NEVER use these anti-patterns:
// NEVER: Translation-based finding
t('Store detail').then((translated) => {
cy.contains(translated).click();
});
// NEVER: Manual data-tid selectors
cy.get('[data-tid="blocks_product_addtocart"]');
cy.get(`[data-tid^="${TIDs.blocks_product_list_listeditem_}"]`);
// NEVER: Title/aria-label selectors for clickable elements
cy.get('[title="Add to comparison"]');
cy.get(`button[aria-label="${translations.filter.clearAll}"]`);
// NEVER: Raw h1 when page_title TID exists
cy.get('h1')
.should('contain', 'text')
// NEVER: Text-based button matching in popups
.find('button')
.contains(/yes|remove/i)
.click();
ALWAYS use these patterns:
// Direct TID
cy.getByTID([TIDs.page_title]).should('contain.text', linkText);
cy.getByTID([TIDs.popup_confirm_button]).click();
// TID + find for native controls; force only for the intentionally hidden custom checkbox input
cy.getByTID([TIDs.filter_panel]).find('input[type="checkbox"]').first().check({ force: true });
cy.getByTID([TIDs.filter_price_input_min]).find('input').clear().type('200').blur();
// Expandable items (collapsed by default)
cy.getByTID([TIDs.store_list]).find('[aria-expanded="false"]').first().click();
// Form fields by ID (acceptable — form libraries generate IDs)
cy.get('#customer-change-profile-form-street').should('not.be.disabled');
// Reset a filter applied by this scenario; missing required controls must fail
cy.getByTID([TIDs.selected_filters]).should('be.visible');
cy.getByTID([TIDs.clear_all_filters_button]).filter(':visible').first().click();
cy.getByTID([TIDs.selected_filters]).should('not.exist');
Adding New TIDs
Step 1: Register in tids.ts
// project-base/storefront/cypress/tids.ts
export enum TIDs {
my_new_element = 'my_new_element',
}
Step 2: Add to React component
// Regular HTML element:
<div data-tid={TIDs.my_new_element}>
// Button component (uses `tid` prop, NOT `data-tid`):
<Button tid={TIDs.my_new_element}>
// LinkButton component:
<LinkButton tid={TIDs.my_new_element}>
Multiple items with the same TID is OK (e.g., product_compare_button on every product card). Use .first() or scope with parent TID.
TID Reference
All available TIDs are defined in project-base/storefront/cypress/tids.ts. Read this file to find existing TIDs before adding new ones. TIDs ending with _ are prefixes used with a suffix (e.g., blocks_product_list_listeditem_ + catnum).
Test File Template
import { staticData } from 'fixtures/demodata';
import {
getSnapshotIndexingFunction,
initializePersistStoreInLocalStorageToDefaultValues,
SNAPSHOT_GROUP,
takeSnapshotAndCompare,
} from 'support';
import { TIDs } from 'tids';
const SUBGROUP_INDEX = 0; // unique per test file within the SNAPSHOT_GROUP
const getSnapshotFullIndexAsString = getSnapshotIndexingFunction(SNAPSHOT_GROUP.MY_GROUP, SUBGROUP_INDEX);
describe('Feature Tests (SSP-XXXX)', () => {
beforeEach(() => {
initializePersistStoreInLocalStorageToDefaultValues();
});
it('[Test Name] should do something', () => {
cy.visitAndWaitForStableAndInteractiveDOM('/');
cy.getByTID([TIDs.some_element]).should('be.visible').click();
cy.waitForStableAndInteractiveDOM();
takeSnapshotAndCompare(getSnapshotFullIndexAsString(0), 'snapshot name', {
blackout: [
{ tid: TIDs.footer_social_links },
{ tid: TIDs.footer_payment_images },
{ tid: TIDs.footer_copyright },
],
});
});
});
B2B Test Template
import { b2bUrl, staticData } from 'fixtures/demodata';
import {
getSnapshotIndexingFunction,
initializePersistStoreInLocalStorageToDefaultValues,
SNAPSHOT_GROUP,
takeSnapshotAndCompare,
} from 'support';
import { TIDs } from 'tids';
const SUBGROUP_INDEX = 0;
const getSnapshotFullIndexAsString = getSnapshotIndexingFunction(SNAPSHOT_GROUP.B2B, SUBGROUP_INDEX);
describe('B2B Feature Tests', () => {
beforeEach(() => {
initializePersistStoreInLocalStorageToDefaultValues();
cy.loginB2b(staticData.b2bOwner.email, staticData.b2bOwner.password);
});
it('[Test Name] should do something', () => {
cy.visitB2bAndWaitForStableAndInteractiveDOM(b2bUrl.customer.orders);
cy.url().should('contain', b2bUrl.customer.orders);
// ... assertions
});
it('should show 403 for unauthorized user', () => {
cy.loginB2b(staticData.b2bCatalogUser.email, staticData.b2bCatalogUser.password);
cy.visitB2bAndWaitForStableAndInteractiveDOM(b2bUrl.customer.users, { failOnStatusCode: false });
cy.getByTID([TIDs.error_403_page]).should('exist');
});
});
Support File Template
import { staticData, b2bUrl } from 'fixtures/demodata';
import { checkAndHideSuccessToast, changeElementText, checkUrl } from 'support';
import { TIDs } from 'tids';
// Login helpers
export const loginAsB2bOwner = () => {
cy.loginB2b(staticData.b2bOwner.email, staticData.b2bOwner.password);
};
// Navigation helpers
export const navigateToFeaturePage = () => {
cy.visitB2bAndWaitForStableAndInteractiveDOM(b2bUrl.customer.complaints);
};
// Assertion helpers
export const checkElementIsVisible = () => {
cy.getByTID([TIDs.complaints_list]).should('exist');
};
// Action helpers
export const performAction = () => {
cy.getByTID([TIDs.some_button]).should('be.visible').click();
cy.waitForStableAndInteractiveDOM();
};
// Dynamic content replacement for snapshots
export const replaceDynamicContent = () => {
changeElementText(TIDs.store_opening_hours, staticData.openingHours, false);
};
// 403 check
export const check403PageIsVisible = () => {
cy.getByTID([TIDs.error_403_page]).should('exist').and('be.visible');
};
Snapshot / Visual Regression
SNAPSHOT_GROUP values
Each test category needs a unique value in support/index.ts. Always check the actual enum for current values — gaps in numbering are expected (deleted groups are not backfilled). Pick any unused number for new groups.
New test categories: Add a new enum value with a unique number that doesn't conflict with existing ones. Read support/index.ts to see the current values.
Snapshot indexing
const SUBGROUP_INDEX = 0; // unique per .cy.ts file in the group
const getSnapshotFullIndexAsString = getSnapshotIndexingFunction(SNAPSHOT_GROUP.MY_GROUP, SUBGROUP_INDEX);
// Prefer explicit, stable IDs for new specs and specs undergoing capture consolidation.
takeSnapshotAndCompare(getSnapshotFullIndexAsString(0), 'empty state');
takeSnapshotAndCompare(getSnapshotFullIndexAsString(3), 'filled state');
Keep existing snapshot indices and labels when removing neighboring captures; gaps are intentional.
Use explicit IDs consistently throughout a converted spec, with a unique ID per capture.
Do not mix explicit and automatic IDs in one spec. The no-argument form remains supported
for untouched legacy specs, but its sequential IDs depend on the preceding executed tests.
Legacy retry tracking uses the complete Cypress.currentTest.titlePath, including parent suites;
never identify tests by the leaf title alone because sibling suites can reuse it.
New captures in an explicit-ID spec get a new unused index; do not backfill removed IDs.
Different entry points or persistence paths do not each need a screenshot of the same state.
Before removing a capture, identify its retained visual owner and preserve explicit assertions
for the original flow. Keep distinct layout/overlay/form states and required deferred readiness.
Remove only the corresponding obsolete PNGs and preserve retained reference names.
This does not authorize baseline regeneration or automatic acceptance of diffs.
Blackout rules
- Screenshot blackouts skip missing TIDs; assert required content before the screenshot.
- Place image blackout TIDs on fixed-size wrappers, not the intrinsic dimensions of an
<img>. - Only blackout TIDs present on the page being screenshotted
- Common blackouts for ALL pages:
footer_social_links,footer_payment_images,footer_copyright - Dynamic images:
product_list_item_image,comparison_product_image,stores_map,store_opening_status,category_bestseller_image - Use
zIndexoption when blackout needs to cover overlapping elements
Blackout product images and transport/payment icons
When taking snapshots, blackout images and icons, because they differ between environments:
Product images by page:
| Page | TID to blackout |
| --- | --- |
| Product detail | product_detail_main_image |
| Add-to-cart popup | add_to_cart_popup_image |
| Cart | cart_list_item_image |
| Order summary sidebar | order_summary_cart_item_image |
| Products blocking transport selection | transport_unavailability_product_image |
| Order confirmation | order_summary_cart_item_image (same component as order summary) |
| Order list (customer orders) | order_list_product_image |
| Order detail | order_detail_item_image |
Transport & payment icons by page:
| Page | TID to blackout |
| --- | --- |
| Transport & payment step | transport_and_payment_list_item_image |
| Delivery options popup (product detail) | transport_and_payment_list_item_image (shared TransportAndPaymentItemLabel), delivery_options_variant_image (variant select), store_opening_status (pickup store list) |
| Order summary sidebar | order_summary_transport_and_payment_image |
| Order detail | order_list_transport_and_payment_image (shared ElementWithImage component) |
Capture modes
// Full page (default)
takeSnapshotAndCompare(name, 'label', { capture: 'fullPage' });
// Viewport only
takeSnapshotAndCompare(name, 'label', { capture: 'viewport' });
// Specific element by TID
takeSnapshotAndCompare(name, 'label', { capture: TIDs.layout_popup });
Dynamic content handling
Replace dynamic content (dates, times, etc.) before taking snapshots:
import { changeElementText } from 'support';
changeElementText(TIDs.store_opening_hours, staticData.openingHours, false);
changeElementText(TIDs.blog_article_publication_date, staticData.blogArticle.publicationDate);
The expected delivery date message (computed from the current date) is shown on the transport-and-payment
page, on pickup places, and in the product-detail delivery options popup. Before EVERY snapshot of those, call
changeExpectedDeliveryDateMessagesToStaticDemodata() from transportAndPaymentSupport.ts — it replaces
each TIDs.expected_delivery_date_message element with staticData.expectedDeliveryDateMessage, or with
staticData.expectedPersonalPickupDateMessage when the element's real text starts with the translated
"Personal pickup" prefix (the delivery vs. pickup wording is deterministic, so snapshots keep it truthful).
Shared interaction and screenshot readiness
waitForStableAndInteractiveDOM() waits for hydration, pending useDeferredRender() commits,
loading indicators and one quiet DOM interval. Visit/reload helpers call it once. The shared
observer has a deadline and disconnects on success, timeout or navigation; do not reintroduce
cypress-wait-for-stable-dom or duplicate blanket waits.
data-deferred-render-pending tracks deferred hook commits, not all lazy imports or API requests.
Keep scenario-specific assertions for required content and real interaction readiness.
takeSnapshotAndCompare() additionally retains page scrolling, prepares temporary styles,
waits for fonts and relevant unmasked images, then settles the DOM before measuring masks.
It restores temporary styles/masks after capture and on failure. Scrollbars are hidden once
per document in window:before:load, before the application measures scroll-lock compensation;
do not toggle scrollbar visibility around individual captures or rely on a preceding screenshot.
Do not disable deferred rendering,
change its scheduling, or increase fixed waits to hide a failure. Keep image TIDs on fixed wrappers.
Transport and payment readiness
waitForTransportAndPaymentToBeInteractive(paymentState) requires the expected payment-section state:
use 'absent' when no transport is selected, and 'available' when the payment section must be visible
with enabled radio inputs. Deselecting only the payment keeps the section 'available'.
Do not infer this state from a one-time DOM lookup: an exiting payment section can still be mounted
while its removal animation is running.
Known Gotcha: .within() + waitForStableAndInteractiveDOM
NEVER call cy.waitForStableAndInteractiveDOM() inside .within() — it does cy.get('body[data-hydrated="true"]') which fails when scoped to a non-body element.
// BAD — hydration error
cy.getByTID([TIDs.store_list]).within(() => {
cy.waitForStableAndInteractiveDOM(); // FAILS!
});
// GOOD — use .find() instead
cy.getByTID([TIDs.store_list]).find('[aria-expanded="false"]').first().click();
cy.waitForStableAndInteractiveDOM();
Custom Commands Reference
Navigation & DOM Stability
| Command | Description |
| -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| cy.visitAndWaitForStableAndInteractiveDOM(url) | Visit B2C page + wait for hydration + stable DOM |
| cy.visitB2bAndWaitForStableAndInteractiveDOM(path, options?) | Visit B2B page (prepends b2bDomain.baseUrl) + wait |
| cy.reloadAndWaitForStableAndInteractiveDOM() | Reload + wait |
| cy.waitForStableAndInteractiveDOM() | Wait for: stable DOM, no skeleton, no nprogress, no loader, hydrated |
| cy.waitForHydration() | Wait for body[data-hydrated="true"] |
| visitEntityByUuid(type, uuid) | Navigate to entity by UUID via GraphQL slug lookup. Types: 'category', 'product', 'blogCategory', 'blogArticle', 'article', 'brand', 'flag', 'store' |
GraphQL API Commands
| Command | Description |
| ---------------------------------------------------- | ------------------------------------------------------------------------ |
| cy.addProductToCartForTest(uuid?, qty?) | Add product to cart via GraphQL (defaults to helloKitty, qty 1) |
| cy.addPromoCodeToCartForTest(promoCode) | Apply promo code |
| cy.preselectTransportForTest(uuid, pickupPlaceId?) | Select transport method |
| cy.preselectPaymentForTest(uuid) | Select payment method |
| cy.login(email?, pw?) | B2C login via GraphQL (defaults to staticData.user). Caches tokens. |
| cy.loginB2b(email, pw) | B2B login via GraphQL. Sets cookies for B2B domain. |
| cy.logout() | Logout via GraphQL + clear cookies |
| cy.createOrder(variables) | Create order via GraphQL. Returns { urlHash }. |
| cy.registerAsNewUser(input, shouldLogin?) | Register new user. If shouldLogin=true (default), sets auth cookies. |
| .checkGQL(operationName) | Chain after cy.request() to validate GraphQL response and extract data |
Helper Functions (from support/index.ts)
| Function | Description |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| initializePersistStoreInLocalStorageToDefaultValues() | Reset localStorage persist store — call in every beforeEach |
| checkAndHideSuccessToast(text?) | Assert success toast exists (optionally with text), click to dismiss |
| checkAndHideErrorToast(text?) | Assert error toast exists, click to dismiss |
| checkAndHideInfoToast(text?) | Assert info toast exists, click to dismiss |
| checkUrl(url) | Assert cy.url().should('contain', url) |
| getHeaderElementByTID(tid) | Scroll to the top and find a descendant in the main header |
| openHeaderUserMenu() | Scroll to the top and open the main header account menu |
| checkIsUserLoggedIn() | Assert my_account_link contains "My account" translation |
| checkIsUserLoggedOut() | Assert my_account_link contains "Login" translation |
| goToEditProfileFromHeader() | Open account menu, click edit profile link |
| checkLoaderOverlayIsNotVisibleAfterTimePeriod(ms?) | Wait then assert loader_overlay not exist |
| changeElementText(tid, text, isRightAfterSSR?) | Replace element text (for dynamic content in snapshots) |
| loseFocus() | Blur currently focused element |
| checkPopupIsVisible(shouldClose?) | Assert layout_popup visible, optionally press Esc |
| changeCartItemQuantityWithSpinboxInput(qty, catnum) | Type quantity into cart item's spinbox |
| changeProductListItemQuantityWithSpinboxInput(qty, catnum) | Type quantity into product list item's spinbox |
| goToPageThroughSimpleNavigation(index) | Click pagination page by index |
| checkCanGoToNextOrderStep() | Assert order next button is visible and not disabled |
| takeSnapshotAndCompare(name, label, options?, callbackBeforeBlackout?) | Take visual regression snapshot |
| getSnapshotIndexingFunction(group, subgroup) | Returns snapshot ID function; pass an explicit stable index, or omit for legacy counting |
| checktHeadlineText(translationKey) | Check h1 text matches translation (with fallback) |
| checkFormLineError(errorText?) | Assert form_line_error exists with optional translated text |
| checkNumberOfApiRequestsTriggeredByActions(actions, count, requestName) | Intercept and count GraphQL requests |
Static Test Data (fixtures/demodata.ts)
Products
staticData.products.helloKitty; // { uuid, name, fullName, catnum: '9177759' }
staticData.products.philips32PFL4308; // { uuid, catnum: '9176508' }
staticData.products.televisionPhilipsM; // { uuid } — main variant with 6 sellable variants (incl. philips100)
staticData.products.a4techMouse; // { uuid, catnum: '5960453', name }
staticData.products.philips100; // { uuid, catnum: 'PHILIPS100', name: '100" Philips [V]' } — variant of televisionPhilipsM
staticData.products.panasonicDmcFt5ep; // { catnum: '5965907', name: 'PANASONIC DMC FT5EP' }
staticData.products.delonghi; // { uuid, catnum: '9771339', name } — has gift plan (gift: giftTicket100czk)
staticData.products.giftTicket100czk; // { uuid, catnum: '9176544MS', name } — gift product
staticData.products.electronicGiftVoucher1000; // { uuid, catnum: 'VOUCHER1000', name } — electronic gift voucher product (voucher-only carts skip transport)
Use fullName ?? name for exact displayed/API product-name assertions; name remains
the base name used by search scenarios. The Hello Kitty fixture includes a prefix and suffix.
Categories
staticData.categories.electronics; // { uuid }
staticData.categories.personalComputers; // { uuid }
Users
staticData.user; // { email: 'no-reply@shopsys.com', password: 'user123', uuid }
staticData.customer1; // { email, emailRegistered, firstName, lastName, phone, billingStreet, billingCity, billingPostCode, password }
staticData.b2bOwner; // { email: 'jozef.novotny@shopsys.com', password: 'user123' }
staticData.b2bUser; // { email: 'marek.horvat@shopsys.com', password }
staticData.b2bLimitedUser; // { email: 'peter.kovac@shopsys.com', password }
staticData.b2bCatalogUser; // { email: 'jiri.katalogovy@shopsys.com', password }
staticData.b2bAccountant; // { email: 'jana.ucetni@shopsys.com', password }
Delivery Addresses
staticData.deliveryAddress; // { firstName: 'Janek', lastName, company, phone, street, city, postCode, country: 'CZ' }
staticData.deliveryAddress2; // { firstName: 'Tomáš', ... }
Payment & Transport UUIDs
staticData.payment.creditCard.uuid;
staticData.payment.cash.uuid;
staticData.payment.onDelivery.uuid;
staticData.payment.goPayCreditCard.uuid;
staticData.transport.personalCollection.uuid;
staticData.transport.personalCollection.storeOstrava; // { uuid, name }
staticData.transport.personalCollection.storePardubice; // { uuid, name }
staticData.transport.czechPost.uuid;
staticData.transport.ppl.uuid;
URLs
// B2C URLs
(url.cart,
url.search,
url.brandsOverview,
url.login,
url.registration,
url.stores,
url.contactForm,
url.productComparison);
(url.order.transportAndPayment, url.order.contactInformation, url.order.orderConfirmation, url.order.orderDetail);
(url.customer.orders,
url.customer.editProfile,
url.customer.complaints,
url.customer.newComplaint,
url.customer.complaintDetail);
// B2B URLs
(b2bUrl.login, b2bUrl.cart, b2bUrl.registration);
(b2bUrl.order.transportAndPayment,
b2bUrl.order.contactInformation,
b2bUrl.order.orderConfirmation,
b2bUrl.order.orderDetail,
b2bUrl.order.orderWithdrawal);
(b2bUrl.customer.users,
b2bUrl.customer.complaints,
b2bUrl.customer.newComplaint,
b2bUrl.customer.complaintDetail,
b2bUrl.customer.orders,
b2bUrl.customer.editProfile,
b2bUrl.customer.changePassword);
Other Static Data
staticData.promoCode; // 'test'
staticData.giftVouchers.unredeemed1000; // 'HAPPYDAY2345' — 1000 CZK demo gift voucher (apply/remove in cart, do NOT complete orders with it)
staticData.giftVouchers.fullPaymentMatchingOrderTotal; // 'MAXPAY234567' — gift voucher whose value matches the test order total exactly, dedicated to full-payment order tests
staticData.giftVouchers.lastOrderCashMatchingCartTotal; // 'CASHLASTPAY1' — gift voucher matching the A4tech mouse with free personal collection and cash payment
staticData.giftVouchers.lastOrderVoucherMatchingOrderTotal; // 'VOUCHERLAST1' — gift voucher matching an order that is repeated without its voucher
staticData.openingHours; // '09:00 - 11:00, 13:00 - 17:00'
staticData.orderNote; // 'Just a tiny note in the order.'
staticData.expectedDeliveryDateMessage; // 'Delivery on Tuesday 10/26'
staticData.expectedPersonalPickupDateMessage; // 'Personal pickup on Tuesday 10/26'
staticData.order.number; // '1234567890'
staticData.order.numberHeading; // 'Order number 1234567890'
staticData.order.creationDate; // '10/26/1999 10:10 AM'
staticData.blogArticle.publicationDate; // '10/26/1999'
staticData.blogArticle.grapesJs.uuid;
staticData.article.creationDate; // '10/26/1999'
staticData.article.forPress.uuid;
Translation System
The test suite has a multi-layer translation system that supports running tests in different locales (en, cs, sk). Understanding this is essential for writing assertions on visible text.
Architecture Overview
translationKeys.ts → Defines English key strings used for lookups
support/translations.ts → Core module: t() function, loadAllTranslations()
support/index.ts → Global `translations` object, auto-loaded before all tests
public/locales/{locale}/common.json → Primary translation source (JSON)
app-translations/dataFixtures.{locale}.po → Fallback translations (.PO format)
Translation Fallback Chain
When t(key) is called, it resolves in this order:
- common.json —
public/locales/{TEST_LOCALE}/common.json(primary) - .po files —
dataFixtures.{locale}.pofrom/app/app-translations/(fallback for demo data) - Key itself — returns the original key string if not found anywhere
Two Ways to Use Translations in Tests
1. Global `translations` object (pre-loaded, synchronous access)
The translations object is loaded once in a before() hook via loadAllTranslations() and available globally. It contains translated values for all keys defined in fixtures/translationKeys.ts.
import { translations } from 'support';
// Use for placeholder assertions
cy.get('#registration-form-email').should('have.attr', 'placeholder', translations.placeholder.email);
// Use for toast messages
checkAndHideSuccessToast(translations.toast.success.accountCreated);
// Use for checking logged-in state
cy.getByTID([TIDs.my_account_link]).should('be.visible').contains(translations.link.myAccount);
Available categories on the translations object (mirrors translationKeys.ts structure):
translations.placeholder.*— Form placeholder textstranslations.payment.*— Payment method namestranslations.transport.*— Transport namestranslations.order.created,translations.order.confirmation.*,translations.order.promoCodetranslations.link.*— Link textstranslations.button.*— Button textstranslations.filter.*— Filter labelstranslations.toast.success.*/translations.toast.error.*/translations.toast.info.*
2. `t()` function (async, for one-off lookups)
For translation keys NOT in translationKeys.ts, use the t() function directly. It returns a Cypress.Chainable<string> and supports parameter substitution.
import { t } from 'support/translations';
// Simple lookup
t('Please enter email').then((translatedText) => {
cy.getByTID([TIDs.form_line_error]).contains(translatedText).should('be.visible');
});
// With parameter substitution ({{ param }} syntax)
t('Order number {{ orderNumber }} has been sent', { orderNumber: '12345' }).then((text) => {
cy.contains(text);
});
Translation-Aware Helper Functions
These helpers use translations internally — pass English key strings and they handle lookup:
// checkFormLineError — looks up the key via t(), finds it in form_line_error TID
checkFormLineError('Please enter email');
checkFormLineError('Please enter password');
checkFormLineError(); // just check any error exists
// checktHeadlineText — checks h1 against key (tries direct match first, then t() lookup)
checktHeadlineText('Stores');
checktHeadlineText('Product comparison');
// checkIsUserLoggedIn / checkIsUserLoggedOut — uses translations.link.myAccount / translations.button.login
checkIsUserLoggedIn();
checkIsUserLoggedOut();
Real-World Translation Patterns
// Form filling with placeholder verification
cy.get('#registration-form-firstName')
.should('have.attr', 'placeholder', translations.placeholder.firstName)
.type('John');
cy.get('#registration-form-street')
.should('have.attr', 'placeholder', translations.placeholder.street)
.type('Main Street 123');
// Toast with translated text
checkAndHideSuccessToast(translations.toast.success.userSaved);
checkAndHideInfoToast(translations.toast.info.cartModified);
// Order confirmation text check
cy.getByTID([TIDs.order_confirmation_page_text_wrapper]).should(
'contain.text',
translations.order.confirmation.czechPost,
);
// Validation error checking (keys resolved via t())
checkFormLineError('Please enter email');
checkFormLineError('You have to agree with our privacy policy');
Key Files
project-base/storefront/cypress/fixtures/translationKeys.ts— All translation key strings (English)project-base/storefront/cypress/support/translations.ts— Coret()function,loadAllTranslations(), .po parserproject-base/storefront/public/locales/{en,cs,sk}/common.json— JSON translation filesproject-base/app/translations/dataFixtures.{locale}.po— .PO fallback translations
Common Test Patterns
Popup interaction (confirm/dismiss)
// Trigger action that opens popup
cy.getByTID([TIDs.comparison_remove_all_button]).click();
// Verify popup is visible
cy.getByTID([TIDs.layout_popup]).should('be.visible');
// Confirm action
cy.getByTID([TIDs.popup_confirm_button]).click();
cy.waitForStableAndInteractiveDOM();
// Or dismiss
cy.realPress('{esc}');
cy.getByTID([TIDs.layout_popup]).should('not.exist');
Toast message verification
import { checkAndHideSuccessToast } from 'support';
checkAndHideSuccessToast(); // just check exists
checkAndHideSuccessToast('User profile has been changed successfully'); // check with text
Access control / 403 testing
cy.loginB2b(staticData.b2bCatalogUser.email, staticData.b2bCatalogUser.password);
cy.visitB2bAndWaitForStableAndInteractiveDOM(b2bUrl.customer.users, { failOnStatusCode: false });
cy.getByTID([TIDs.error_403_page]).should('exist');
Element absence testing
// Verify element does NOT exist (e.g., restricted button)
cy.getByTID([TIDs.blocks_product_addtocart]).should('not.exist');
cy.getByTID([TIDs.complaints_list_create_complaint_manually_button]).should('not.exist');
Navigate to entity by UUID
import { visitEntityByUuid } from 'support/navigation';
visitEntityByUuid('category', staticData.categories.electronics.uuid);
visitEntityByUuid('product', staticData.products.a4techMouse.uuid);
Filter interaction
Start from known category/filter data. Select a specific parameter or price range,
wait for the relevant state/request, and assert the expected selected values and
matching results. For clear-filter tests, first assert the active filter and clear
control exist, then clear and assert the reset state; do not skip the action conditionally.
Use the project's readiness helper in addition to the scenario-specific assertions.
Sort interaction
cy.getByTID([[TIDs.blocks_sortingbar_option_, 'PRICE_ASC']]).filter(':visible').click();
cy.waitForStableAndInteractiveDOM();
Select the intended named sort option (for example PRICE_ASC) rather than an
arbitrary index, and assert the resulting sort state and product ordering. A filter
remaining in the URL alone does not prove sorting. Use the visible control without
forcing the action unless the component-specific exception above applies.
Product count assertion
cy.getByTID([TIDs.product_list_item_image]).should('have.length.greaterThan', 0);
cy.getByTID([TIDs.product_list_item_image]).then(($items) => {
expect($items.length).to.be.lte(initialCount);
});
Main and fixed header navigation
// Regular flows always use the main header in a stable scroll position.
openHeaderUserMenu();
cy.getByTID([TIDs.header, TIDs.my_account_link, TIDs.user_menu_edit_profile_link])
.filter(':visible')
.first()
.should('be.visible')
.click({ scrollBehavior: false });
// A dedicated fixed-header test scopes every action explicitly to the fixed header.
cy.scrollTo('bottom');
cy.getByTID([TIDs.fixed_header]).should('be.visible');
cy.getByTID([TIDs.fixed_header, TIDs.my_account_link]).click({ scrollBehavior: false });
Do not dynamically choose between the main and fixed headers. Regular feature tests should use the main header after
scrolling to the top. Test fixed-header behavior separately and scope all selectors under TIDs.fixed_header.
Retry configuration is not a flakiness fix
Inspect the configured retries when diagnosing failures, but fix the underlying
state/timing dependency. A pass after retry is not evidence of deterministic behavior;
changing retry counts requires an explained purpose, not just a green run.
Naming Conventions
`describe()` block naming
Format: 'Feature Name Tests' or 'Feature Name Tests (SSP-XXXX)' with optional Jira ticket reference.
// Top-level describe — feature name + "Tests", optionally with ticket
describe('Product Comparison Tests (SSP-1719)', () => { ... });
describe('Stores Tests (SSP-1741)', () => { ... });
describe('Cart Page Tests', () => { ... });
describe('Create Order Tests', () => { ... });
// Nested describe for sub-groups (B2B role-based, access control)
describe('Customer Users (B2B) Tests', () => {
describe('As B2B Owner', () => { ... });
describe('Access control', () => { ... });
});
// Multiple describe blocks in one file for logical grouping
describe('Registration Tests (Basic)', () => { ... });
describe('Registration Tests (B2B)', () => { ... });
describe('Registration Tests (Repeated Tries)', () => { ... });
`it()` block naming
Two patterns exist depending on test style:
Pattern 1: [Short Label] prefix + should description — used in most test files. The bracket label is a short identifier (2-4 words, Title Case) that groups related tests and appears in snapshot names.
// Good — clear short label + descriptive "should" sentence
it('[Empty Comparison] should show empty comparison page', () => { ... });
it('[Add From Listing] should add a product to comparison from category listing', () => { ... });
it('[Remove All] should add products then remove all from comparison', () => { ... });
it('[Parameter Checkbox Filter] should filter products by parameter checkbox and verify URL persistence', () => { ... });
it('[Anon Home Cash] should create order as unlogged user (transport to home, cash on delivery)', () => { ... });
it('[Prefilled Cart] should log in, add product to cart to an already prefilled cart', () => { ... });
it('[Transport Fee] should change price for transport when cart is large enough', () => { ... });
Pattern 2: Plain should description — used in B2B nested describe blocks where the parent already provides context.
describe('As B2B Owner', () => {
it('should display the customer users table', () => { ... });
it('should open add user popup and add a new user', () => { ... });
});
describe('Access control', () => {
it('should show 403 for Limited User trying to access customer users page', () => { ... });
});
Rules:
- Always use arrow
() =>for allit()blocks (both with and without snapshots) - The bracket label should be unique within the
describeblock - Keep the
shoulddescription specific — describe what the test does AND verifies
File naming
e2e/
featureName/
featureName.cy.ts # Main test file (camelCase, matches directory)
featureNameSupport.ts # Support helpers (camelCase + "Support")
Multiple test files in one directory are fine:
cart/cartPage.cy.ts, cartLogin.cy.ts, cartInHeader.cy.ts, productAddToCart.cy.ts
order/createOrder.cy.ts, contactInformation.cy.ts, orderRepeat.cy.ts
Workflow for Writing Tests
- Search existing complete flows across
project-base/storefront/cypress/by component, TID, helper, and interaction type; reuse the closest verified pattern - Inspect the page and component with
/playwright-clion localhost orhttps://ssfwcc.dev.shopsys.cloud/and read the relevant React implementation when lifecycle behavior affects the test - Check existing TIDs in
project-base/storefront/cypress/tids.ts— reuse what exists - Add missing TIDs to
tids.ts+ React components (usedata-tidfor HTML elements,tidprop for Button/LinkButton) - Create or extend a support file for reusable helpers (co-locate as
featureNameSupport.ts) - Write test using
cy.getByTID()consistently,initializePersistStoreInLocalStorageToDefaultValues()in beforeEach - Add SNAPSHOT_GROUP only when adding justified visual coverage in a new snapshot category (unique number in support/index.ts enum); functional-only scenarios need no snapshot infrastructure
- Provide manual verification with
make run-specific-test-regression SPEC=e2e/path/to/test.cy.ts; do not start Cypress yourself. References are generated and reviewed on CI, not locally. - Verify tooling with
docker compose exec -T storefront sh -lc 'cd cypress && npm run typecheck'when the container is already running.
Real-World Example: Complete Test + Support File
comparisonSupport.ts
import { url } from 'fixtures/demodata';
import { checkAndHideSuccessToast, checkUrl } from 'support';
import { TIDs } from 'tids';
export const visitComparisonPage = () => {
cy.visitAndWaitForStableAndInteractiveDOM(url.productComparison);
checkUrl(url.productComparison);
};
export const checkComparisonIsEmpty = () => {
cy.getByTID([TIDs.comparison_empty_state]).should('be.visible');
};
export const addProductToComparisonFromListing = (catnum: string) => {
cy.getByTID([[TIDs.blocks_product_list_listeditem_, catnum], TIDs.product_compare_button])
.should('be.visible')
.click();
};
export const checkComparisonPopupVisible = () => {
cy.getByTID([TIDs.comparison_popup]).should('be.visible');
};
export const closeComparisonPopup = () => {
cy.realPress('{esc}');
};
export const goToComparisonFromPopup = () => {
cy.getByTID([TIDs.comparison_popup_link]).click();
cy.waitForStableAndInteractiveDOM();
};
export const removeAllFromComparison = () => {
cy.getByTID([TIDs.comparison_remove_all_button]).click();
cy.getByTID([TIDs.layout_popup]).should('be.visible');
cy.getByTID([TIDs.popup_confirm_button]).click();
cy.waitForStableAndInteractiveDOM();
checkAndHideSuccessToast();
};
export const removeProductFromComparison = (catnum: string) => {
cy.getByTID([[TIDs.comparison_product_, catnum], TIDs.comparison_remove_product_button])
.should('be.visible')
.click();
cy.waitForStableAndInteractiveDOM();
checkAndHideSuccessToast();
};
export const checkComparisonProductCount = (count: number) => {
cy.getByTID([TIDs.page_title]).should('contain', `(${count})`);
};
productComparison.cy.ts
import {
addProductToComparisonFromDetail,
addProductToComparisonFromListing,
checkComparisonIsEmpty,
checkComparisonPopupVisible,
checkComparisonProductCount,
closeComparisonPopup,
goToComparisonFromPopup,
removeAllFromComparison,
removeProductFromComparison,
visitComparisonPage,
} from './comparisonSupport';
import { staticData, url } from 'fixtures/demodata';
import {
checkUrl,
getSnapshotIndexingFunction,
initializePersistStoreInLocalStorageToDefaultValues,
SNAPSHOT_GROUP,
takeSnapshotAndCompare,
} from 'support';
import { visitEntityByUuid } from 'support/navigation';
import { TIDs } from 'tids';
const SUBGROUP_INDEX = 0;
const getSnapshotFullIndexAsString = getSnapshotIndexingFunction(SNAPSHOT_GROUP.COMPARISON, SUBGROUP_INDEX);
describe('Product Comparison Tests (SSP-1719)', { retries: { runMode: 0 } }, () => {
beforeEach(() => {
initializePersistStoreInLocalStorageToDefaultValues();
});
it('[Empty Comparison] should show empty comparison page', () => {
visitComparisonPage();
checkComparisonIsEmpty();
takeSnapshotAndCompare(getSnapshotFullIndexAsString(0), 'empty comparison', {
blackout: [
{ tid: TIDs.footer_social_links },
{ tid: TIDs.footer_payment_images },
{ tid: TIDs.footer_copyright },
],
});
});
it('[Add From Listing] should add product from listing and navigate to comparison', () => {
visitEntityByUuid('category', staticData.categories.electronics.uuid);
addProductToComparisonFromListing(staticData.products.helloKitty.catnum);
checkComparisonPopupVisible();
goToComparisonFromPopup();
checkUrl(url.productComparison);
checkComparisonProductCount(1);
takeSnapshotAndCompare(getSnapshotFullIndexAsString(1), 'one product from listing', {
blackout: [
{ tid: TIDs.comparison_product_image },
{ tid: TIDs.footer_social_links },
{ tid: TIDs.footer_payment_images },
{ tid: TIDs.footer_copyright },
],
});
});
it('[Remove All] should add products then remove all', () => {
visitEntityByUuid('category', staticData.categories.electronics.uuid);
addProductToComparisonFromListing(staticData.products.helloKitty.catnum);
checkComparisonPopupVisible();
closeComparisonPopup();
visitEntityByUuid('product', staticData.products.a4techMouse.uuid);
addProductToComparisonFromDetail();
checkComparisonPopupVisible();
goToComparisonFromPopup();
removeAllFromComparison();
checkComparisonIsEmpty();
});
});
Cypress Config Highlights
- Versions: Cypress 16.1.1, cypress-visual-regression 6.0.1 and cypress-real-events 1.15.1; Node.js in CI comes from
NODE_VERSIONinproject-base/storefront/cypress/docker/Dockerfile, the same version as the storefront images. Public configuration usesexpose/Cypress.expose()and CLI--expose; usecy.env()for secrets, never expose them. - Browser:
defaultBrowser: 'chrome-for-testing'applies to regression, regeneration and smoke commands. The shared Cypress Dockerfile pins Chrome for Testing 155.0.8059.39 using the officialcypress/factoryimage pinned by version and digest. Rebuild that image after browser changes; do not fall back to Electron or an automatically updated local Chrome. Browser updates require reviewed CI-generated baselines, not automatic acceptance of differences. Native local runs need Chrome for Testing installed and discoverable; their pixels are not interchangeable with CI references. - CLI tooling: glob 13, inquirer 14 and uuid 14. The Cypress TypeScript compiler stays aligned with storefront at 5.9.3; do not assume a test-library update also authorizes an application-wide compiler migration.
- Viewport: 1600x720 (covers the five-column product grid at the 1560px
xxlbreakpoint) - Headless Chromium window: 1920x1080 in
before:browser:launch, with device scale factor 1; the application viewport stays 1600x720. The outer window must leave room for browser/runner chrome. Do not equate window size with viewport size: that produced clipped 1600x633 viewport snapshots and visible runner scrollbars. Verify the actual PNG dimensions and popup content after browser changes; do not accept smaller captures by regeneration. - Default command timeout: 20s
- Video: enabled
- Visual regression error threshold: 0.005 (0.5%); a passing comparison does not prove that the reference is current. Verify important values with explicit assertions.
- Deferred rendering: preserve page-capture scrolling; the storefront intentionally delays rendering for web vitals. Hydration or a quiet DOM alone does not prove that all deferred content is ready.
- Retries in runMode: 2 (configurable per test with
{ retries: { runMode: 0 } }) - Test groups: Controlled by
GROUPenv var for CI (e.g.,GROUP=authentication,GROUP=b2b) - Promo-code and registration rate limits: GitHub Actions Cypress and project GitLab CI compose configurations mount the shared
project-base/gitlab/cypress-rate-limiter.yamlinto their PHP test containers (gitlab/cypress-rate-limiter.yamlin downstream projects). The GitLab mount is read-only; the GitHub Actions mount must stay writable, because the fork build runschown -Rover the application directory and fails on a read-only mount. It disables the apply-code and the customer registration quotas because scenarios/retries share an IP. The isolated CI backends run in Symfony prod mode, sowhen@testwould not apply; isolation comes from the CI-only mount. Never mount it in review/live deployments or copy it into the application's regular config. Verify throttling separately without this override, not through cart-flow timing or longer waits. - Translation loading: Auto-loads
.pofiles from/app/app-translations/, falls back to English
Keeping This Skill Up-to-Date
When you change the Cypress test infrastructure, update this skill file (.agents/skills/cypress-tests/SKILL.md) where its guidance is affected. Cross-layer ownership stays in the canonical storefront-tests skill. Specifically:
- New custom command → Add it to the Custom Commands Reference tables
- New static data (products, users, URLs) → Add to the Static Test Data section
- New TID patterns (new section/category of TIDs) → No action needed (skill references
tids.tsdirectly) - New test category/directory → Add to the Existing Test Categories table
- New translation key category → Update the
translationsobject categories list - Changed test workflow or conventions → Update relevant sections