aliasing with cypress using as function

Solutions on MaxInterview for aliasing with cypress using as function by the best coders in the world

showing results for - "aliasing with cypress using as function"
Jacobo
06 Jun 2020
1describe('create backup button', function() {
2  beforeEach(() => {
3    cy.get('a#ai1wm-create-backup').as('button')
4  }) 
5  it('Create backup button should be visible, has right text and attributes', function() {
6    cy.get('@button')
7      .should('be.visible')
8      .should('have.attr', 'href', '#')
9      .should('have.class', 'ai1wm-button-green')
10      .should('contain', 'Create backup')
11      .children('i.ai1wm-icon-export')
12      .should('be.empty')
13  })
14  it('Clicking the Create backup button should trigger the export', function() {
15    cy.get('@button').click()
16    // Export test logic comes here
17  })
18})
19
similar questions
queries leading to this page
aliasing with cypress using as function