This is my code -
const username = faker.internet.userName()
describe('My test suite', () => {
it('test case 1', () => {
cy.visit('https://google.com')
cy.log(username)
})
it('test case 2', () => {
cy.visit('https://facebook.com')
cy.log(username)
})
The value of constant variable changes if the URL domain is changed in test cases. Is there anyway we can retain the constant values across domains?
Attaching cypress output for the code -