@@ -661,8 +661,8 @@ test('should merge configs', async ({ runInlineTest }) => {
661
661
use: { foo: 1, bar: 2 },
662
662
expect: { timeout: 12 },
663
663
projects: [
664
- { name: 'B ', timeout: 40 , use: {} },
665
- { name: 'A ', timeout: 50, use: {} }
664
+ { name: 'A ', timeout: 50 , use: {} },
665
+ { name: 'B ', timeout: 40 },
666
666
],
667
667
webServer: [{
668
668
command: 'echo 123',
@@ -680,6 +680,33 @@ test('should merge configs', async ({ runInlineTest }) => {
680
680
expect ( result . exitCode ) . toBe ( 0 ) ;
681
681
} ) ;
682
682
683
+ test ( 'should merge projects in the config' , async ( { runInlineTest } ) => {
684
+ const result = await runInlineTest ( {
685
+ 'playwright.config.ts' : `
686
+ import { defineConfig, expect } from '@playwright/test';
687
+ const baseConfig = defineConfig({
688
+ projects: [{ name: 'A', timeout: 5_000 }, { name: 'B', timeout: 6_000 }],
689
+ });
690
+ const derivedConfig = defineConfig(baseConfig, {
691
+ projects: [{ name: 'A', timeout: 7_000 }, { name: 'C', timeout: 8_000 }],
692
+ });
693
+
694
+ expect(derivedConfig).toEqual(expect.objectContaining({
695
+ projects: [
696
+ { name: 'A', timeout: 7_000, use: {} },
697
+ { name: 'B', timeout: 6_000 },
698
+ { name: 'C', timeout: 8_000 },
699
+ ],
700
+ }));
701
+ ` ,
702
+ 'a.test.ts' : `
703
+ import { test } from '@playwright/test';
704
+ test('pass', async ({}) => {});
705
+ `
706
+ } ) ;
707
+ expect ( result . exitCode ) . toBe ( 0 ) ;
708
+ } ) ;
709
+
683
710
test ( 'should merge ct configs' , async ( { runInlineTest } ) => {
684
711
const result = await runInlineTest ( {
685
712
'playwright.config.ts' : `
0 commit comments