diff --git a/test/integration/media/DashViewer.e2e.test.js b/test/integration/media/DashViewer.e2e.test.js index 696dc484b..b6d44a639 100644 --- a/test/integration/media/DashViewer.e2e.test.js +++ b/test/integration/media/DashViewer.e2e.test.js @@ -1,6 +1,7 @@ import { runAudioTracksTests, runBaseMediaSettingsTests, + runLowQualityMenuTests, runQualityMenuTests, runSubtitlesTests, } from '../../support/mediaSettingsTests'; @@ -8,50 +9,61 @@ import { describe('Dash Viewer', () => { const token = Cypress.env('ACCESS_TOKEN'); const fileIdVideo = Cypress.env('FILE_ID_VIDEO_SUBTITLES_TRACKS'); + const fileIdVideoSmall = Cypress.env('FILE_ID_VIDEO_SMALL'); - describe('Media Settings Controls', () => { - describe('Without react controls', () => { - beforeEach(() => { - cy.visit('/'); - cy.showPreview(token, fileIdVideo, { - viewers: { Dash: { useReactControls: false } }, - }); + const setupTest = (fileId, useReactControls) => { + cy.visit('/'); + cy.showPreview(token, fileId, { + viewers: { Dash: { useReactControls } }, + }); - cy.showMediaControls(); + cy.showMediaControls(); - // Open the menu - cy.getByTitle('Settings').click(); - }); + // Open the menu + cy.getByTitle('Settings').click(); + }; - runBaseMediaSettingsTests(); + describe('HD Video with Subtitles', () => { + describe('Media Settings Controls', () => { + describe('Without react controls', () => { + beforeEach(() => setupTest(fileIdVideo, false)); - runQualityMenuTests(); + runBaseMediaSettingsTests(); - runAudioTracksTests(); + runQualityMenuTests(); - runSubtitlesTests(); - }); + runAudioTracksTests(); + + runSubtitlesTests(); + }); + + describe('With react controls', () => { + beforeEach(() => setupTest(fileIdVideo, true)); - describe('With react controls', () => { - beforeEach(() => { - cy.visit('/'); - cy.showPreview(token, fileIdVideo, { - viewers: { Dash: { useReactControls: true } }, - }); + runBaseMediaSettingsTests(); - cy.showMediaControls(); + runQualityMenuTests(); - // Open the menu - cy.getByTitle('Settings').click(); + runAudioTracksTests(); + + runSubtitlesTests(); }); + }); + }); - runBaseMediaSettingsTests(); + describe('Non HD Video', () => { + describe('Media Settings Controls', () => { + describe('Without react controls', () => { + beforeEach(() => setupTest(fileIdVideoSmall, false)); - runQualityMenuTests(); + runLowQualityMenuTests(); + }); - runAudioTracksTests(); + describe('With react controls', () => { + beforeEach(() => setupTest(fileIdVideoSmall, true)); - runSubtitlesTests(); + runLowQualityMenuTests(); + }); }); }); }); diff --git a/test/support/mediaSettingsTests.js b/test/support/mediaSettingsTests.js index f3cc2d426..1c094939a 100644 --- a/test/support/mediaSettingsTests.js +++ b/test/support/mediaSettingsTests.js @@ -76,6 +76,18 @@ export function runQualityMenuTests() { }); } +export function runLowQualityMenuTests() { + describe('Non HD Video', () => { + it('Should not have the Quality settings menu enabled', () => { + cy.getByTestId('bp-media-settings-quality') + .contains('480p') + .click({ force: true }); + + cy.getByTestId('bp-media-controls-hd').should('not.be.visible'); + }); + }); +} + export function runAudioTracksTests() { describe('Audiotracks Menu', () => { it('Should be able to change the Audiotrack setting', () => {