From 4bbd38560a9a2ec91f63f2abee0cffb874357204 Mon Sep 17 00:00:00 2001 From: Zack Guo Date: Wed, 2 Feb 2022 08:08:08 +0800 Subject: [PATCH] docs(CONTRIBUTING.md): update how to run a specific test (#11697) --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 21e4a95568..d755003d65 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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`: