openzim / youtube

Create a ZIM file from a Youtube channel/username/playlist
GNU General Public License v3.0
46 stars 26 forks source link

Failing cypress test on `main` branch #245

Closed benoit74 closed 3 months ago

benoit74 commented 3 months ago

See https://github.com/openzim/youtube/actions/runs/9664367435/job/26659888824

What is weird is that test was OK on the PR.

I tried to re-run the workflow to check if test was just flaky but result is same.

@dan-niles could you please have a look (nothing urgent).

dan-niles commented 3 months ago

The issue is in the following lines of code: https://github.com/openzim/youtube/blob/d56c272fce4d7504985cf63116f8a58fd98ced19/zimui/src/components/video/VideoPlayer.vue#L36-L50

When the cypress test executes the line mentioned below, the code above gets called. Since we are not mocking the video files, videojs cannot load a video, hence an error is thrown whenever player.value.play() is called. https://github.com/openzim/youtube/blob/d56c272fce4d7504985cf63116f8a58fd98ced19/zimui/cypress/e2e/video_player_page.cy.ts#L50

Intercepting the video loaded by Video.js and replacing it with a mock video should fix this issue.