0
0
Cypresstesting~10 mins

Test naming conventions in Cypress - Interactive Code Practice

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

Complete the code to name the test clearly.

Cypress
it('[1]', () => {
  cy.visit('/');
  cy.contains('Welcome').should('be.visible');
});
Drag options to blanks, or click blank then click option'
Atest1
Bcheck
Cdisplays welcome message
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using vague test names like 'test1' or 'check' that don't explain the test purpose.
2fill in blank
medium

Complete the test name to follow best practice by starting with a verb.

Cypress
it('[1] the login form with valid credentials', () => {
  cy.visit('/login');
  cy.get('#username').type('user');
  cy.get('#password').type('pass');
  cy.get('form').submit();
  cy.url().should('include', '/dashboard');
});
Drag options to blanks, or click blank then click option'
ASubmit
BCheck
CVerify
DTesting
Attempts:
3 left
💡 Hint
Common Mistakes
Starting test names with nouns or gerunds instead of verbs.
3fill in blank
hard

Fix the error in the test name to make it clear and consistent.

Cypress
it('login form submits successfully', () => {
  cy.visit('/login');
  cy.get('#username').type('user');
  cy.get('#password').type('pass');
  cy.get('form').submit();
  cy.url().should('include', '/dashboard');
});

// Rename test to: '[1]'
Drag options to blanks, or click blank then click option'
Alogin form submit success
Bsuccessfully submits login form
CForm login success submit
DSubmit login form successfully
Attempts:
3 left
💡 Hint
Common Mistakes
Using unclear or awkward phrasing that confuses the test purpose.
4fill in blank
hard

Fill both blanks to create a descriptive and consistent test name.

Cypress
it('[1] the user profile page and [2] user details correctly', () => {
  cy.visit('/profile');
  cy.get('.user-name').should('contain', 'John Doe');
  cy.get('.user-email').should('contain', 'john@example.com');
});
Drag options to blanks, or click blank then click option'
AVisit
BCheck
CVerify
DLoad
Attempts:
3 left
💡 Hint
Common Mistakes
Using verbs that do not fit the context or mixing unrelated actions.
5fill in blank
hard

Fill all three blanks to write a clear test name that describes the action, target, and expected result.

Cypress
it('[1] the [2] page and [3] the welcome message is visible', () => {
  cy.visit('/home');
  cy.contains('Welcome').should('be.visible');
});
Drag options to blanks, or click blank then click option'
AVisit
Bhome
Cverify
Ddashboard
Attempts:
3 left
💡 Hint
Common Mistakes
Using vague or incomplete test names that do not describe the test steps.