Bird
0
0

If baseUrl is set to https://dashboard.app in cypress.config.js, what full URL does cy.visit('profile/settings') navigate to?

medium📝 Predict Output Q4 of 15
Cypress - Navigation and URL
If baseUrl is set to https://dashboard.app in cypress.config.js, what full URL does cy.visit('profile/settings') navigate to?
Aprofile/settings
Bhttps://dashboard.appcy.visit/profile/settings
Chttps://dashboard.app/profile/settings
Dhttps://profile/settings
Step-by-Step Solution
Solution:
  1. Step 1: Understand baseUrl usage

    The baseUrl is prepended to relative paths in cy.visit().
  2. Step 2: Combine baseUrl and path

    Given baseUrl is https://dashboard.app and path is profile/settings, the full URL is https://dashboard.app/profile/settings.
  3. Final Answer:

    https://dashboard.app/profile/settings -> Option C
  4. Quick Check:

    Relative path appended to baseUrl forms full URL [OK]
Quick Trick: Relative paths append to baseUrl in cy.visit() [OK]
Common Mistakes:
  • Assuming baseUrl is ignored
  • Concatenating baseUrl incorrectly
  • Using absolute URLs without baseUrl

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes