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?✗ Incorrect
The
baseUrl property defines the root URL for all tests, so you can use relative URLs in your tests.How do you specify environment variables in
cypress.config.js?✗ Incorrect
Environment variables are set inside the
env object as key-value pairs.What does
viewportWidth control in cypress.config.js?✗ Incorrect
viewportWidth sets the width of the browser window Cypress uses during tests.If a command takes too long and you want Cypress to wait longer before failing, which setting do you change?
✗ Incorrect
defaultCommandTimeout controls how long Cypress waits for commands before timing out.Where do you export the configuration object in
cypress.config.js?✗ Incorrect
Cypress 10 and later uses ESM syntax, so you export the config with
export default { ... }.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.