Bird
0
0

You want to run only tests tagged with @smoke using the CLI. Which command correctly achieves this?

hard📝 framework Q8 of 15
Cypress - CI/CD and Reporting
You want to run only tests tagged with @smoke using the CLI. Which command correctly achieves this?
Acypress run --spec @smoke
Bcypress run --env grepTags=@smoke
Ccypress run --tag @smoke
Dcypress open --env grepTags=@smoke
Step-by-Step Solution
Solution:
  1. Step 1: Understand tag filtering in Cypress CLI

    Using environment variables like grepTags allows filtering tests by tags.
  2. Step 2: Analyze options

    cypress run --env grepTags=@smoke correctly uses --env grepTags=@smoke. cypress run --spec @smoke and cypress run --tag @smoke use invalid flags for tag filtering. cypress open --env grepTags=@smoke opens GUI instead of running tests.
  3. Final Answer:

    cypress run --env grepTags=@smoke -> Option B
  4. Quick Check:

    Filter tests by tags using --env grepTags= [OK]
Quick Trick: Use --env grepTags= to run tagged tests [OK]
Common Mistakes:
  • Using invalid flags like --tag
  • Confusing --spec with tags
  • Using cypress open instead of run

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes