Bird
0
0

You want to run Cypress tests on both push and pull request events but only for the 'develop' branch. Which YAML snippet correctly configures this?

hard📝 Workflow Q15 of 15
Cypress - CI/CD and Reporting
You want to run Cypress tests on both push and pull request events but only for the 'develop' branch. Which YAML snippet correctly configures this?
Aon: push: branches: - main pull_request: branches: - main
Bon: push: branches: - main pull_request: branches: - develop
Con: push: branches: - develop pull_request: branches: - develop
Don: push: branches: - develop pull_request: branches: - main
Step-by-Step Solution
Solution:
  1. Step 1: Identify required events and branches

    Tests must run on both push and pull_request events targeting the 'develop' branch only.
  2. Step 2: Match YAML configuration

    on: push: branches: - develop pull_request: branches: - develop correctly lists both events with 'develop' branch under each.
  3. Final Answer:

    on: push: branches: - develop pull_request: branches: - develop -> Option C
  4. Quick Check:

    Both events on 'develop' branch = D [OK]
Quick Trick: List both events with same branch under 'on' key [OK]
Common Mistakes:
  • Mixing branch names between events
  • Listing only one event
  • Using wrong branch name

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes