0
0
Cypresstesting~10 mins

cypress.config.js settings - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the base URL in cypress.config.js.

Cypress
module.exports = {
  e2e: {
    baseUrl: '[1]'
  }
};
Drag options to blanks, or click blank then click option'
A"http://localhost:3000"
B"localhost"
C3000
DbaseUrl
Attempts:
3 left
💡 Hint
Common Mistakes
Using only the hostname without protocol
Using a number instead of a string
Omitting quotes around the URL
2fill in blank
medium

Complete the code to set the test files pattern in cypress.config.js.

Cypress
module.exports = {
  e2e: {
    specPattern: '[1]'
  }
};
Drag options to blanks, or click blank then click option'
A"*.spec"
B"test/*.js"
C"**/*.test.js"
D"specPattern"
Attempts:
3 left
💡 Hint
Common Mistakes
Using a folder name instead of a pattern
Omitting quotes
Using an incomplete pattern
3fill in blank
hard

Fix the error in setting the viewport width in cypress.config.js.

Cypress
module.exports = {
  e2e: {
    viewportWidth: [1]
  }
};
Drag options to blanks, or click blank then click option'
AviewportWidth
B"1000"
Cwidth: 1000
D1000
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the number in quotes
Using an object instead of a number
Using the setting name as value
4fill in blank
hard

Fill both blanks to set viewport height and enable video recording in cypress.config.js.

Cypress
module.exports = {
  e2e: {
    viewportHeight: [1],
    video: [2]
  }
};
Drag options to blanks, or click blank then click option'
A800
Btrue
Cfalse
D1024
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings instead of numbers or booleans
Setting video to a string instead of boolean
Mixing up viewportHeight and viewportWidth
5fill in blank
hard

Fill all three blanks to set retries, default command timeout, and base URL in cypress.config.js.

Cypress
module.exports = {
  e2e: {
    retries: [1],
    defaultCommandTimeout: [2],
    baseUrl: [3]
  }
};
Drag options to blanks, or click blank then click option'
A2
B5000
C"https://example.com"
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings for retries or timeout
Omitting quotes around baseUrl
Using boolean for retries