0
0
Cypresstesting~5 mins

cypress.config.js settings - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the cypress.config.js file?
It is used to configure Cypress test settings like base URL, timeouts, viewport size, and environment variables.
Click to reveal answer
beginner
How do you set the base URL in cypress.config.js?
Use the baseUrl property inside the exported config object, for example: <br>baseUrl: 'https://example.com'
Click to reveal answer
beginner
What does the viewportWidth and viewportHeight settings control?
They control the width and height of the browser window during tests, simulating different screen sizes.
Click to reveal answer
intermediate
How can you set environment variables in cypress.config.js?
Use the env property with key-value pairs, for example: <br>env: { username: 'user1', password: 'pass123' }
Click to reveal answer
intermediate
What is the effect of setting defaultCommandTimeout in cypress.config.js?
It changes how long Cypress waits for commands like click() or get() before timing out and failing the test.
Click to reveal answer
Which property in cypress.config.js sets the base URL for all tests?
AdefaultCommandTimeout
Benv
CbaseUrl
DviewportWidth
How do you specify environment variables in cypress.config.js?
AUsing <code>baseUrl</code>
BUsing <code>defaultCommandTimeout</code>
CUsing <code>viewportHeight</code>
DUsing the <code>env</code> object
What does viewportWidth control in cypress.config.js?
ABrowser window width during tests
BTimeout for commands
CBase URL for tests
DEnvironment variable name
If a command takes too long and you want Cypress to wait longer before failing, which setting do you change?
AviewportHeight
BdefaultCommandTimeout
CbaseUrl
Denv
Where do you export the configuration object in cypress.config.js?
Aexport default { ... }
Bmodule.exports = { ... }
Cconst config = { ... }
Dwindow.config = { ... }
Explain how to configure the base URL and viewport size in cypress.config.js.
Think about how these settings affect test URLs and browser window size.
You got /3 concepts.
    Describe how environment variables and command timeouts are set and why they are useful in Cypress configuration.
    Consider how environment variables help with sensitive data and how timeouts affect test reliability.
    You got /3 concepts.