I have some global variables on my cypress test scenario.
describe('AutoLogin Test Case',function(){
beforeEach(function(){
Cypress.Cookies.preserveOnce('_session_id')
})
afterEach(function(){
cy.get('[id="ajax_working"]',{timeout:6000}).should('not.be.visible')
})
it('input login info',function(){
cy.visit('https://***********.******.com/')
cy.get('[id^=user_username]')
.type('ChrisPbacon').should('have.value','ChrisPbacon')
cy.get('[id^=user_password]')
.type('welcome123').should('have.value','welcome123')
cy.contains('Sign In Now').click()
})
})
After the test case is completed the system is gonna check for the "after each" function and look for "ajax_working"... I need to skip that check ONLY on the shown "it" test, but I still need to run it on the rest of the program. I don't wanna write the aftermath function on each test as it's cumbersome and overall not clean. Anyone got any tips?