${__('subtitles')}/CC
${__('off')}
${ICON_ARROW_RIGHT}
diff --git a/test/integration/media/DashViewer.e2e.test.js b/test/integration/media/DashViewer.e2e.test.js
index d85d60354..c46173cf8 100644
--- a/test/integration/media/DashViewer.e2e.test.js
+++ b/test/integration/media/DashViewer.e2e.test.js
@@ -1,8 +1,13 @@
-import { runBaseMediaSettingsTests } from '../../support/mediaSettingsTests';
+import {
+ runAudioTracksTests,
+ runBaseMediaSettingsTests,
+ runQualityMenuTests,
+ runSubtitlesTests,
+} from '../../support/mediaSettingsTests';
describe('Dash Viewer', () => {
const token = Cypress.env('ACCESS_TOKEN');
- const fileIdVideo = Cypress.env('FILE_ID_VIDEO');
+ const fileIdVideo = Cypress.env('FILE_ID_VIDEO_SUBTITLES_TRACKS');
describe('Media Settings Controls', () => {
describe('Without react controls', () => {
@@ -11,9 +16,20 @@ describe('Dash Viewer', () => {
cy.showPreview(token, fileIdVideo, {
viewers: { Dash: { useReactControls: false } },
});
+
+ cy.showMediaControls();
+
+ // Open the menu
+ cy.getByTitle('Settings').click({ force: true });
});
runBaseMediaSettingsTests();
+
+ runQualityMenuTests();
+
+ runAudioTracksTests();
+
+ runSubtitlesTests();
});
describe('With react controls', () => {
@@ -22,9 +38,18 @@ describe('Dash Viewer', () => {
cy.showPreview(token, fileIdVideo, {
viewers: { Dash: { useReactControls: true } },
});
+
+ cy.showMediaControls();
+
+ // Open the menu
+ cy.getByTitle('Settings').click({ force: true });
});
runBaseMediaSettingsTests();
+
+ runQualityMenuTests();
+
+ runAudioTracksTests();
});
});
});
diff --git a/test/integration/media/MP3Viewer.e2e.test.js b/test/integration/media/MP3Viewer.e2e.test.js
index 5f2a6af58..a87ac7f30 100644
--- a/test/integration/media/MP3Viewer.e2e.test.js
+++ b/test/integration/media/MP3Viewer.e2e.test.js
@@ -11,6 +11,11 @@ describe('MP3 Viewer', () => {
cy.showPreview(token, fileIdMP3, {
viewers: { MP3: { useReactControls: false } },
});
+
+ cy.showMediaControls();
+
+ // Open the menu
+ cy.getByTitle('Settings').click({ force: true });
});
runBaseMediaSettingsTests();
@@ -22,6 +27,11 @@ describe('MP3 Viewer', () => {
cy.showPreview(token, fileIdMP3, {
viewers: { MP3: { useReactControls: true } },
});
+
+ cy.showMediaControls();
+
+ // Open the menu
+ cy.getByTitle('Settings').click({ force: true });
});
runBaseMediaSettingsTests();
diff --git a/test/integration/media/MP4Viewer.e2e.test.js b/test/integration/media/MP4Viewer.e2e.test.js
index 4edd145ca..04a4acbe8 100644
--- a/test/integration/media/MP4Viewer.e2e.test.js
+++ b/test/integration/media/MP4Viewer.e2e.test.js
@@ -11,6 +11,11 @@ describe('MP4 Viewer', () => {
cy.showPreview(token, fileIdVideo, {
viewers: { Dash: { disabled: true }, MP4: { useReactControls: false } },
});
+
+ cy.showMediaControls();
+
+ // Open the menu
+ cy.getByTitle('Settings').click({ force: true });
});
runBaseMediaSettingsTests();
@@ -22,6 +27,11 @@ describe('MP4 Viewer', () => {
cy.showPreview(token, fileIdVideo, {
viewers: { Dash: { disabled: true }, MP4: { useReactControls: true } },
});
+
+ cy.showMediaControls();
+
+ // Open the menu
+ cy.getByTitle('Settings').click({ force: true });
});
runBaseMediaSettingsTests();
diff --git a/test/integration/media/Video360Viewer.e2e.test.js b/test/integration/media/Video360Viewer.e2e.test.js
index b32150f6c..a836642a7 100644
--- a/test/integration/media/Video360Viewer.e2e.test.js
+++ b/test/integration/media/Video360Viewer.e2e.test.js
@@ -1,4 +1,4 @@
-import { runBaseMediaSettingsTests } from '../../support/mediaSettingsTests';
+import { runBaseMediaSettingsTests, runQualityMenuTests } from '../../support/mediaSettingsTests';
describe('Video360 Viewer', () => {
const token = Cypress.env('ACCESS_TOKEN');
@@ -11,9 +11,16 @@ describe('Video360 Viewer', () => {
cy.showPreview(token, fileIdVideo360, {
viewers: { Video360: { useReactControls: false } },
});
+
+ cy.showMediaControls();
+
+ // Open the menu
+ cy.getByTitle('Settings').click({ force: true });
});
runBaseMediaSettingsTests();
+
+ runQualityMenuTests();
});
});
});
diff --git a/test/support/mediaSettingsTests.js b/test/support/mediaSettingsTests.js
index 2dbbc8f80..33dc44632 100644
--- a/test/support/mediaSettingsTests.js
+++ b/test/support/mediaSettingsTests.js
@@ -1,13 +1,5 @@
-// eslint-disable-next-line import/prefer-default-export
export function runBaseMediaSettingsTests() {
- beforeEach(() => {
- cy.showMediaControls();
-
- // Open the menu
- cy.getByTitle('Settings').click({ force: true });
- });
-
- describe('Base Media Settings', () => {
+ describe('Toggle Settings', () => {
it('Should be able to toggle media settings menu', () => {
cy.getByTestId('bp-settings-flyout').should('be.visible');
cy.getByTestId('bp-media-settings-autoplay').contains('Disabled');
@@ -27,7 +19,9 @@ export function runBaseMediaSettingsTests() {
cy.getByTestId('bp').click();
cy.getByTestId('bp-settings-flyout').should('not.be.visible');
});
+ });
+ describe('Autoplay Menu', () => {
it('Should be able to change the Autoplay setting', () => {
cy.getByTestId('bp-media-settings-autoplay')
.contains('Disabled')
@@ -41,7 +35,9 @@ export function runBaseMediaSettingsTests() {
cy.getByTestId('bp-media-settings-autoplay').contains('Enabled');
});
+ });
+ describe('Speed Menu', () => {
it('Should be able to change the Speed setting', () => {
cy.getByTestId('bp-media-settings-speed')
.contains('Normal')
@@ -57,3 +53,95 @@ export function runBaseMediaSettingsTests() {
});
});
}
+
+export function runQualityMenuTests() {
+ describe('Quality Menu', () => {
+ it('Should be able to change the Quality setting', () => {
+ cy.getByTestId('bp-media-settings-quality')
+ .contains('Auto')
+ .click();
+
+ cy.getByTestId('bp-media-controls-hd').should('be.visible');
+
+ cy.get('[role="menuitem"]').contains('Quality');
+
+ cy.getByTestId('bp-settings-flyout')
+ .contains('480p')
+ .click();
+
+ cy.getByTestId('bp-media-settings-quality').contains('480p');
+
+ 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', () => {
+ cy.getByTestId('bp-media-settings-audiotracks')
+ .contains('Track 1')
+ .click();
+
+ cy.get('[role="menuitem"]').contains('Audio');
+
+ cy.getByTestId('bp-settings-flyout')
+ .contains('Track 2')
+ .click();
+
+ cy.getByTestId('bp-media-settings-audiotracks').contains('Track 2');
+ });
+ });
+}
+
+export function runSubtitlesTests() {
+ describe('Subtitles', () => {
+ it('Should be able to change the Subtitle setting', () => {
+ cy.getByTestId('bp-media-settings-subtitles')
+ .contains('English')
+ .click();
+
+ cy.get('[role="menuitem"]').contains('Subtitles/CC');
+
+ cy.getByTestId('bp-settings-flyout')
+ .contains('Spanish')
+ .click();
+
+ cy.getByTestId('bp-media-settings-subtitles').contains('Spanish');
+ });
+
+ it('Should be able to turn off subtitles via the button', () => {
+ cy.getByTitle('Subtitles/Closed Captions')
+ .as('subtitlesBtn')
+ .should('be.visible')
+ .should('have.attr', 'aria-pressed', 'true');
+
+ cy.getByTestId('bp-media-settings-subtitles').contains('English');
+
+ cy.get('@subtitlesBtn')
+ .click()
+ .should('have.attr', 'aria-pressed', 'false');
+
+ cy.getByTestId('bp-media-settings-subtitles').contains('Off');
+ });
+
+ it('Should be able to turn off subtitles via the menu', () => {
+ cy.getByTitle('Subtitles/Closed Captions')
+ .as('subtitlesBtn')
+ .should('be.visible')
+ .should('have.attr', 'aria-pressed', 'true');
+
+ cy.getByTestId('bp-media-settings-subtitles')
+ .contains('English')
+ .click();
+
+ cy.getByTestId('bp-settings-flyout')
+ .contains('Off')
+ .click();
+
+ cy.get('@subtitlesBtn').should('have.attr', 'aria-pressed', 'false');
+
+ cy.getByTestId('bp-media-settings-subtitles').contains('Off');
+ });
+ });
+}