lundi 19 août 2019

Cypress - how to logout from site

Is in Cypress any possibility to log out from page if you are logged in? Or to check if I'm logged?

My problem is that if I'm running tests by one in browser then Cypress always need to log in. But if I start it from cmd it only needs to log in on the first test but at the next one you are already logged in.

    //Visit site
    cy.visit('https://zeteodemo.uat.creasoft.cz/login?ReturnUrl=%2fVehicleInsuranceV2%2fCompare%3fOsobniCislo1%3d1%26ProductsFilter%3dAXA-ONLINE')      

    //Login
    cy.get('.login__username')
    .type('tester')
    .should('have.value', 'tester')

    //Password
    cy.get('.login__password')
    .type('55255#abdc@5EDJH')
    .should('have.value', '55255#abdc@5EDJH')

    //Login
    cy.get('.button-login').click()

Aucun commentaire:

Enregistrer un commentaire