Skip to content

Commit

Permalink
Merge pull request #12502 from bbc/failing-reverb-tests-try-some-logg…
Browse files Browse the repository at this point in the history
…ing-recent-audio-episodes

Add logs to reverb tests to diagnose failures after recent audio episodes click test
  • Loading branch information
LilyL0u authored Mar 11, 2025
2 parents 0616e83 + 7a72578 commit ff06bff
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
18 changes: 18 additions & 0 deletions cypress/e2e/specialFeatures/atiAnalytics/assertions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,29 @@ export const assertPageView = ({
cy.url().then(url => {
interceptATIAnalyticsBeacons();
cy.visit(url);

console.log(

Check warning on line 78 in cypress/e2e/specialFeatures/atiAnalytics/assertions/index.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected console statement
'url in assertPageView just after cy.visit in assertPageView',
url,
);
cy.log('url in assertPageView just after cy.visit assertPageView', url);
const atiPageViewAlias = useReverb ? ATI_PAGE_VIEW_REVERB : ATI_PAGE_VIEW;

cy.wait(`@${atiPageViewAlias}`).then(({ request }) => {
const params = getATIParamsFromURL(request.url);
console.log(

Check warning on line 87 in cypress/e2e/specialFeatures/atiAnalytics/assertions/index.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected console statement
'p param from getATIParamsFromUrl assertPageView',
params.p,
'for URL',
request.url,
);

cy.log(
'p param from getATIParamsFromUrl assertPageView',
params.p,
'for URL',
request.url,
);
assertATIPageViewEventParamsExist({
params,
contentType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ export const assertRecentAudioEpisodesComponentClick = ({
cy.url().then(url => {
interceptATIAnalyticsBeacons();
cy.visit(url);
console.log(

Check warning on line 39 in cypress/e2e/specialFeatures/atiAnalytics/assertions/recentAudioEpisodes.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected console statement
'the url in assertRecentAudioEpisodesComponentClick before the click is',
url,
);
cy.log(
'the url in assertRecentAudioEpisodesComponentClick before the click is',
url,
);

cy.get('[data-e2e="recent-episodes-list"]').scrollIntoView({
duration: 1000,
Expand All @@ -50,9 +58,27 @@ export const assertRecentAudioEpisodesComponentClick = ({
contentType,
useReverb,
});

cy.url().then(url2 => {
console.log(

Check warning on line 62 in cypress/e2e/specialFeatures/atiAnalytics/assertions/recentAudioEpisodes.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected console statement
'the url in assertRecentAudioEpisodesComponentClick after the click is',
url2,
);
cy.log(
'the url in assertRecentAudioEpisodesComponentClick after the click is',
url2,
);
});
// return to previous page
cy.visit(url);

console.log(

Check warning on line 74 in cypress/e2e/specialFeatures/atiAnalytics/assertions/recentAudioEpisodes.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected console statement
'the url in assertRecentAudioEpisodesComponentClick after the revisiting of the previous page is',
url,
);
cy.log(
'the url in assertRecentAudioEpisodesComponentClick after the revisiting of the previous page is',
url,
);
});
});
};
11 changes: 10 additions & 1 deletion cypress/e2e/specialFeatures/atiAnalytics/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ import envs from '../../../../support/config/envs';
export const getATIParamsFromURL = atiAnalyticsURL => {
const url = new URL(atiAnalyticsURL);

return Object.fromEntries(new URLSearchParams(url.search));
const objectFromEntries = Object.fromEntries(new URLSearchParams(url.search));
console.log(

Check warning on line 7 in cypress/e2e/specialFeatures/atiAnalytics/helpers/index.js

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected console statement
'objectFromEntries p value in getATIParamsFromURL',
objectFromEntries.p,
);
cy.log(
'objectFromEntries p value in getATIParamsFromURL',
objectFromEntries.p,
);
return objectFromEntries;
};

export const ATI_PAGE_VIEW = 'ati-page-view';
Expand Down

0 comments on commit ff06bff

Please sign in to comment.