diff --git a/cypress/fixtures/info.get.200.json b/cypress/fixtures/song-info.get.200.json similarity index 100% rename from cypress/fixtures/info.get.200.json rename to cypress/fixtures/song-info.get.200.json diff --git a/cypress/integration/albums.spec.ts b/cypress/integration/albums.spec.ts index 9161f3bb..e8cfa92b 100644 --- a/cypress/integration/albums.spec.ts +++ b/cypress/integration/albums.spec.ts @@ -54,7 +54,7 @@ context('Albums', { scrollBehavior: false }, () => { }) cy.get('#albumWrapper').within(() => { - cy.get('tr.song-item').should('have.length.at.least', 1) + cy.get('.song-item').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 6f649f58..50c92126 100644 --- a/cypress/integration/artists.spec.ts +++ b/cypress/integration/artists.spec.ts @@ -55,7 +55,7 @@ context('Artists', { scrollBehavior: false }, () => { }) cy.get('#artistWrapper').within(() => { - cy.get('tr.song-item').should('have.length.at.least', 1) + cy.get('.song-item').should('have.length.at.least', 1) cy.get('.screen-header').within(() => { cy.findByText('Download All').should('be.visible') diff --git a/cypress/integration/extra-panel.spec.ts b/cypress/integration/extra-panel.spec.ts index 29a182af..417bfc2b 100644 --- a/cypress/integration/extra-panel.spec.ts +++ b/cypress/integration/extra-panel.spec.ts @@ -7,7 +7,7 @@ context('Extra Information Panel', () => { }) it('displays an option to add lyrics if blank', () => { - cy.fixture('info.get.200.json').then(data => { + cy.fixture('song-info.get.200.json').then(data => { data.lyrics = null cy.intercept('GET', '/api/**/info', { @@ -17,7 +17,7 @@ context('Extra Information Panel', () => { }) cy.$clickSidebarItem('All Songs') - cy.get('#songsWrapper tr.song-item:first-child').dblclick() + cy.get('#songsWrapper .song-item:first-child').dblclick() cy.get('#extraPanelLyrics').should('be.visible').and('contain.text', 'No lyrics found.') cy.get('#extraPanelLyrics [data-test=add-lyrics-btn]').click() @@ -26,7 +26,7 @@ context('Extra Information Panel', () => { }) }) - it('displays the band information', () => { + it('displays the artist information', () => { cy.$shuffleSeveralSongs() cy.get('#extraTabArtist').click() cy.get('#extraPanelArtist').should('be.visible').within(() => { diff --git a/cypress/integration/favorites.spec.ts b/cypress/integration/favorites.spec.ts index 642d3d62..c52285d8 100644 --- a/cypress/integration/favorites.spec.ts +++ b/cypress/integration/favorites.spec.ts @@ -8,7 +8,7 @@ context('Favorites', { scrollBehavior: false }, () => { .within(() => { cy.findByText('Songs You Love').should('be.visible') cy.findByText('Download All').should('be.visible') - cy.get('tr.song-item').should('have.length', 3) + cy.get('.song-item').should('have.length', 3) .each(row => { cy.wrap(row) .get('[data-test=btn-like-liked]') @@ -26,7 +26,7 @@ context('Favorites', { scrollBehavior: false }, () => { cy.get('#songsWrapper') .within(() => { - cy.get('tr.song-item:first-child [data-test=like-btn]') + cy.get('.song-item:first-child [data-test=like-btn]') .within(() => cy.get('[data-test=btn-like-unliked]').should('be.visible')) .click() .within(() => cy.get('[data-test=btn-like-liked]').should('be.visible')) @@ -44,7 +44,7 @@ context('Favorites', { scrollBehavior: false }, () => { cy.get('#songsWrapper') .within(() => { - cy.get('tr.song-item:first-child').click() + cy.get('.song-item:first-child').click() cy.get('[data-test=add-to-btn]').click() cy.get('[data-test=add-to-menu]') .should('be.visible') @@ -61,12 +61,12 @@ context('Favorites', { scrollBehavior: false }, () => { cy.get('#favoritesWrapper') .within(() => { - cy.get('tr.song-item:first-child') + cy.get('.song-item:first-child') .should('contain.text', 'November') .within(() => cy.get('[data-test=like-btn]').click()) - cy.get('tr.song-item').should('have.length', 2) - cy.get('tr.song-item:first-child').should('not.contain.text', 'November') + cy.get('.song-item').should('have.length', 2) + cy.get('.song-item:first-child').should('not.contain.text', 'November') }) }) @@ -76,13 +76,13 @@ context('Favorites', { scrollBehavior: false }, () => { cy.get('#favoritesWrapper') .within(() => { - cy.get('tr.song-item:first-child') + cy.get('.song-item:first-child') .should('contain.text', 'November') .click() .type('{backspace}') - cy.get('tr.song-item').should('have.length', 2) - cy.get('tr.song-item:first-child').should('not.contain.text', 'November') + cy.get('.song-item').should('have.length', 2) + cy.get('.song-item:first-child').should('not.contain.text', 'November') }) }) }) diff --git a/cypress/integration/footer-pane.spec.ts b/cypress/integration/footer-pane.spec.ts index a8ec37c5..82647dc6 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 tr.song-item:first-child').dblclick().within(function () { + cy.get('#songsWrapper .song-item:first-child').dblclick().within(function () { cy.get('.title').invoke('text').as('title') cy.get('.album').invoke('text').as('album') cy.get('.artist').invoke('text').as('artist') diff --git a/cypress/integration/other-controls.spec.ts b/cypress/integration/other-controls.spec.ts index 7af87a02..44913b2f 100644 --- a/cypress/integration/other-controls.spec.ts +++ b/cypress/integration/other-controls.spec.ts @@ -7,9 +7,9 @@ context('Other Controls', () => { it('likes/unlikes the current song', () => { cy.$findInTestId('other-controls [data-test=like-btn]').as('like').click() - cy.get('#queueWrapper tr.song-item:first-child [data-test=btn-like-liked]').should('be.visible') + cy.get('#queueWrapper .song-item:first-child [data-test=btn-like-liked]').should('be.visible') cy.get('@like').click() - cy.get('#queueWrapper tr.song-item:first-child [data-test=btn-like-unliked]').should('be.visible') + cy.get('#queueWrapper .song-item:first-child [data-test=btn-like-unliked]').should('be.visible') }) it('toggles the info panel', () => { diff --git a/cypress/integration/playlists.spec.ts b/cypress/integration/playlists.spec.ts index 1360fbb2..d693cc7f 100644 --- a/cypress/integration/playlists.spec.ts +++ b/cypress/integration/playlists.spec.ts @@ -13,7 +13,7 @@ context('Playlists', () => { .should('be.visible') .and('contain', 'Simple Playlist') - cy.get('tr.song-item') + cy.get('.song-item') .should('be.visible') .and('have.length', 3) diff --git a/cypress/integration/profile.spec.ts b/cypress/integration/profile.spec.ts index 6533118f..d8421f3e 100644 --- a/cypress/integration/profile.spec.ts +++ b/cypress/integration/profile.spec.ts @@ -76,7 +76,7 @@ context('Profiles & Preferences', () => { cy.$login() cy.$mockPlayback() cy.$clickSidebarItem('Current Queue') - cy.get('#queueWrapper').within(() => cy.findByText('shuffling all songs').click()) + cy.get('#queueWrapper').within(() => cy.findByTestId('shuffle-library').click()) cy.findByTestId('album-art-overlay').should('exist') cy.findByTestId('view-profile-link').click() diff --git a/cypress/integration/queuing.spec.ts b/cypress/integration/queuing.spec.ts index 537f99c2..e7a1a5f9 100644 --- a/cypress/integration/queuing.spec.ts +++ b/cypress/integration/queuing.spec.ts @@ -13,9 +13,9 @@ context('Queuing', { scrollBehavior: false }, () => { cy.get('#queueWrapper').within(() => { cy.findByText('Current Queue').should('be.visible') - cy.findByText('shuffling all songs').click() - cy.get('tr.song-item').should('have.length.at.least', MIN_SONG_ITEMS_SHOWN) - cy.get('tr.song-item:first-child').should('have.class', 'playing') + cy.findByTestId('shuffle-library').click() + cy.get('.song-item').should('have.length.at.least', MIN_SONG_ITEMS_SHOWN) + cy.get('.song-item:first-child').should('have.class', 'playing') }) cy.$assertPlaying() @@ -26,12 +26,13 @@ context('Queuing', { scrollBehavior: false }, () => { cy.get('#queueWrapper').within(() => { cy.findByText('Current Queue').should('be.visible') - cy.findByText('shuffling all songs').click() - cy.get('tr.song-item').should('have.length.at.least', MIN_SONG_ITEMS_SHOWN) + cy.findByTestId('shuffle-library').click() + cy.get('').click() + cy.get('.song-item').should('have.length.at.least', MIN_SONG_ITEMS_SHOWN) cy.get('.screen-header [data-test=song-list-controls]') .findByText('Clear') .click() - cy.get('tr.song-item').should('have.length', 0) + cy.get('.song-item').should('have.length', 0) }) }) @@ -44,8 +45,8 @@ context('Queuing', { scrollBehavior: false }, () => { }) cy.get('#queueWrapper').within(() => { - cy.get('tr.song-item').should('have.length.at.least', MIN_SONG_ITEMS_SHOWN) - cy.get('tr.song-item:first-child').should('have.class', 'playing') + cy.get('.song-item').should('have.length.at.least', MIN_SONG_ITEMS_SHOWN) + cy.get('.song-item:first-child').should('have.class', 'playing') }) cy.$assertPlaying() @@ -55,8 +56,8 @@ context('Queuing', { scrollBehavior: false }, () => { cy.$shuffleSeveralSongs() cy.get('#queueWrapper').within(() => { - cy.get('tr.song-item').should('have.length', 3) - cy.get('tr.song-item:first-child').should('have.class', 'playing') + cy.get('.song-item').should('have.length', 3) + cy.get('.song-item:first-child').should('have.class', 'playing') }) }) @@ -64,9 +65,9 @@ context('Queuing', { scrollBehavior: false }, () => { cy.$shuffleSeveralSongs() cy.get('#queueWrapper').within(() => { - cy.get('tr.song-item').should('have.length', 3) - cy.get('tr.song-item:first-child').type('{backspace}') - cy.get('tr.song-item').should('have.length', 2) + cy.get('.song-item').should('have.length', 3) + cy.get('.song-item:first-child').type('{backspace}') + cy.get('.song-item').should('have.length', 2) }) }) @@ -75,15 +76,15 @@ context('Queuing', { scrollBehavior: false }, () => { cy.$clickSidebarItem('All Songs') cy.get('#songsWrapper').within(function () { - cy.get('tr.song-item:nth-child(4) .title').invoke('text').as('title') - cy.get('tr.song-item:nth-child(4)').dblclick() + cy.get('.song-item:nth-child(4) .title').invoke('text').as('title') + cy.get('.song-item:nth-child(4)').dblclick() }) cy.$clickSidebarItem('Current Queue') cy.get('#queueWrapper').within(function () { - cy.get('tr.song-item').should('have.length', 4) - cy.get(`tr.song-item:nth-child(2) .title`).should('have.text', this.title) - cy.get('tr.song-item:nth-child(2)').should('have.class', 'playing') + cy.get('.song-item').should('have.length', 4) + cy.get(`.song-item:nth-child(2) .title`).should('have.text', this.title) + cy.get('.song-item:nth-child(2)').should('have.class', 'playing') }) cy.$assertPlaying() @@ -91,14 +92,14 @@ context('Queuing', { scrollBehavior: false }, () => { it('navigates through the queue', () => { cy.$shuffleSeveralSongs() - cy.get('#queueWrapper tr.song-item:nth-child(1)').should('have.class', 'playing') + cy.get('#queueWrapper .song-item:nth-child(1)').should('have.class', 'playing') cy.findByTestId('play-next-btn').click({ force: true }) - cy.get('#queueWrapper tr.song-item:nth-child(2)').should('have.class', 'playing') + cy.get('#queueWrapper .song-item:nth-child(2)').should('have.class', 'playing') cy.$assertPlaying() cy.findByTestId('play-prev-btn').click({ force: true }) - cy.get('#queueWrapper tr.song-item:nth-child(1)').should('have.class', 'playing') + cy.get('#queueWrapper .song-item:nth-child(1)').should('have.class', 'playing') cy.$assertPlaying() }) @@ -118,7 +119,7 @@ context('Queuing', { scrollBehavior: false }, () => { cy.findByTestId('play-next-btn').click({ force: true }) cy.findByTestId('play-next-btn').click({ force: true }) - cy.get('#queueWrapper tr.song-item:nth-child(1)').should('have.class', 'playing') + cy.get('#queueWrapper .song-item:nth-child(1)').should('have.class', 'playing') cy.$assertPlaying() }) @@ -129,7 +130,7 @@ context('Queuing', { scrollBehavior: false }, () => { cy.$shuffleSeveralSongs() cy.findByTestId('play-next-btn').click({ force: true }) - cy.get('#queueWrapper tr.song-item:nth-child(2)').should('have.class', 'playing') + cy.get('#queueWrapper .song-item:nth-child(2)').should('have.class', 'playing') cy.$assertPlaying() }) }) diff --git a/cypress/integration/searching.spec.ts b/cypress/integration/searching.spec.ts index 33cb0a1c..73a0c30c 100644 --- a/cypress/integration/searching.spec.ts +++ b/cypress/integration/searching.spec.ts @@ -38,7 +38,7 @@ context('Searching', () => { cy.get('#songResultsWrapper').within(() => { cy.get('.screen-header').should('contain.text', 'Showing Songs for foo') - cy.get('tr.song-item').should('have.length', 7) + cy.get('.song-item').should('have.length', 7) }) }) diff --git a/cypress/integration/shortcut-keys.spec.ts b/cypress/integration/shortcut-keys.spec.ts index 7f6f8a11..32713a9b 100644 --- a/cypress/integration/shortcut-keys.spec.ts +++ b/cypress/integration/shortcut-keys.spec.ts @@ -30,9 +30,9 @@ context('Shortcut Keys', () => { cy.$mockPlayback() cy.$shuffleSeveralSongs() cy.get('body').type('j') - cy.get('#queueWrapper tr.song-item:nth-child(2)').should('have.class', 'playing') + cy.get('#queueWrapper .song-item:nth-child(2)').should('have.class', 'playing') cy.get('body').type('k') - cy.get('#queueWrapper tr.song-item:nth-child(1)').should('have.class', 'playing') + cy.get('#queueWrapper .song-item:nth-child(1)').should('have.class', 'playing') cy.$assertPlaying() }) @@ -41,8 +41,8 @@ context('Shortcut Keys', () => { cy.$mockPlayback() cy.$shuffleSeveralSongs() cy.get('body').type('l') - cy.get('#queueWrapper tr.song-item:first-child [data-test=btn-like-liked]').should('be.visible') + cy.get('#queueWrapper .song-item:first-child [data-test=btn-like-liked]').should('be.visible') cy.get('body').type('l') - cy.get('#queueWrapper tr.song-item:first-child [data-test=btn-like-unliked]').should('be.visible') + cy.get('#queueWrapper .song-item:first-child [data-test=btn-like-unliked]').should('be.visible') }) }) diff --git a/cypress/integration/song-context-menu.spec.ts b/cypress/integration/song-context-menu.spec.ts index 2f1edcde..caec501f 100644 --- a/cypress/integration/song-context-menu.spec.ts +++ b/cypress/integration/song-context-menu.spec.ts @@ -5,8 +5,8 @@ context('Song Context Menu', { scrollBehavior: false }, () => { cy.$clickSidebarItem('All Songs') cy.get('#songsWrapper').within(() => { - cy.get('tr.song-item:first-child').dblclick() - cy.get('tr.song-item:first-child').should('have.class', 'playing') + cy.get('.song-item:first-child').dblclick() + cy.get('.song-item:first-child').should('have.class', 'playing') }) cy.$assertPlaying() @@ -18,7 +18,7 @@ context('Song Context Menu', { scrollBehavior: false }, () => { cy.$clickSidebarItem('All Songs') cy.get('#songsWrapper').within(() => { - cy.get('tr.song-item:first-child') + cy.get('.song-item:first-child') .as('item') .rightclick() }) @@ -36,14 +36,14 @@ context('Song Context Menu', { scrollBehavior: false }, () => { cy.$login() cy.$clickSidebarItem('All Songs') - cy.get('#songsWrapper').within(() => cy.get('tr.song-item:first-child').rightclick()) + cy.get('#songsWrapper').within(() => cy.get('.song-item:first-child').rightclick()) cy.findByTestId('song-context-menu').within(() => cy.findByText('Go to Album').click()) cy.get('#albumWrapper') .should('be.visible') .within(() => { cy.get('.screen-header').should('be.visible') - cy.get('tr.song-item').should('have.length.at.least', 1) + cy.get('.song-item').should('have.length.at.least', 1) }) }) @@ -51,14 +51,14 @@ context('Song Context Menu', { scrollBehavior: false }, () => { cy.$login() cy.$clickSidebarItem('All Songs') - cy.get('#songsWrapper').within(() => cy.get('tr.song-item:first-child').rightclick()) + cy.get('#songsWrapper').within(() => cy.get('.song-item:first-child').rightclick()) cy.findByTestId('song-context-menu').within(() => cy.findByText('Go to Artist').click()) cy.get('#artistWrapper') .should('be.visible') .within(() => { cy.get('.screen-header').should('be.visible') - cy.get('tr.song-item').should('have.length.at.least', 1) + cy.get('.song-item').should('have.length.at.least', 1) }) }) @@ -74,13 +74,13 @@ context('Song Context Menu', { scrollBehavior: false }, () => { let songTitle cy.get('#songsWrapper').within(() => { - cy.get('tr.song-item:nth-child(4) .title') + cy.get('.song-item:nth-child(4) .title') .invoke('text') .then(text => { songTitle = text }) - cy.get('tr.song-item:nth-child(4)').rightclick() + cy.get('.song-item:nth-child(4)').rightclick() }) cy.findByTestId('song-context-menu').within(() => { @@ -90,8 +90,8 @@ context('Song Context Menu', { scrollBehavior: false }, () => { cy.$clickSidebarItem('Current Queue') cy.get('#queueWrapper').within(() => { - cy.get('tr.song-item').should('have.length', 4) - cy.get(`tr.song-item:nth-child(${config.queuedPosition}) .title`).should('have.text', songTitle) + cy.get('.song-item').should('have.length', 4) + cy.get(`.song-item:nth-child(${config.queuedPosition}) .title`).should('have.text', songTitle) }) }) }) @@ -115,7 +115,7 @@ context('Song Context Menu', { scrollBehavior: false }, () => { if (config.songCount > 1) { cy.$selectSongRange(1, config.songCount).rightclick() } else { - cy.get('tr.song-item:first-child').rightclick() + cy.get('.song-item:first-child').rightclick() } }) @@ -132,7 +132,7 @@ context('Song Context Menu', { scrollBehavior: false }, () => { it('does not have smart playlists as target for adding songs', () => { cy.$login() cy.$clickSidebarItem('All Songs') - cy.get('#songsWrapper').within(() => cy.get('tr.song-item:first-child').rightclick()) + cy.get('#songsWrapper').within(() => cy.get('.song-item:first-child').rightclick()) cy.findByTestId('song-context-menu') .within(() => { @@ -150,7 +150,7 @@ context('Song Context Menu', { scrollBehavior: false }, () => { cy.$clickSidebarItem('All Songs') cy.$assertFavoriteSongCount(3) - cy.get('#songsWrapper').within(() => cy.get('tr.song-item:first-child').rightclick()) + cy.get('#songsWrapper').within(() => cy.get('.song-item:first-child').rightclick()) cy.findByTestId('song-context-menu').within(() => { cy.findByText('Add To').click() cy.findByText('Favorites').click() @@ -161,10 +161,10 @@ context('Song Context Menu', { scrollBehavior: false }, () => { it('initiates editing a song', () => { cy.intercept('/api/**/info', { - fixture: 'info.get.200.json' + fixture: 'song-info.get.200.json' }) - cy.get('#songsWrapper').within(() => cy.get('tr.song-item:first-child').rightclick()) + cy.get('#songsWrapper').within(() => cy.get('.song-item:first-child').rightclick()) cy.findByTestId('song-context-menu').within(() => cy.findByText('Edit').click()) cy.findByTestId('edit-song-form').should('be.visible') }) @@ -175,7 +175,7 @@ context('Song Context Menu', { scrollBehavior: false }, () => { cy.$login() cy.$clickSidebarItem('All Songs') - cy.get('#songsWrapper').within(() => cy.get('tr.song-item:first-child').rightclick()) + cy.get('#songsWrapper').within(() => cy.get('.song-item:first-child').rightclick()) cy.findByTestId('song-context-menu').within(() => cy.findByText('Download').click()) cy.wait('@download') @@ -185,7 +185,7 @@ context('Song Context Menu', { scrollBehavior: false }, () => { cy.$login({ allowDownload: false }) cy.$clickSidebarItem('All Songs') - cy.get('#songsWrapper').within(() => cy.get('tr.song-item:first-child').rightclick()) + cy.get('#songsWrapper').within(() => cy.get('.song-item:first-child').rightclick()) cy.findByTestId('song-context-menu').within(() => cy.findByText('Download').should('not.exist')) }) @@ -193,7 +193,7 @@ context('Song Context Menu', { scrollBehavior: false }, () => { cy.$loginAsNonAdmin() cy.$clickSidebarItem('All Songs') - cy.get('#songsWrapper').within(() => cy.get('tr.song-item:first-child').rightclick()) + cy.get('#songsWrapper').within(() => cy.get('.song-item:first-child').rightclick()) cy.findByTestId('song-context-menu').within(() => cy.findByText('Edit').should('not.exist')) }) @@ -202,7 +202,7 @@ context('Song Context Menu', { scrollBehavior: false }, () => { cy.$clickSidebarItem('All Songs') cy.window().then(window => cy.spy(window.document, 'execCommand').as('copy')) - cy.get('#songsWrapper').within(() => cy.get('tr.song-item:first-child').rightclick()) + cy.get('#songsWrapper').within(() => cy.get('.song-item:first-child').rightclick()) cy.findByTestId('song-context-menu').within(() => cy.findByText('Copy Shareable URL').click()) cy.get('@copy').should('be.calledWithExactly', 'copy') }) diff --git a/cypress/integration/song-editing.spec.ts b/cypress/integration/song-editing.spec.ts index bad39b0c..9aef228c 100644 --- a/cypress/integration/song-editing.spec.ts +++ b/cypress/integration/song-editing.spec.ts @@ -1,7 +1,7 @@ context('Song Editing', { scrollBehavior: false }, () => { beforeEach(() => { cy.intercept('/api/**/info', { - fixture: 'info.get.200.json' + fixture: 'song-info.get.200.json' }) cy.$login() @@ -13,7 +13,7 @@ context('Song Editing', { scrollBehavior: false }, () => { fixture: 'songs.put.200.json' }) - cy.get('#songsWrapper tr.song-item:first-child').rightclick() + cy.get('#songsWrapper .song-item:first-child').rightclick() cy.findByTestId('song-context-menu').within(() => cy.findByText('Edit').click()) cy.findByTestId('edit-song-form').within(() => { @@ -34,11 +34,11 @@ context('Song Editing', { scrollBehavior: false }, () => { cy.findByText('Updated 1 song.').should('be.visible') cy.findByTestId('edit-song-form').should('not.exist') - cy.get('#songsWrapper tr.song-item:first-child .title').should('have.text', 'New Title') + cy.get('#songsWrapper .song-item:first-child .title').should('have.text', 'New Title') }) it('cancels editing', () => { - cy.get('#songsWrapper tr.song-item:first-child').rightclick() + cy.get('#songsWrapper .song-item:first-child').rightclick() cy.findByTestId('song-context-menu').within(() => cy.findByText('Edit').click()) cy.$findInTestId('edit-song-form .btn-cancel').click() @@ -79,8 +79,8 @@ context('Song Editing', { scrollBehavior: false }, () => { cy.findByText('Updated 3 songs.').should('be.visible') cy.findByTestId('edit-song-form').should('not.exist') - cy.get('#songsWrapper tr.song-item:nth-child(1) .album').should('have.text', 'The Wall') - cy.get('#songsWrapper tr.song-item:nth-child(2) .album').should('have.text', 'The Wall') - cy.get('#songsWrapper tr.song-item:nth-child(3) .album').should('have.text', 'The Wall') + cy.get('#songsWrapper .song-item:nth-child(1) .album').should('have.text', 'The Wall') + cy.get('#songsWrapper .song-item:nth-child(2) .album').should('have.text', 'The Wall') + cy.get('#songsWrapper .song-item:nth-child(3) .album').should('have.text', 'The Wall') }) }) diff --git a/cypress/integration/youtube.spec.ts b/cypress/integration/youtube.spec.ts index a6958664..52e02b15 100644 --- a/cypress/integration/youtube.spec.ts +++ b/cypress/integration/youtube.spec.ts @@ -17,7 +17,7 @@ context('YouTube', () => { }) cy.$clickSidebarItem('All Songs') - cy.get('#songsWrapper tr.song-item:first-child').dblclick() + cy.get('#songsWrapper .song-item:first-child').dblclick() cy.get('#extra').within(() => { cy.get('#extraTabYouTube').click() @@ -31,7 +31,7 @@ context('YouTube', () => { cy.$mockPlayback() cy.$clickSidebarItem('All Songs') - cy.get('#songsWrapper tr.song-item:first-child').dblclick() + cy.get('#songsWrapper .song-item:first-child').dblclick() cy.get('#extra').within(() => { cy.get('#extraTabYouTube').click() diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 78f4a243..20640c15 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -18,7 +18,7 @@ Cypress.Commands.add('$login', (options: Partial = {}): Chainable< cy.fixture(mergedOptions.asAdmin ? 'data.get.200.json' : 'data-non-admin.get.200.json').then(data => { delete mergedOptions.asAdmin - cy.intercept('GET', 'api/data', { + cy.intercept('api/data', { statusCode: 200, body: Object.assign(data, mergedOptions) }) @@ -54,16 +54,16 @@ Cypress.Commands.add('$clickSidebarItem', (sidebarItemText: string): Chainable { - cy.intercept('GET', '/play/**?api_token=mock-token', { + cy.intercept('/play/**?api_token=mock-token', { fixture: 'sample.mp3' }) - cy.intercept('GET', '/api/album/**/thumbnail', { + cy.intercept('/api/album/**/thumbnail', { fixture: 'album-thumbnail.get.200.json' }) - cy.intercept('GET', '/api/**/info', { - fixture: 'info.get.200.json' + cy.intercept('/api/song/**/info', { + fixture: 'song-info.get.200.json' }) }) @@ -72,8 +72,8 @@ Cypress.Commands.add('$shuffleSeveralSongs', (count = 3) => { cy.$clickSidebarItem('All Songs') cy.get('#songsWrapper').within(() => { - cy.get('tr.song-item:nth-child(1)').click() - cy.get(`tr.song-item:nth-child(${count})`).click({ + cy.get('.song-item:nth-child(1)').click() + cy.get(`.song-item:nth-child(${count})`).click({ shiftKey: true }) @@ -83,21 +83,21 @@ Cypress.Commands.add('$shuffleSeveralSongs', (count = 3) => { Cypress.Commands.add('$assertPlaylistSongCount', (name: string, count: number) => { cy.$clickSidebarItem(name) - cy.get('#playlistWrapper tr.song-item').should('have.length', count) + cy.get('#playlistWrapper .song-item').should('have.length', count) cy.go('back') }) Cypress.Commands.add('$assertFavoriteSongCount', (count: number) => { cy.$clickSidebarItem('Favorites') - cy.get('#favoritesWrapper').within(() => cy.get('tr.song-item').should('have.length', count)) + cy.get('#favoritesWrapper').within(() => cy.get('.song-item').should('have.length', count)) cy.go('back') }) Cypress.Commands.add( '$selectSongRange', (start: number, end: number, scrollBehavior: scrollBehaviorOptions = false): Chainable => { - cy.get(`tr.song-item:nth-child(${start})`).click() - return cy.get(`tr.song-item:nth-child(${end})`).click({ + cy.get(`.song-item:nth-child(${start})`).click() + return cy.get(`.song-item:nth-child(${end})`).click({ scrollBehavior, shiftKey: true }) diff --git a/cypress/support/index.ts b/cypress/support/index.ts index d68db96d..feae6419 100644 --- a/cypress/support/index.ts +++ b/cypress/support/index.ts @@ -16,5 +16,8 @@ // Import commands.js using ES2015 syntax: import './commands' -// Alternatively you can use CommonJS syntax: -// require('./commands') +Cypress.on('uncaught:exception', () => { + // returning false here prevents Cypress from failing the test + // @see https://docs.cypress.io/api/events/catalog-of-events#Uncaught-Exceptions + return false +}) diff --git a/cypress/types.d.ts b/cypress/types.d.ts index 7fe44f96..cd2cd915 100644 --- a/cypress/types.d.ts +++ b/cypress/types.d.ts @@ -21,7 +21,7 @@ declare namespace Cypress { $mockPlayback(): void /** - * Queue several songs from the All Song screen. + * Queue several songs from the "All Songs" screen. * @param count */ $shuffleSeveralSongs(count?: number): void diff --git a/resources/assets/js/components/screens/QueueScreen.vue b/resources/assets/js/components/screens/QueueScreen.vue index 69ebe345..707c5c48 100644 --- a/resources/assets/js/components/screens/QueueScreen.vue +++ b/resources/assets/js/components/screens/QueueScreen.vue @@ -41,7 +41,13 @@ No songs queued. How about - shuffling the whole library? + + shuffling the whole library + ?