diff --git a/cypress/integration/albums.spec.ts b/cypress/integration/albums.spec.ts index e8cfa92b..80cfb9f8 100644 --- a/cypress/integration/albums.spec.ts +++ b/cypress/integration/albums.spec.ts @@ -6,17 +6,9 @@ context('Albums', { scrollBehavior: false }, () => { it('loads the list of albums', () => { cy.get('#albumsWrapper').within(() => { - cy.get('.screen-header') - .should('be.visible') - .and('contain.text', 'Albums') - - cy.get('[data-test=view-mode-thumbnail]') - .should('be.visible') - .and('have.class', 'active') - - cy.get('[data-test=view-mode-list]') - .should('be.visible') - .and('not.have.class', 'active') + cy.get('.screen-header').should('be.visible').and('contain.text', 'Albums') + cy.get('[data-test=view-mode-thumbnail]').should('be.visible').and('have.class', 'active') + cy.get('[data-test=view-mode-list]').should('be.visible').and('not.have.class', 'active') cy.get('[data-test=album-card]').should('have.length', 7) }) }) @@ -54,7 +46,7 @@ context('Albums', { scrollBehavior: false }, () => { }) cy.get('#albumWrapper').within(() => { - cy.get('.song-item').should('have.length.at.least', 1) + cy.$getVisibleSongRows().should('have.length.at.least', 1) cy.get('.screen-header').within(() => { cy.findByText('Download All').should('be.visible') diff --git a/cypress/integration/artists.spec.ts b/cypress/integration/artists.spec.ts index 50c92126..2e5348e7 100644 --- a/cypress/integration/artists.spec.ts +++ b/cypress/integration/artists.spec.ts @@ -6,17 +6,9 @@ context('Artists', { scrollBehavior: false }, () => { it('loads the list of artists', () => { cy.get('#artistsWrapper').within(() => { - cy.get('.screen-header') - .should('be.visible') - .and('contain.text', 'Artists') - - cy.get('[data-test=view-mode-thumbnail]') - .should('be.visible') - .and('have.class', 'active') - - cy.get('[data-test=view-mode-list]') - .should('be.visible') - .and('not.have.class', 'active') + cy.get('.screen-header').should('be.visible').and('contain.text', 'Artists') + cy.get('[data-test=view-mode-thumbnail]').should('be.visible').and('have.class', 'active') + cy.get('[data-test=view-mode-list]').should('be.visible').and('not.have.class', 'active') cy.get('[data-test=artist-card]').should('have.length', 1) }) }) @@ -55,7 +47,7 @@ context('Artists', { scrollBehavior: false }, () => { }) cy.get('#artistWrapper').within(() => { - cy.get('.song-item').should('have.length.at.least', 1) + cy.$getVisibleSongRows().should('have.length.at.least', 1) cy.get('.screen-header').within(() => { cy.findByText('Download All').should('be.visible') diff --git a/cypress/integration/authentication.spec.ts b/cypress/integration/authentication.spec.ts index 5d4b473b..a71a2fd1 100644 --- a/cypress/integration/authentication.spec.ts +++ b/cypress/integration/authentication.spec.ts @@ -26,9 +26,7 @@ context('Authentication', () => { cy.visit('/') submitLoginForm() - cy.findByTestId('login-form') - .should('be.visible') - .and('have.class', 'error') + cy.findByTestId('login-form').should('be.visible').and('have.class', 'error') }) it('logs out', () => { diff --git a/cypress/integration/extra-panel.spec.ts b/cypress/integration/extra-panel.spec.ts index 69da4f52..033da229 100644 --- a/cypress/integration/extra-panel.spec.ts +++ b/cypress/integration/extra-panel.spec.ts @@ -17,7 +17,7 @@ context('Extra Information Panel', () => { }) cy.$clickSidebarItem('All Songs') - cy.get('#songsWrapper .song-item:first-child').dblclick() + cy.$getVisibleSongRows().first().dblclick() cy.get('#extraPanelLyrics').should('be.visible').and('contain.text', 'No lyrics found.') cy.get('#extraPanelLyrics [data-test=add-lyrics-btn]').click() diff --git a/cypress/integration/footer-pane.spec.ts b/cypress/integration/footer-pane.spec.ts index 82647dc6..c3d4b522 100644 --- a/cypress/integration/footer-pane.spec.ts +++ b/cypress/integration/footer-pane.spec.ts @@ -5,7 +5,7 @@ context('Footer Pane', () => { cy.$clickSidebarItem('All Songs') - cy.get('#songsWrapper .song-item:first-child').dblclick().within(function () { + cy.$getVisibleSongRows().first().dblclick().within(function () { cy.get('.title').invoke('text').as('title') cy.get('.album').invoke('text').as('album') cy.get('.artist').invoke('text').as('artist')