User-flows Tests

KeyValue
StatusActive
OwnerQA Automation
Updated2026-03-26
ScopeAuthenticated subscription and paywall journeys across all 6 CNC sites

User-flows tests exist because login, session management, paywall access, and subscription routing are the revenue-critical paths on CNC sites. A reader who cannot log in, cannot reach premium content, or sees a broken subscription page is a reader who does not convert. These tests keep those paths verified on a nightly basis.

What The Suite Does

CapabilityWhat It Means
fresh loginperforms the full redirect through login.cncenter.cz and confirms user is logged in
premium accessverifies a premium user does not hit a paywall on premium content
paywall enforcementverifies an anonymous user does see a paywall on premium content
subscription pageconfirms the subscription page loads and a buy button is present
logoutconfirms the user can log out and the login button reappears
session persistenceconfirms session survives navigating to an article and returning to homepage
SSO cross-siteconfirms login on one CNC domain carries session to another domain

Current Shape

MetricCurrent Snapshot
total tests34
passing30
skipped by design4
pass rate88.2% (30/30 among eligible tests)
sites covered6
schedulenightly
parallelismsequential only (--workers=1)

What "Skipped By Design" Means

Four tests are marked as skipped by design, not failures.

Skip ReasonWhich Tests
Opinio has no shared CNC credentials configured (supportsAuth: false)Test A (login), Test E (logout), Test F (session) on Opinio
Blesk has no premium subscription product (hasSubscription: false)Test D (subscription page) on Blesk

These are permanent skips because the underlying capability does not exist on those sites. They are counted as skipped, not failed.

Test Matrix By Site

SiteTest A: LoginTest B: Premium AccessTest C: PaywallTest D: SubscriptionTest E: LogoutTest F: SessionNotes
Autopasspasspasspasspasspass/autoplus premium path
Bleskpass— (no premium)— (no premium)skippedpasspassno subscription product
E15passpasspasspasspasspass/e15-premium path
iSportpasspasspass— (no sub selector)passpasspaywall via iSport premium
Reflexpasspasspasspasspasspass/premium path
Opiniopasspass— (no sub selector)supportsAuth=false; known paywall URL

SSO Tests (Test G)

Three cross-site SSO pairs are verified separately.

PairDomain RelationshipExpected Behavior
Blesk → iSportsame domain (.blesk.cz)auto-authenticated, no credentials needed
Auto → E15cross-domainSSO redirect, no credential entry
E15 → Reflexcross-domainSSO redirect, no credential entry

CPEX Deadlock Pattern

The CPEX consent system can cause test hangs on E15 when a subscription modal overlay (#cpexSubs_modalWrapper) appears after the initial consent is dismissed. This overlay has a high z-index and intercepts clicks meant for the subscription button.

Where It OccursHow It Is Handled
Test D on E15 (subscription page)force-remove #cpexSubs_veil, #cpexSubs_modalWrapper, #cpexSubs_modal via page.evaluate() before clicking the subscription link

The fix is in the Test D step block and runs only on sites where a CPEX overlay is a known risk.

Paywall Detection Strategy

Test C (non-premium paywall) runs as an anonymous user and uses page.waitForFunction() to poll for paywall elements rather than standard Playwright locators. This is intentional.

Why waitForFunctionReason
Piano/Tinypass is JavaScript-injectedthe paywall DOM node does not exist at domcontentloaded
Locator handlers can deadlockwaitForFunction() runs in page context without triggering Playwright handler loops
Height check requiredsome paywall elements render in DOM with height: 0 — the check requires getBoundingClientRect().height > 0

Sequential-Only Constraint

This suite must run with --workers=1. Running parallel workers causes storageState collisions.

ProblemWhy
Multiple tests share the same storageState file (e.g. blesk-premium.json)when test B (premium) passes and its trace is deleted, test E (logout) tries to reopen the same trace file ID and gets ENOENT
Traces are disabled for user-flows projectthis avoids the trace file collision entirely; traces are off in playwright.config.ts for this project

How To Run

CommandWhat It Does
npm run test:user-flowsAll 34 tests (sequential, --workers=1)
npm run test:user-flows -- --grep "auto"Auto only
npm run test:user-flows -- --grep "Test A"All login tests
npm run test:user-flows -- --grep "SSO"SSO tests only

Always use the npm script, which enforces --workers=1 via the project config. Never run this suite with multiple workers.

Auth Setup Dependency

User-flows depends on the auth-setup project, which runs first and saves storageState files. If auth-setup fails, all user-flows tests will fall back to fresh login inline.

StorageState File PatternPurpose
{site}-premium.jsonpre-authenticated session for premium user
consent-chrome.jsonpre-accepted consent state

StorageState files are stored in the directory referenced by STORAGE_STATE_DIR in playwright.config.ts.

NeedGo To
full user journey tests (no auth)E2E Tests
high-level suite listTest Types