score:1

import promisify from 'cypress-promise'
 
it('should run tests with async/await', async () => {
  const foo = await promisify(cy.wrap('foo'))
  expect(foo).to.equal('foo')
})

score:1

beforeEach(() => {   // can be before() instead of beforeEach() if data does not change
  cy.visit("/")
  cy.uploadEmployeeData().as('updatedEmployeeData')
  cy.uploadManagerData().as('updatedManagerData')
})

it("visit particular employee", function() {  // use function() form 
                                              // so that "this" is defined correctly
  const id = 12
  cy.visit(`/all-employess/${this.updatedEmployeeData[id].employeeCode}`);
  cy.get('.input').type(this.updatedEmployeeData[id].name);

  // also use this.updatedManagerData
})

Related Query

More Query from same tag