Test Overview
This test checks that a specific button is not visible on the page. It verifies that the negative assertion using not works correctly in Cypress.
This test checks that a specific button is not visible on the page. It verifies that the negative assertion using not works correctly in Cypress.
describe('Negative assertion test', () => { it('checks that the submit button is not visible', () => { cy.visit('https://example.com/login') cy.get('#submit-btn').should('not.be.visible') }) })
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Test runner initialized, ready to execute test | - | PASS |
| 2 | Browser opens and navigates to 'https://example.com/login' | Login page is loaded in the browser | - | PASS |
| 3 | Find element with id 'submit-btn' using cy.get('#submit-btn') | Element '#submit-btn' is located in the DOM | - | PASS |
| 4 | Check that '#submit-btn' is not visible using .should('not.be.visible') | Element '#submit-btn' is present but hidden or not displayed | Verify '#submit-btn' is not visible on the page | PASS |