Bird
0
0

Which file is typically used to define custom plugins in a Cypress project?

easy📝 Syntax Q12 of 15
Cypress - Plugins and Ecosystem
Which file is typically used to define custom plugins in a Cypress project?
Acypress/plugins/index.js
Bcypress/support/commands.js
Ccypress/integration/spec.js
Dcypress.json
Step-by-Step Solution
Solution:
  1. Step 1: Identify the plugin file location

    Custom plugins are defined in the cypress/plugins/index.js file where Node.js code runs.
  2. Step 2: Differentiate from support and config files

    support/commands.js is for custom commands in browser tests, integration/spec.js is for test specs, and cypress.json is config.
  3. Final Answer:

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

    Plugins file = C [OK]
Quick Trick: Plugins go in cypress/plugins/index.js file [OK]
Common Mistakes:
  • Confusing plugins file with support commands file
  • Choosing test spec files for plugins
  • Selecting config file for plugin code

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes