Skip to content
This repository was archived by the owner on Mar 29, 2023. It is now read-only.

Commit 30df327

Browse files
committed
add note about filtering and debugging
1 parent e5a61ca commit 30df327

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,30 @@ Cypress.grep('hello', '@smoke', 10)
407407

408408
## Debugging
409409

410-
This module uses [debug](https://github.com/visionmedia/debug#readme) to log verbose messages. To enable debug console messages, from the DevTools console set `localStorage.debug='cypress-grep'` and run the tests again.
410+
This module uses [debug](https://github.com/visionmedia/debug#readme) to log verbose messages. You can enable the debug messages in the plugin file (runs when discovering specs to filter), and inside the browser to see how it determines which tests to run and to skip.
411+
412+
### Debugging in the plugin
413+
414+
Start Cypress with the environment variable `DEBUG=cypress-grep`. You will see a few messages from this plugin in the terminal output:
415+
416+
```
417+
$ DEBUG=cypress-grep npx cypress run --env grep=works,grepFilterSpecs=true
418+
cypress-grep: tests with "works" in their names
419+
cypress-grep: filtering specs using "works" in the title
420+
cypress-grep Cypress config env object: { grep: 'works', grepFilterSpecs: true }
421+
...
422+
cypress-grep found 1 spec files +5ms
423+
cypress-grep [ 'spec.js' ] +0ms
424+
cypress-grep spec file spec.js +5ms
425+
cypress-grep suite and test names: [ 'hello world', 'works', 'works 2 @tag1',
426+
'works 2 @tag1 @tag2', 'works @tag2' ] +0ms
427+
cypress-grep found "works" in 1 specs +0ms
428+
cypress-grep [ 'spec.js' ] +0ms
429+
```
430+
431+
### Debugging in the browser
432+
433+
To enable debug console messages in the browser, from the DevTools console set `localStorage.debug='cypress-grep'` and run the tests again.
411434

412435
![Debug messages](./images/debug.png)
413436

0 commit comments

Comments
 (0)