The Importance of E2E Testing for Bitrix
After every module, template, or API integration update, someone manually checks the cart, checkout, and personal account. The process takes 2–3 hours but still misses regressions: no tester in a single run can cover five browsers, mobile viewports, and social network login. With over 50 Bitrix projects under our belt — in roughly a third of cases the release was delayed precisely because of a regression discovered at the last moment. E2E tests solve this automatically: they run in 15–20 minutes and consistently catch the very cases a human misses. This reduces regression testing time by over 80%.
How We Do It
We set up the test environment, choose the tool, write Page Object Model for key components and integrate the run into your CI/CD. We deliver turnkey — from auditing the current architecture to handing over documentation and training your team.
Step-by-Step Process
- Audit: Analyze current Bitrix components, AJAX handling, and critical user flows. (1–2 days)
- Design: Align scenario list with your team, decide coverage priorities. (1 day)
- Implementation: Write Page Object Model for 5–10 key components and 15–30 test scenarios. (3–5 days)
- CI/CD Integration: Set up automated runs on push to main/staging with artifact retention. (1 day)
- Handover: Provide documentation and a 2–3 hour workshop for your team. (1 day)
Playwright vs Cypress for Bitrix: A Comparison
| Criterion | Playwright | Cypress |
|---|---|---|
| Browser support | Chromium, Firefox, WebKit | Only Chromium and derivatives |
| Mobile viewports | Device emulation (iPhone, Pixel, etc.) | Limited emulation |
| Multi-tab handling | Natively supported | Not supported |
| Network interception | Yes (route, waitForResponse) | Yes, but more complex |
| CI/CD integration | Simple, built-in reporter | Requires additional plugins |
| Execution speed | High (parallel execution) | Moderate |
Playwright executes tests up to 2x faster than Cypress due to parallel execution and native multi-browser support (Playwright official docs). It supports all browsers in a single run, works headless and headed, and has a powerful locator API that doesn't break when the DOM changes. Built-in mobile device emulation and network interception are exactly what's needed for testing sale.order.ajax with its async nature.
Cypress is good for SPAs, but for multi-page Bitrix sites its limitations (single origin, lack of native multi-tab support) create problems. In our projects we use Playwright 9 out of 10 times.
Test Environment Infrastructure
The test environment must be a separate database with fixed data. No tests on production. We deploy a copy of the site with known characteristics: a catalog of 50–100 products, several payer types, configured delivery and payment methods. Minimum repository structure:
tests/
e2e/
fixtures/ # JSON with test data
pages/ # Page Object Model
specs/ # scenarios
playwright.config.ts
// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests/e2e/specs',
timeout: 30_000,
retries: process.env.CI ? 2 : 0,
use: {
baseURL: process.env.TEST_BASE_URL || 'http://localhost:8000',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'mobile', use: { ...devices['iPhone 13'] } },
],
});
Page Object Model for Bitrix
Standard components like bitrix:sale.order.ajax, bitrix:sale.basket.basket, and bitrix:system.auth.form have stable CSS classes. Page Object isolates locators from tests — if template markup changes in a new version, you edit one file instead of all scenarios.
// tests/e2e/pages/CartPage.ts
import { Page, Locator } from '@playwright/test';
export class CartPage {
readonly page: Page;
readonly checkoutButton: Locator;
readonly totalPrice: Locator;
constructor(page: Page) {
this.page = page;
this.checkoutButton = page.locator('.basket-checkout-btn');
this.totalPrice = page.locator('.basket-coupon-block-total-price-current');
}
async goto() {
await this.page.goto('/personal/cart/');
}
async applyPromocode(code: string) {
await this.page.fill('.basket-coupon-field-input', code);
await this.page.click('.basket-coupon-apply-btn');
await this.page.waitForResponse(resp =>
resp.url().includes('ajax_basket') && resp.status() === 200
);
}
}
Key Scenarios
Add to cart and checkout:
// tests/e2e/specs/checkout.spec.ts
import { test, expect } from '@playwright/test';
import { CartPage } from '../pages/CartPage';
test('checkout flow', async ({ page }) => {
// Add product from catalog page
await page.goto('/catalog/electronics/headphones/sennheiser-hd-599/');
await page.click('.catalog-element-offer-set-item:first-child'); // select SKU
await page.click('.btn-buy');
await expect(page.locator('.bx-basket-count')).toContainText('1');
// Go to cart
const cart = new CartPage(page);
await cart.goto();
await expect(cart.totalPrice).toBeVisible();
// Checkout
await cart.checkoutButton.click();
await page.fill('#order-name', 'Ivan Ivanov');
await page.fill('#order-email', '[email protected]');
await page.fill('#order-phone', '+79001234567');
await page.click('#pay-system-1'); // select payment method
await Promise.all([
page.waitForURL(/\/order\/success\//),
page.click('.btn-checkout-submit'),
]);
await expect(page.locator('.sale-order-detail-result')).toBeVisible();
});
Login and personal account:
test('login and account access', async ({ page }) => {
await page.goto('/personal/login/');
await page.fill('#USER_LOGIN', '[email protected]');
await page.fill('#USER_PASSWORD', 'testpassword123');
await page.click('.login-btn');
await expect(page).toHaveURL(/\/personal\//);
await expect(page.locator('.personal-user-name')).toContainText('Ivan');
});
CI/CD Integration
We configure test runs on every push to main/staging. On failure, artifacts (screenshots, traces) are preserved for analysis. Example GitHub Actions config:
GitHub Actions workflow
# .github/workflows/e2e.yml
name: E2E Tests
on:
push:
branches: [main, staging]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20 }
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npx playwright test
env:
TEST_BASE_URL: ${{ secrets.TEST_BASE_URL }}
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/
What's Included in E2E Setup (What We Deliver)
- Audit of current architecture: which components are used, how asynchronicity is implemented, which scenarios are critical.
- Test coverage design: align scenario list with your team.
- Writing Page Object Model for 5–10 key components.
- Implementing 15–30 test scenarios (cart, checkout, authentication, filtering, promo codes, personal account).
- Setting up CI/CD run (GitHub Actions / GitLab CI / Jenkins).
- Documentation for running and maintaining tests.
- Team training: a 2–3 hour workshop on adding new scenarios.
Setup cost typically ranges from $2,500 to $7,500, depending on the number of scenarios and complexity. For example, a typical project with 20 scenarios costs around $5,000 and saves approximately $2,000 per month in manual testing costs. This investment typically pays for itself within 2–3 months through reduced manual regression costs.
Priority Scenarios for E2E Testing
| Scenario | Priority | Bitrix Components |
|---|---|---|
| Add to cart + checkout | Critical | sale.basket.basket, sale.order.ajax |
| Login / registration | Critical | system.auth.form |
| Search + catalog filter | High | search.title, catalog.smart.filter |
| Promo code application | High | sale.basket.basket.coupon |
| Personal account (order history) | Medium | sale.personal.order.list |
Test stability is the main goal. We use waitForResponse instead of waitForTimeout, locators by data-testid where standard CSS classes change with template updates. When tests are flaky, the issue is almost always in Bitrix AJAX asynchronicity, not in Playwright.
Our Experience and Guarantees
We are certified 1C-Bitrix partners with over 5 years of experience. During this time we have implemented E2E testing for 20+ projects of varying complexity — from small online stores to corporate portals on Bitrix24. We guarantee test stability: after handover, tests do not fail on empty changes. If questions arise, we provide free consultation for one month after delivery.
Ordering Setup
We assess your project within 1–2 working days. You need to provide access to the repository and test environment. Contact us — we'll tell you which scenarios we'll cover first and how long it will take. For a quick estimate, share your project details.
This complete Playwright setup for Bitrix ensures comprehensive E2E integration and checkout testing for Bitrix sites, covering all critical user paths.







