Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Continue Running Tests in Serial Mode #34279

Open
VietNguyen-Discovermarket opened this issue Jan 10, 2025 · 1 comment
Open

[Feature]: Continue Running Tests in Serial Mode #34279

VietNguyen-Discovermarket opened this issue Jan 10, 2025 · 1 comment

Comments

@VietNguyen-Discovermarket

🚀 Feature Request

Feature Request: Continue Running Tests in Serial Mode

I would like to request a new feature for the Playwright testing framework. It would be incredibly useful to have a mode where tests within a describe block continue to run even if one test fails when running in serial mode. This functionality would be valuable for many users who need to ensure that all tests are executed, regardless of individual test failures.

Example

Setup in playwright.configure.ts

import { defineConfig } from '@playwright/test';

export default defineConfig({
// Set the number of parallel workers
workers: 4, // Adjust this number based on your requirements
});

in Test file

import { test, expect } from '@playwright/test';

test.describe.configure({ mode: 'serial' });

test.describe('Test Suite 1', () => {
test('Test 1.1', async ({ page }) => {
// Your test code here
});

test('Test 1.2', async ({ page }) => {
// Your test code here
});
});

test.describe('Test Suite 2', () => {
test('Test 2.1', async ({ page }) => {
// Your test code here
});

test('Test 2.2', async ({ page }) => {
// Your test code here
});
});

Motivation

By combining these configurations, you can run multiple test.describe blocks in parallel, with each block running its tests in serial mode. This approach maximizes test efficiency while maintaining the desired test execution order within each block.

@Skn0tt
Copy link
Member

Skn0tt commented Jan 10, 2025

The idea behind serial mode is to force a specific execution order, because those tests somehow depend on one another. That makes it impossible to continue on failure.

It sounds like in your usecase, the tests don't depend on a specific order, but they can't run in parallel because they're using a shared resource. Is that understanding correct? In that case, take a look at https://playwright.dev/docs/test-parallel#disable-parallelism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants