testingcypress

cypress wont play the track i want on web player


I want Cypress to play the eleventh track on the webpage, but it does not navigate to it no matter what and plays from the first song. How can I fix this?

enter image description here

I would like it to move on to money for nothing which is track 11, indexed as 10 in the element list, since 0,1,2.. What is the correct configuration to make it play the song.


Solution

  • The site is a bit weird, if you navigate to "Money for nothing" as you showed then "Sultans" starts playing for any click.

    But if you navigate to the base page then click it plays correctly.

    This is my full test:

    // set some configuration in the test header - shadowDom and scrollBehavior
    it('play Money for Nothing', {includeShadowDom:true, scrollBehavior:false}, () => {
    
      // preferable screen resolution
      cy.viewport(1500,1500)
    
      // page base URL
      cy.visit('https://archive.org/details/10.-telegraph-road-live-remix_202303');
    
      // play #11
      cy.contains('button', 'Money For Nothing').click()
    

    enter image description here

    Note the Cypress log after the click - first it fetches "Sultans" then it fetches "Money".

    Also, the time travel (hovering over the Cypress log) causes uncaught exceptions, which is a not uncommon problem with Cypress - you have to keep the cursor off-screen.