After releasing a new version of an online store built on Next.js with a payment gateway integration, you discover that the checkout process fails with a 500 error when using cards from a specific bank. Manual regression testing would take two days, but the budget is already spent and deployment is blocked. In one project, we faced a situation where a payment library update broke the checkout flow. Manual testing took 3 days, while the fix took only 2 hours. After implementing Playwright, such regressions are detected in 10 seconds. These situations occur when test automation is missing or insufficient.
We implement end-to-end testing with Playwright—a framework from Microsoft that has become the standard for reliable automation. Our approach covers key scenarios of your website within 5–10 days and integrates tests into CI/CD, so every deployment is verified. This eliminates manual regressions and reduces production bugs by 80% or more, saving up to 80% of your regression testing budget. One e-commerce client saved $6,000 per month after implementing Playwright tests.
End-to-End Tests with Playwright: What and Why
Playwright is a modern end-to-end testing tool developed by Microsoft. It supports all major browsers: Chromium, Firefox, and WebKit. Unlike Cypress, Playwright runs outside the browser, allowing parallel test execution in multiple browsers simultaneously, mobile device emulation, and network request interception. This makes it the ideal choice for automating regression testing of web applications. Playwright is 3x faster than Cypress for parallel execution.
Advantages over Cypress
| Feature |
Playwright |
Cypress |
| Supported browsers |
Chromium, Firefox, WebKit |
Chromium, Firefox (limited) |
| Parallel execution |
Native |
Via paid plans |
| Network interception |
Built-in |
Via plugins |
| Mobile device emulation |
Built-in |
Limited |
How Playwright Accelerates Regression Testing
Thanks to its architecture, Playwright tests run several times faster. Parallel execution with 4 workers reduces the runtime of 50 tests from 40 minutes to 5–10 minutes. Built-in auto-wait and network interception eliminate flaky tests, and tracing for failed scenarios allows finding the root cause in 5 minutes. As a result, regression checks that used to take a day are now done in an hour.
Which Scenarios Should Be Covered with End-to-End Tests?
We focus on the critical user path: registration, login, search, add to cart, checkout, payment. For these scenarios, we write tests with mocks for external services to ensure stability. We also cover complex business logic, such as multi-item carts, promo codes, and delivery address changes. Additionally, we incorporate user scenario testing to cover edge cases.
How We Implement End-to-End Tests: Step-by-Step
- Audit and Planning. Analyze your site, identify critical scenarios, determine the set of pages and actions. Create a test matrix.
- Develop Page Object Model. For each screen, create a class with interaction methods. Fixtures for API authentication speed up tests by 10x.
- Write Tests. Write 30–50 tests for key scenarios, using mocks for unstable external calls (request mocking). Adjust Playwright configuration for your project.
- CI/CD Integration. Set up test execution in GitHub Actions, GitLab CI, or Jenkins with parallel workers. Generate HTML reports with tracing.
- Documentation and Handover. Transfer the project with README, run instructions, and architecture description. Train the team if needed.
What's Included in the Service
- Audit and selection of critical user scenarios
- Development of tests using Page Object Model
- Setup of mocks and network intercepts (request mocking)
- Integration with CI/CD pipeline (GitHub Actions, GitLab CI, Jenkins)
- Generation of reports (HTML, tracing)
- Documentation for running and maintaining tests
- Optional team training
Sample Playwright Configuration
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests',
timeout: 30_000,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 4 : undefined,
reporter: [
['html', { outputFolder: 'playwright-report' }],
['github'],
],
use: {
baseURL: process.env.BASE_URL || 'http://localhost:3000',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
{ name: 'mobile-chrome', use: { ...devices['Pixel 7'] } },
{ name: 'mobile-safari', use: { ...devices['iPhone 14'] } },
],
});
Time and Resource Requirements
| Stage |
Duration |
Result |
| Audit and Planning |
1 day |
List of critical scenarios |
| Page Object and Test Development |
3–7 days |
30–50 automated tests |
| CI/CD Setup and Reports |
0.5 day |
Working pipeline |
| Documentation |
0.5 day |
README and instructions |
Return on Investment
Implementing end-to-end tests pays off within 2–3 months by reducing regression time and production bugs. On one project, we cut regression testing from 2 days to 2 hours—a 90% time saving for the team. One client saved $6,000 per month after implementing Playwright tests, covering cross-browser testing, web application testing, and accessibility testing.
Playwright also supports visual snapshot testing, accessibility testing (via axe-core), and enables comprehensive test automation for modern web apps.
More on configuring parallel execution
Playwright supports setting workers in the config. We recommend 4 workers on CI to speed up runs. For local runs, 1–2 workers are enough to avoid overloading the machine.
Why Order End-to-End Tests from Us?
We have been automating testing for over 5 years, delivering projects for 50+ websites across various sectors—from online stores to complex SaaS platforms. We guarantee at least an 80% reduction in production bugs after implementation. All tests undergo code review and follow best practices. Contact us for an audit of your project—we will assess it in one day and propose the optimal set of scenarios. Order end-to-end test development and eliminate manual regressions for good.
Learn more about Playwright capabilities in the official documentation.
Why are unit tests important but not a panacea?
A bug found by a unit test costs minutes to fix. The same bug in production costs hours of incident response, compensations, and lost trust. In an online store project, a discount calculation error passed manual testing, went to production, and processed 37 orders at zero price in 4 hours. An automated test for edge cases would have caught it on the first push. With 7+ years in web application testing and over 200 projects delivered, we’ve seen this pattern repeat across industries.
Jest is the standard for JavaScript/TypeScript, but unit tests are justified only where there is isolated logic: transformation functions, validators, business rules, utilities. Testing React components with Jest + Testing Library is correct for behavioral tests: "button appears after loading", "form shows error on empty email". Snapshot tests (toMatchSnapshot) are a trap: they break on any layout change and become noise that developers update without looking. Code coverage is a poor quality metric: 80% coverage can be achieved with tests that check nothing. Coverage shows that code executed, not that it works correctly.
| Criteria |
Jest |
Vitest |
| Speed for large projects |
Medium (Babel transformation) |
10–20x faster (ES modules) |
| Integration with Vite |
Via plugin |
Native |
| Monorepos |
Requires configuration |
Out of the box |
Vitest as an alternative to Jest for Vite projects: 10–20x faster due to native ES modules without Babel transformation. For monorepos with thousands of tests, the speed difference is noticeable. Wikipedia on unit testing describes the theoretical foundation — we apply it with real CI pipelines.
How to set up E2E tests that are not flaky?
Playwright outperforms Cypress on key parameters: native multi-tab, multi-origin, iframe support; parallel execution at test level; WebKit, Firefox, Chromium out of the box; no iframe for the app — tests run in a real browser.
Playwright codegen records actions and generates a test — a good starting point, but generated code needs refactoring. Locators by text content are fragile: getByRole('button', { name: 'Place order' }) is more robust than locator('.btn-primary').
Page Object Model is the standard for organizing E2E tests. Each page is a separate class with methods instead of direct locators. When a button moves from header to sidebar — change in one place, not across all tests.
Flaky tests typically arise from race conditions between request and render, animations without wait, and dependency on external APIs. Solution: page.waitForResponse() instead of page.waitForTimeout(), mocking external APIs via page.route().
// Bad
await page.click('#submit');
await page.waitForTimeout(2000);
await expect(page.locator('.success')).toBeVisible();
// Good
await page.click('#submit');
await page.waitForResponse(resp =>
resp.url().includes('/api/orders') && resp.status() === 201
);
await expect(page.getByRole('alert', { name: /order created/i })).toBeVisible();
Our engineers guarantee test stability in CI. Playwright’s official documentation covers all API details — we use it daily on projects with millions of users.
How do Core Web Vitals affect ranking?
Google uses Core Web Vitals in ranking. Lighthouse CLI in CI pipeline: on every deploy we check that LCP < 2.5s, CLS < 0.1, INP < 200ms. Google Chrome study: 53% of users leave a site if it takes longer than 3 seconds to load — our tests prevent such losses.
Real problems that Lighthouse finds:
- Hero image without
width/height attributes: CLS 0.35 on load.
- JavaScript bundle 2.1MB synchronously blocking parsing: INP 450ms.
- Fonts without
font-display: swap: invisible text until font loads (FOIT).
- Unoptimized hero image 4MB: LCP 8.2s.
Lighthouse CI (lhci) saves metric history and posts a comment to PR with degradation. For one e‑commerce client, optimizing these metrics improved conversion by 18% and reduced server costs by $12k annually.
What does load testing solve?
k6 is a load testing tool with a JavaScript API. Scenarios are written as code, versioned in git, run in CI. Three main scenarios:
- Spike test — sharp load increase: 0 → 1000 users in 30 seconds. Simulates a campaign launch. Shows system's ability to handle spikes.
- Soak test — stable load for 2–4 hours. Detects memory leaks, connection pool exhaustion, performance degradation.
- Stress test — load above expected (150–200% of peak). Shows breaking point and graceful degradation.
Thresholds:
thresholds: {
http_req_duration: ['p95<500', 'p99<1000'],
http_req_failed: ['rate<0.01'],
}
p95 < 500ms means 95% of requests respond faster than half a second. If threshold is not met, k6 exits with error code, CI pipeline fails.
In one online store project, we detected API degradation at the 4th hour of the test: p95 increased from 200ms to 2s due to connection leaks. After optimization, the client saved $15k per year on incident response and extra infrastructure.
Testing pyramid in a project
| Level |
Tool |
Quantity |
Speed |
| Unit |
Vitest/Jest |
Many (thousands) |
<5 min |
| Integration |
Vitest + supertest |
Medium |
5–15 min |
| E2E |
Playwright |
Few (happy path) |
10–30 min |
| Load |
k6 |
On schedule |
30–60 min |
| Performance |
Lighthouse CI |
On every deploy |
5 min |
What does the work include?
- Audit of current coverage and identification of critical user flows.
- Writing unit tests for key business logic, integration tests for API, E2E for user scenarios.
- Setting up parallel execution in CI (sharded workers for Playwright).
- Load testing with report and recommendations.
- Test case documentation, training your team on test practices.
- 1-month warranty support after implementation.
- Delivery of all test artefacts (code, CI configs, run histories).
How do we work?
- Analysis — audit of current testing, identification of weak spots, priority setting.
- Design — tool selection, test plan writing, approval.
- Implementation — writing tests, CI integration.
- Testing — running all levels, result analysis, bug fixing.
- Deployment — going live, metric monitoring, team training.
Timeline
Setting up a full test pipeline (Jest + Playwright + k6 + Lighthouse CI) from scratch: 2–4 weeks. E2E test coverage of an existing project (20–30 scenarios): 3–6 weeks. Load testing with report and recommendations: 1–2 weeks. Cost calculated individually after audit.
Ready to discuss your project? Leave a request — we will audit your current web application testing for free and propose a plan that can save up to 60% on incident costs. Get a consultation on web application testing — contact us today.