Skip to content

Commit

Permalink
removes docs for test configuration override (#49660)
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu authored Apr 8, 2023
1 parent 99d837a commit 4fa2a87
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions docs/contributors/code/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,45 +114,3 @@ test.describe( 'Grouping tests (@webkit, -chromium)', () => {
} );
} );
```

## Local configuration of Playwright

Sometimes the deafults that Gutenberg offers for Playwright configuration need to be changed. While most configuration can be overriden by passing arguments to the test runner command line, we may want to make permanent confguration changes, such as setting the test to always run with `headless` mode set to `false` and you own custom slow motion value.

To do this one can create a file named `playwright.config.override.ts` file in the `/test/e2e/` folder. In this new file we need to import the exiting configuration, then use the new values on top to override the defaults.

For example:

```ts
/**
* External dependencies
*/
import { defineConfig } from '@playwright/test';
/**
* Internal dependencies
*/
import base from './playwright.config.ts';

const config = defineConfig( {
...base,
use: {
...base.use,
headless: true,
launchOptions: {
//slowMo: 500,
},
trace: 'off',
screenshot: 'off',
video: 'off',
},
} );

export default config;

```

After making this file you can now run your tests passing the new configuration file with the `--config` argument:

```bash
npm run test:e2e:playwright -- --config=test/e2e/playwright.override.config.ts
```

1 comment on commit 4fa2a87

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 4fa2a87.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4645011328
📝 Reported issues:

Please sign in to comment.