<audio id="audio" controls>
<source type="audio/mp3" src="https://my-app-domain.com/uploads/2021/03/model-audio1614939065612file732.mp3"> </source>
</audio>
The above code snipped is from my app. I need to test the audio is playable with cypress.
Below is my code to play the audio:
cy.visit('/');
cy.get("source")
.invoke("src")
.then((audiofile) => {
const audio = new Audio(audiofile);
audio.play();
});
With the above code I get the following error.
How can I test play audio with cypress ?
