Complete the code to name the test clearly.
it('[1]', () => { cy.visit('/'); cy.contains('Welcome').should('be.visible'); });
The test name should clearly describe what the test does. "displays welcome message" is descriptive and meaningful.
Complete the test name to follow best practice by starting with a verb.
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'); });
Test names should start with an action verb. "Submit the login form with valid credentials" clearly states the action.
Fix the error in the test name to make it clear and consistent.
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]'
"Submit login form successfully" is clear, starts with a verb, and follows naming conventions.
Fill both blanks to create a descriptive and consistent test name.
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'); });
"Visit the user profile page and verify user details correctly" clearly describes the test steps and expected behavior.
Fill all three blanks to write a clear test name that describes the action, target, and expected result.
it('[1] the [2] page and [3] the welcome message is visible', () => { cy.visit('/home'); cy.contains('Welcome').should('be.visible'); });
"Visit the home page and verify the welcome message is visible" is a clear and descriptive test name following best practices.