Bird
0
0

Which file typically contains the Node task definitions for cy.task() in Cypress?

easy📝 Conceptual Q2 of 15
Cypress - Plugins and Ecosystem
Which file typically contains the Node task definitions for cy.task() in Cypress?
Apackage.json
Bcypress.config.js
Ccypress/integration/spec.js
Dcypress/support/commands.js
Step-by-Step Solution
Solution:
  1. Step 1: Identify where tasks are defined

    Node tasks for cy.task() are defined in the Cypress configuration file, usually cypress.config.js.
  2. Step 2: Understand other files' roles

    support/commands.js adds custom commands, integration/spec.js contains tests, and package.json manages dependencies.

  3. Final Answer:

    cypress.config.js -> Option B
  4. Quick Check:

    Task definitions file = cypress.config.js [OK]
Quick Trick: Define tasks in cypress.config.js for cy.task() [OK]
Common Mistakes:
  • Defining tasks inside test spec files
  • Confusing support commands with tasks
  • Looking for tasks in package.json

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes