https://cypress.io logo
Hi everybody I was using Cypress e2e feature and s...
# e2e-testing
b
Hi everybody I was using Cypress e2e feature and stumbled upon a strange behavior that I can’t explain. this is the test that I’m starting. It goes to google.de it looks if Germany is listed on the page and then conducts a search When the assertion succeeds in the test the afterEach is also performed without problems, but when the assertion in the test fails, the typing in the afterEach is not happening. When I pass force:true to the type command it works, but I want to understand why the input element is not actionable. describe('Visit google.de check if germany is listed and perform a search', () => { beforeEach('Visit google.de and accept cookies', () => { cy.visit('https://www.google.de/?hl=de'); cy.get('#L2AGLb').should('be.visible').click(); }) it('Check if Deutschland is listed as country - passing', () => { cy.get('.uU7dJb').should('be.visible').should('have.text', 'Deutschland'); }) it.skip('Check if Deutschland is listed as country - failing', () => { cy.get('.uU7dJb').should('be.visible').should('have.text', 'Deutschland1'); }) afterEach('Perform search', () => { cy.get('input[name="q"]').should('be.visible').type('test{enter}'); // cy.get('input[name="q"]').should('be.visible').type('test{enter}', {force: true}); cy.url().should('contain', 'search?q='); }) })
4 Views