docs(CONTRIBUTING.md): update how to run a specific test (#11697)

This commit is contained in:
Zack Guo 2022-02-02 08:08:08 +08:00 committed by GitHub
parent 731931ae58
commit 4bbd38560a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -144,7 +144,7 @@ npm run test
npm run ctest # also `ftest` for firefox and `wtest` for WebKit
```
- To run a specific test, substitute `it` with `it.only`:
- To run a specific test, substitute `it` with `it.only`, or use the `--grep 'My test'` CLI parameter:
```js
...
@ -153,6 +153,8 @@ it.only('should work', async ({server, page}) => {
const response = await page.goto(server.EMPTY_PAGE);
expect(response.ok).toBe(true);
});
// or
playwright test --config=xxx --grep 'should work'
```
- To disable a specific test, substitute `it` with `it.skip`: