https://cypress.io logo
If i look at what happens when you dont do the int...
# e2e-testing
m
If i look at what happens when you dont do the intercept then after the fetch call 3 other calls to the radio player are being called. When the intercept is set even without a wait then cypress seems to not do anything afterwards. @gray-kilobyte-89541 I dont think he is doing anything wrong. It is more how the application is responding to cypress. If you use this code the radio player starts
Copy code
js
describe('E2E: Radio stream & Playouts', () => {
  it('Can play radio station from player', () => {
    // cy.intercept("GET","https://energyzuerich.mp3.energy.ch/energyzuerich-high.mp3?ua=energy+website+desktop").as("testurl")

    cy.visit('https://energy.ch');

    cy.get('button.flex-shrink-0.w-12.h-12.p-2.cursor-pointer')
      .filter(':visible')
      .click();

    // (fetch) GET 200 https://energyzuerich.mp3.energy.ch/energyzuerich-high.mp3?ua=energy+website+desktop

    // This makes request hang and never fulfill. Later time-outs after 30s. Why?
    //cy.wait('@audioStream').its('response.statusCode').should('eq', 200);
  });
});
But if you just have the intercept line (not waiting on the intercept) then it does not trigger the radio player
Copy code
js
describe('E2E: Radio stream & Playouts', () => {
  it('Can play radio station from player', () => {
    cy.intercept("GET","https://energyzuerich.mp3.energy.ch/energyzuerich-high.mp3?ua=energy+website+desktop").as("testurl")

    cy.visit('https://energy.ch');

    cy.get('button.flex-shrink-0.w-12.h-12.p-2.cursor-pointer')
      .filter(':visible')
      .click();

    // (fetch) GET 200 https://energyzuerich.mp3.energy.ch/energyzuerich-high.mp3?ua=energy+website+desktop

    // This makes request hang and never fulfill. Later time-outs after 30s. Why?
    //cy.wait('@audioStream').its('response.statusCode').should('eq', 200);
  });
});