Bird
0
0

Where should you place your custom plugin code in a Cypress project?

easy📝 Conceptual Q2 of 15
Cypress - Plugins and Ecosystem
Where should you place your custom plugin code in a Cypress project?
Acypress/integration/tests.js
Bcypress/support/commands.js
Ccypress/plugins/index.js
Dcypress/fixtures/data.json
Step-by-Step Solution
Solution:
  1. Step 1: Recall Cypress folder structure

    Plugins are defined in the plugins folder, specifically in index.js.
  2. Step 2: Differentiate plugin file from others

    Support commands extend test commands, integration holds tests, fixtures hold test data.
  3. Final Answer:

    cypress/plugins/index.js -> Option C
  4. Quick Check:

    Plugin location = cypress/plugins/index.js [OK]
Quick Trick: Plugins go in cypress/plugins/index.js file [OK]
Common Mistakes:
  • Putting plugins in support or integration folders
  • Confusing fixtures with plugin files
  • Editing wrong files for plugin code

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes