Execution Trace Quiz - 3 Questions
Test your understanding
What does the test use to get the URL and login credentials?
API_URL inside a Cypress test?Cypress.env('VAR_NAME') to access env variables.cypress.config.js snippet:export default defineConfig({
env: {
USERNAME: 'testUser',
PASSWORD: 'pass123'
}
})cy.log(Cypress.env('USERNAME')) print during test execution?const apiUrl = Cypress.env.API_URL; cy.visit(apiUrl);
TypeError: Cannot read property 'API_URL' of undefined. What is the problem?Cypress.env('API_URL') instead of Cypress.env.API_URL -> Option Dcypress.config.js. Which command line option correctly sets the environment variable API_URL to https://api.test.com?--env VAR_NAME=value to set env variables temporarily.cypress run runs tests in headless mode; --env sets env vars.Pass the test and this pattern moves unknown