Skip to content

Commit ff06bff

Browse files
authored
Merge pull request #12502 from bbc/failing-reverb-tests-try-some-logging-recent-audio-episodes
Add logs to reverb tests to diagnose failures after recent audio episodes click test
2 parents 0616e83 + 7a72578 commit ff06bff

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed

cypress/e2e/specialFeatures/atiAnalytics/assertions/index.js

+18
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,29 @@ export const assertPageView = ({
7474
cy.url().then(url => {
7575
interceptATIAnalyticsBeacons();
7676
cy.visit(url);
77+
78+
console.log(
79+
'url in assertPageView just after cy.visit in assertPageView',
80+
url,
81+
);
82+
cy.log('url in assertPageView just after cy.visit assertPageView', url);
7783
const atiPageViewAlias = useReverb ? ATI_PAGE_VIEW_REVERB : ATI_PAGE_VIEW;
7884

7985
cy.wait(`@${atiPageViewAlias}`).then(({ request }) => {
8086
const params = getATIParamsFromURL(request.url);
87+
console.log(
88+
'p param from getATIParamsFromUrl assertPageView',
89+
params.p,
90+
'for URL',
91+
request.url,
92+
);
8193

94+
cy.log(
95+
'p param from getATIParamsFromUrl assertPageView',
96+
params.p,
97+
'for URL',
98+
request.url,
99+
);
82100
assertATIPageViewEventParamsExist({
83101
params,
84102
contentType,

cypress/e2e/specialFeatures/atiAnalytics/assertions/recentAudioEpisodes.js

+27-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ export const assertRecentAudioEpisodesComponentClick = ({
3636
cy.url().then(url => {
3737
interceptATIAnalyticsBeacons();
3838
cy.visit(url);
39+
console.log(
40+
'the url in assertRecentAudioEpisodesComponentClick before the click is',
41+
url,
42+
);
43+
cy.log(
44+
'the url in assertRecentAudioEpisodesComponentClick before the click is',
45+
url,
46+
);
3947

4048
cy.get('[data-e2e="recent-episodes-list"]').scrollIntoView({
4149
duration: 1000,
@@ -50,9 +58,27 @@ export const assertRecentAudioEpisodesComponentClick = ({
5058
contentType,
5159
useReverb,
5260
});
53-
61+
cy.url().then(url2 => {
62+
console.log(
63+
'the url in assertRecentAudioEpisodesComponentClick after the click is',
64+
url2,
65+
);
66+
cy.log(
67+
'the url in assertRecentAudioEpisodesComponentClick after the click is',
68+
url2,
69+
);
70+
});
5471
// return to previous page
5572
cy.visit(url);
73+
74+
console.log(
75+
'the url in assertRecentAudioEpisodesComponentClick after the revisiting of the previous page is',
76+
url,
77+
);
78+
cy.log(
79+
'the url in assertRecentAudioEpisodesComponentClick after the revisiting of the previous page is',
80+
url,
81+
);
5682
});
5783
});
5884
};

cypress/e2e/specialFeatures/atiAnalytics/helpers/index.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ import envs from '../../../../support/config/envs';
33
export const getATIParamsFromURL = atiAnalyticsURL => {
44
const url = new URL(atiAnalyticsURL);
55

6-
return Object.fromEntries(new URLSearchParams(url.search));
6+
const objectFromEntries = Object.fromEntries(new URLSearchParams(url.search));
7+
console.log(
8+
'objectFromEntries p value in getATIParamsFromURL',
9+
objectFromEntries.p,
10+
);
11+
cy.log(
12+
'objectFromEntries p value in getATIParamsFromURL',
13+
objectFromEntries.p,
14+
);
15+
return objectFromEntries;
716
};
817

918
export const ATI_PAGE_VIEW = 'ati-page-view';

0 commit comments

Comments
 (0)