Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSTEAMA-1382 Remove media player component, and add MediaLoader instead to OD Audio and Podcast pages #11998

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
fc0814f
changed value for title to match morph
Nabeel1276 Sep 20, 2024
a5b0672
Merge branch 'latest' into WSTEAMA-1382-remove-media-player-component…
Nabeel1276 Sep 23, 2024
108287f
replace AVPlayer with MediaLoader for audio
holchris Sep 23, 2024
ff274ed
fixed typescript erros
Nabeel1276 Sep 23, 2024
f6956d3
Merge branch 'WSTEAMA-1382-remove-media-player-component-and-add-medi…
holchris Sep 23, 2024
e606d4a
reorder imports
holchris Sep 23, 2024
ec6d521
Merge branch 'latest' into WSTEAMA-1382-remove-media-player-component…
holchris Sep 23, 2024
242f9a6
refactor error logging for unit tests
holchris Sep 24, 2024
6990f90
undo deletion
holchris Sep 24, 2024
d204935
remove console log
holchris Sep 24, 2024
b45fd50
Merge branch 'WSTEAMA-1382-remove-media-player-component-and-add-medi…
holchris Sep 24, 2024
44a804a
adds persian podcast fixture data
holchris Sep 24, 2024
61ece32
tests for persian podcast overrides
holchris Sep 24, 2024
a904c13
finished creating test for persian podcast
Nabeel1276 Sep 24, 2024
032c11e
Merge branch 'WSTEAMA-1382-remove-media-player-component-and-add-medi…
holchris Sep 24, 2024
104bc99
Merge branch 'latest' into WSTEAMA-1382-remove-media-player-component…
Nabeel1276 Sep 24, 2024
71658e6
attempted to add fixture data and add tests for bengali brand
Nabeel1276 Sep 24, 2024
281e94b
fixed errors in test and added bengali data for mock response
Nabeel1276 Sep 24, 2024
64e8a63
Merge branch 'latest' into WSTEAMA-1382-remove-media-player-component…
Nabeel1276 Sep 25, 2024
d6d8121
updated indonesian radio fixture data
Nabeel1276 Sep 25, 2024
7faf8be
added unit tests for indonesian service
Nabeel1276 Sep 25, 2024
d8798c5
added fixture data for dari radio
Nabeel1276 Sep 25, 2024
3dd320a
Merge branch 'WSTEAMA-1382-remove-media-player-component-and-add-medi…
holchris Sep 25, 2024
b4923ea
updated tests for persian dari radio
Nabeel1276 Sep 25, 2024
b6aad25
removed unused imports/variables and made variable names more specific
Nabeel1276 Sep 25, 2024
d19637c
Merge branch 'latest' into WSTEAMA-1382-remove-media-player-component…
Nabeel1276 Sep 25, 2024
cda6318
removed unused variables
Nabeel1276 Sep 25, 2024
742ed07
Merge branch 'WSTEAMA-1382-remove-media-player-component-and-add-medi…
holchris Sep 25, 2024
4f57755
fix unit test
holchris Sep 25, 2024
f291fac
Merge branch 'latest' into WSTEAMA-1382-remove-media-player-component…
holchris Sep 25, 2024
14adcb7
Merge branch 'latest' into WSTEAMA-1382-remove-media-player-component…
Nabeel1276 Sep 26, 2024
0c3096f
add serviceId overrides
holchris Sep 26, 2024
3f8a17e
delete un needed test
holchris Sep 26, 2024
383eea1
Merge branch 'WSTEAMA-1382-remove-media-player-component-and-add-medi…
holchris Sep 26, 2024
7c58aba
passed unit tests
Nabeel1276 Sep 26, 2024
4bf7ee1
updates snapshots
Nabeel1276 Sep 26, 2024
460918b
Use getMasterbrand utility to extract the page master brand
alex-magana Sep 26, 2024
566044b
added unit test for persian episode
Nabeel1276 Sep 26, 2024
bc22232
Change assertion to check for MediaLoader component
alex-magana Sep 26, 2024
1145f44
Remove assertion checking for absence of morph_env=live since we are …
alex-magana Sep 26, 2024
9532249
Check page identifier used by Afaan Oromoo
alex-magana Sep 26, 2024
a70b5b6
Merge branch 'latest' into WSTEAMA-1382-remove-media-player-component…
alex-magana Sep 26, 2024
127b52b
Merge branch 'WSTEAMA-1382-remove-media-player-component-and-add-medi…
holchris Sep 26, 2024
1f06551
Fix styling
alex-magana Sep 26, 2024
fd865e1
Merge branch 'WSTEAMA-1382-remove-media-player-component-and-add-medi…
alex-magana Sep 26, 2024
91f5af8
update branch
holchris Sep 26, 2024
66c1523
Remove unnecessary styles
alex-magana Sep 27, 2024
ce6b67e
Use shared styling for audio player
alex-magana Sep 27, 2024
5fe248e
Remove obsolete test
alex-magana Sep 27, 2024
086f241
Removed all references of embedUrl
Nabeel1276 Sep 27, 2024
302a6ba
Updated integration tests
Nabeel1276 Sep 27, 2024
999c2b3
Merge branch 'latest' into WSTEAMA-1382-remove-media-player-component…
alex-magana Sep 27, 2024
a71945c
Update OD Radio snapshot
alex-magana Sep 27, 2024
5f2bb9b
Update processRecentEpisodes to match fixtures
alex-magana Sep 27, 2024
0a7d1dc
Use media player audio tests for On Demand Audio
alex-magana Sep 28, 2024
b1d9d8d
Use media player audio tests for the Podcast page
alex-magana Sep 28, 2024
1c1306b
Remove obsolete snapshots
alex-magana Sep 28, 2024
91b9334
Update onDemandAudio e2es
alex-magana Sep 28, 2024
58f86a2
Update storybook fixtures
alex-magana Sep 28, 2024
7913a5f
Remove unused pathEq
alex-magana Sep 28, 2024
24fe165
Use table to test page identifier
alex-magana Sep 28, 2024
f7863a0
Use context providers from the custom render function
alex-magana Sep 28, 2024
3418547
Merge branch 'WSTEAMA-1382-remove-media-player-component-and-add-medi…
holchris Sep 30, 2024
e3da7c5
Update src/app/pages/OnDemandAudioPage/index.test.tsx
alex-magana Sep 30, 2024
88941ce
Remove white background on On Demand Audio page
alex-magana Sep 30, 2024
7f31dd2
Merge branch 'latest' into WSTEAMA-1382-remove-media-player-component…
alex-magana Sep 30, 2024
ebc8d92
Update onDemandAudioPage integration snapshots
alex-magana Sep 30, 2024
a5e4de9
Update OnDemandAudioPage unit test snapshots
alex-magana Sep 30, 2024
06aa2db
Update Podcast page snapshots
alex-magana Sep 30, 2024
50ca11f
Merge branch 'latest' into WSTEAMA-1382-remove-media-player-component…
alex-magana Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 5 additions & 36 deletions cypress/e2e/pages/onDemandAudio/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
/* eslint-disable consistent-return */
import path from 'ramda/src/path';
import {
isAvailable,
getEpisodeAvailability,
overrideRendererOnTest,
getEmbedUrl,
isBrand,
} from '../../../support/helpers/onDemandRadioTv';
import envConfig from '../../../support/config/envs';
import appConfig from '../../../../src/server/utilities/serviceConfigs';
import getDataUrl from '../../../support/helpers/getDataUrl';
import processRecentEpisodes from '../../../../src/app/routes/utils/processRecentEpisodes';
import {
Expand All @@ -24,43 +21,15 @@ export default ({ service, pageType, variant }) => {
retries: 3,
},
() => {
it('should render an iframe with a valid URL', () => {
cy.request(
`${Cypress.env('currentPath')}.json${overrideRendererOnTest()}`,
).then(({ body: jsonData }) => {
if (!isAvailable(jsonData)) {
it('should render a valid media player', () => {
cy.getPageDataFromWindow().then(({ pageData }) => {
if (!getEpisodeAvailability(pageData)) {
return cy.log(
`Episode is not available: ${Cypress.env('currentPath')}`,
);
}
const language = appConfig[service][variant].lang;
const embedUrl = getEmbedUrl({ body: jsonData, language });
const isBrandPage = isBrand(jsonData);

cy.get('iframe').then(iframe => {
let iframeURL = isBrandPage ? iframe.prop('src') : embedUrl;
iframeURL = iframeURL.split('.com').pop();
cy.log(`cy.get('iframe') assertion has already happened`);
cy.log(
`used for Brand - iframe.prop('src') = ${iframe.prop('src')}`,
);
cy.log(`used for Episode - embedURL = ${embedUrl}`);
cy.log(`selector for iframe = iframe[src*="${iframeURL}"]`);
const pathTested = embedUrl.replace(
/^\//,
`${envConfig.baseUrl}/`,
);
cy.log(`path that will have response tested is ${pathTested}`);

cy.get(`iframe[src*="${iframeURL}"]`).should('be.visible');
cy.testResponseCodeAndTypeRetry({
// embedUrl may be relative - making it absolute to test the response
path: embedUrl.replace(/^\//, `${envConfig.baseUrl}/`),
responseCode: 200,
type: 'text/html',
allowFallback: true,
});
});
cy.get('[data-e2e="media-loader__container"]').should('be.visible');
});
});
},
Expand Down
8 changes: 0 additions & 8 deletions cypress/support/helpers/onDemandRadioTv.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import path from 'ramda/src/path';
import pathEq from 'ramda/src/pathEq';

import envConfig from '../config/envs';

Expand Down Expand Up @@ -32,13 +31,6 @@ export const getEmbedUrl = ({ body, language, isAmp }) => {
return isAmp ? `${embedUrl}/amp` : embedUrl;
};

export const isAvailable = pathEq('available', [
'content',
'blocks',
'0',
'availability',
]);

export const getEpisodeAvailability = ({ mediaBlocks }) =>
mediaBlocks[0]?.model?.availability === 'available';

Expand Down
118 changes: 118 additions & 0 deletions data/bengali/bbc_bangla_radio/p030vjwg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"metadata": {
"id": "urn:bbc:ares:ws_media:brand:bbc_bangla_radio/p030vjwg",
"locators": {
"pid": "w172yylmc0c11jh",
"brandPid": "p030vjwg"
},
"type": "WSRADIO",
"createdBy": "bbc_bangla_radio",
"language": "bn",
"lastUpdated": 1727190718000,
"firstPublished": 1670857206000,
"lastPublished": 1670857206000,
"timestamp": 1670857206000,
"options": {},
"analyticsLabels": {
"pageTitle": "প্রবাহ - BBC News বাংলা",
"pageIdentifier": "bengali.bbc_bangla_radio.programmes.p030vjwg.page",
"producerId": "31",
"contentType": "player-episode",
"producer": "BENGALI"
},
"passport": {
"home": "",
"taggings": []
},
"tags": {},
"version": "v1.4.48",
"blockTypes": [
"media"
],
"title": "প্রবাহ",
"releaseDateTimeStamp": 1673827200000,
"useSensitiveOnwardJourneys": false
},
"content": {
"blocks": [
{
"id": "w172yylmc0c11jh",
"subType": "episode",
"format": "Audio",
"title": "16/01/2023 GMT",
"synopses": {
"short": "বিবিসি বাংলা থেকে সংবাদ, সমসাময়িক ঘটনা, বিশেষ প্রতিবেদন, খেলা-ধুলা, ফোন-ইন আর বিতর্ক",
"medium": "বিবিসি বাংলা থেকে সংবাদ, সমসাময়িক ঘটনা, বিশেষ প্রতিবেদন, খেলা-ধুলা, ফোন-ইন আর বিতর্ক"
},
"imageUrl": "ichef.bbci.co.uk/images/ic/$recipe/p08b2kb7.png",
"embedding": false,
"advertising": false,
"versions": [],
"availability": "notAvailable",
"smpKind": "radioProgramme",
"episodeTitle": "প্রবাহ",
"type": "media"
}
]
},
"promo": {
"headlines": {
"headline": "প্রবাহ"
},
"locators": {
"pid": "w172yylmc0c11jh",
"brandPid": "p030vjwg"
},
"media": {
"id": "w172yylmc0c11jh",
"subType": "episode",
"format": "Audio",
"title": "16/01/2023 GMT",
"synopses": {
"short": "বিবিসি বাংলা থেকে সংবাদ, সমসাময়িক ঘটনা, বিশেষ প্রতিবেদন, খেলা-ধুলা, ফোন-ইন আর বিতর্ক",
"medium": "বিবিসি বাংলা থেকে সংবাদ, সমসাময়িক ঘটনা, বিশেষ প্রতিবেদন, খেলা-ধুলা, ফোন-ইন আর বিতর্ক"
},
"imageUrl": "ichef.bbci.co.uk/images/ic/$recipe/p08b2kb7.png",
"embedding": false,
"advertising": false,
"versions": [],
"availability": "notAvailable",
"smpKind": "radioProgramme",
"episodeTitle": "প্রবাহ",
"type": "media"
},
"indexImage": {
"id": "p08b2kb7",
"subType": "index",
"href": "ichef.bbci.co.uk/images/ic/$recipe/p08b2kb7.png",
"path": "ichef.bbci.co.uk/images/ic/$recipe/p08b2kb7.png",
"height": 576,
"width": 1025,
"altText": "পরিক্রমা",
"caption": "সংবাদ বুলেটিনসহ সমসাময়িক ঘটনা নিয়ে দৈনিক অনুষ্ঠান, সাথে সাপ্তাহিক ফোন-ইন, বিতর্ক ও ফিচার",
"copyrightHolder": null,
"type": "image"
},
"releaseDateTimestamp": 1673827200000,
"brand": {
"pid": "p030vjwg",
"title": "প্রবাহ"
},
"id": "urn:bbc:ares:ws_media:page:bbc_bangla_radio/w172yylmc0c11jh",
"type": "ws_radio"
},
"relatedContent": {
"site": {
"subType": "site",
"name": "Bengali",
"uri": "/bengali",
"type": "simple"
},
"groups": [
{
"type": "other-episode",
"promos": []
}
]
}
}
Loading
Loading