@@ -91,19 +91,19 @@ export default defineConfig({
9191Run tests with "login" in the title:
9292
9393``` shell
94- npx cypress run --env grep=" login"
94+ npx cypress run --expose grep=" login"
9595```
9696
9797Run tests with "user authentication" in the title:
9898
9999``` shell
100- npx cypress run --env grep=" user authentication"
100+ npx cypress run --expose grep=" user authentication"
101101```
102102
103103Multiple title patterns (OR logic):
104104
105105``` shell
106- npx cypress run --env grep=" login; logout; signup"
106+ npx cypress run --expose grep=" login; logout; signup"
107107```
108108
109109### Filter by Tags
@@ -134,39 +134,39 @@ Then run by tags:
134134Run tests with @smoke tag:
135135
136136``` shell
137- npx cypress run --env grepTags=" @smoke"
137+ npx cypress run --expose grepTags=" @smoke"
138138```
139139
140140Run tests with @smoke OR @critical tags:
141141
142142``` shell
143- npx cypress run --env grepTags=" @smoke @critical"
143+ npx cypress run --expose grepTags=" @smoke @critical"
144144```
145145
146146Run tests with BOTH @smoke AND @critical tags:
147147
148148``` shell
149- npx cypress run --env grepTags=" @smoke+@critical"
149+ npx cypress run --expose grepTags=" @smoke+@critical"
150150```
151151
152152Run tests with @smoke tag but NOT @slow tag:
153153
154154``` shell
155- npx cypress run --env grepTags=" @smoke+-@slow"
155+ npx cypress run --expose grepTags=" @smoke+-@slow"
156156```
157157
158158### Combine Title and Tag Filters
159159
160160Run tests with "login" in title AND tagged @smoke :
161161
162162``` shell
163- npx cypress run --env grep=" login" ,grepTags=" @smoke"
163+ npx cypress run --expose grep=" login" ,grepTags=" @smoke"
164164```
165165
166166Run tests with "user" in title AND tagged @critical OR @smoke :
167167
168168``` shell
169- npx cypress run --env grep=" user" ,grepTags=" @critical @smoke"
169+ npx cypress run --expose grep=" user" ,grepTags=" @critical @smoke"
170170```
171171
172172## Advanced Features
@@ -178,21 +178,21 @@ Skip loading specs that don't contain matching tests (requires plugin setup):
178178Only run specs containing tests with "login" in title:
179179
180180``` shell
181- npx cypress run --env grep=" login" ,grepFilterSpecs=true
181+ npx cypress run --expose grep=" login" ,grepFilterSpecs=true
182182```
183183
184184Only run specs containing tests tagged @smoke :
185185
186186``` shell
187- npx cypress run --env grepTags=" @smoke" ,grepFilterSpecs=true
187+ npx cypress run --expose grepTags=" @smoke" ,grepFilterSpecs=true
188188```
189189
190190### Omit Filtered Tests
191191
192192By default, filtered tests are marked as pending. To completely omit them:
193193
194194``` shell
195- npx cypress run --env grep=" login" ,grepOmitFiltered=true
195+ npx cypress run --expose grep=" login" ,grepOmitFiltered=true
196196```
197197
198198### Test Burning (Repeat Tests)
@@ -202,41 +202,41 @@ Run filtered tests multiple times to catch flaky behavior:
202202Run matching tests 5 times:
203203
204204``` shell
205- npx cypress run --env grep=" login" ,burn=5
205+ npx cypress run --expose grep=" login" ,burn=5
206206```
207207
208208Run all tests 10 times:
209209
210210``` shell
211- npx cypress run --env burn=10
211+ npx cypress run --expose burn=10
212212```
213213
214214### Inverted Filters
215215
216216Run tests WITHOUT "slow" in the title:
217217
218218``` shell
219- npx cypress run --env grep=" -slow"
219+ npx cypress run --expose grep=" -slow"
220220```
221221
222222Run tests WITHOUT @slow tag:
223223
224224``` shell
225- npx cypress run --env grepTags=" -@slow"
225+ npx cypress run --expose grepTags=" -@slow"
226226```
227227
228228Complex combinations:
229229
230230``` shell
231- npx cypress run --env grep=" login; -slow" ,grepTags=" @smoke+-@regression"
231+ npx cypress run --expose grep=" login; -slow" ,grepTags=" @smoke+-@regression"
232232```
233233
234234### Run Untagged Tests
235235
236236Run only tests without any tags:
237237
238238``` shell
239- npx cypress run --env grepUntagged=true
239+ npx cypress run --expose grepUntagged=true
240240```
241241
242242## Configuration Examples
@@ -248,7 +248,7 @@ import { defineConfig } from 'cypress'
248248import { plugin as cypressGrepPlugin } from ' @cypress/grep/plugin'
249249
250250export default defineConfig ({
251- env : {
251+ expose : {
252252 // Always filter by viewport tests
253253 grep: " viewport" ,
254254 // Always enable spec filtering
@@ -270,10 +270,10 @@ export default defineConfig({
270270``` json
271271{
272272 "scripts" : {
273- "cy:smoke" : " cypress run --env grepTags=@smoke" ,
274- "cy:critical" : " cypress run --env grepTags=@critical" ,
275- "cy:fast" : " cypress run --env grepTags=@fast" ,
276- "cy:burn" : " cypress run --env grepTags=@smoke,burn=5"
273+ "cy:smoke" : " cypress run --expose grepTags=@smoke" ,
274+ "cy:critical" : " cypress run --expose grepTags=@critical" ,
275+ "cy:fast" : " cypress run --expose grepTags=@fast" ,
276+ "cy:burn" : " cypress run --expose grepTags=@smoke,burn=5"
277277 }
278278}
279279```
@@ -338,7 +338,7 @@ Cypress.grep()
338338
3393391 . ** Spec Loading** : When not using ` grepFilterSpecs ` , all spec files are loaded before filtering occurs
3403402 . ** Inverted Filters** : Negative filters (` -tag ` , ` -title ` ) are not compatible with ` grepFilterSpecs `
341- 3 . ** Runtime Changes** : Cannot change grep filters at runtime using ` Cypress.env () `
341+ 3 . ** Runtime Changes** : Cannot change grep filters at runtime using ` Cypress.expose () `
3423424 . ** Cloud Recordings** : Filtered tests may still appear in Cypress Cloud recordings as pending tests
343343
344344## Best Practices
@@ -369,7 +369,7 @@ it('should work', { tags: ['@smoke', '@fast'] }, () => {
3693691 . Run smoke tests first:
370370
371371``` shell
372- npx cypress run --env grepTags=" @smoke"
372+ npx cypress run --expose grepTags=" @smoke"
373373```
374374
3753752 . If smoke tests pass, run all tests:
@@ -381,11 +381,11 @@ npx cypress run
3813813 . For debugging, run specific test groups:
382382
383383``` shell
384- npx cypress run --env grep=" user management"
384+ npx cypress run --expose grep=" user management"
385385```
386386
387387``` shell
388- npx cypress run --env grepTags=" @critical"
388+ npx cypress run --expose grepTags=" @critical"
389389```
390390
391391### Performance Tips
@@ -403,7 +403,7 @@ Enable debug logging to see what's happening:
403403Terminal debug (for plugin):
404404
405405``` shell
406- DEBUG=@cypress/grep npx cypress run --env grep=" login"
406+ DEBUG=@cypress/grep npx cypress run --expose grep=" login"
407407```
408408
409409Browser debug (for support file):
@@ -422,6 +422,21 @@ Then refresh and run tests.
422422
423423## Migration
424424
425+ ### From v5 to v6
426+
427+ ` Cypress.env() ` is deprecated in Cypress 15.10.0. For public configuration, the API has been replaced with ` Cypress.expose() `
428+
429+ To migrate, change your ` --env ` /` -e ` CLI arguments from
430+ ``` sh
431+ npx cypress run --env grepTags=" tag1 tag2"
432+ ```
433+
434+ to the following to use ` --expose ` /` -x `
435+ ``` sh
436+ npx cypress run --expose grepTags=" tag1 tag2"
437+ ```
438+
439+
425440### From v4 to v5
426441
427442The support file registration and plugin have changed their export signature, meaning:
0 commit comments