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

Ophan e2e tests and remove Ophan request cancellation #10359

Merged
merged 3 commits into from
Jan 26, 2024
Merged

Conversation

arelra
Copy link
Member

@arelra arelra commented Jan 26, 2024

What does this change?

Following #10330 we can now:

  • add e2e tests to assert that img/1 and img/2 requests are made to Ophan for articles and fronts including tests when consent is given or rejected
  • remove the cancellation of Ophan requests from the Playwright loadPage util
  • wait for the load event to ensure all requests have completed when loading pages rather than domcontentloaded. Although this adds ~1-5s per test it should improve test stability

Why?

Improved test coverage

Screenshot 2024-01-25 at 22 57 25

@arelra arelra requested a review from a team as a code owner January 26, 2024 12:01
@arelra arelra added run_chromatic Runs chromatic when label is applied and removed dotcom-rendering labels Jan 26, 2024
Copy link

Size Change: 0 B

Total Size: 749 kB

ℹ️ View Unchanged
Filename Size
dotcom-rendering/dist/11.client.web.********************.js 5.78 kB
dotcom-rendering/dist/112.client.web.********************.js 823 B
dotcom-rendering/dist/1191.client.web.********************.js 679 B
dotcom-rendering/dist/1229.client.web.********************.js 8.67 kB
dotcom-rendering/dist/1407.client.web.********************.js 639 B
dotcom-rendering/dist/1412.client.web.********************.js 4.31 kB
dotcom-rendering/dist/1459.client.web.********************.js 877 B
dotcom-rendering/dist/1749.client.web.********************.js 920 B
dotcom-rendering/dist/1955.client.web.********************.js 4.71 kB
dotcom-rendering/dist/2132.client.web.********************.js 4.62 kB
dotcom-rendering/dist/2276.client.web.********************.js 3.35 kB
dotcom-rendering/dist/2293.client.web.********************.js 581 B
dotcom-rendering/dist/307.client.web.********************.js 13.2 kB
dotcom-rendering/dist/3314.client.web.********************.js 4.76 kB
dotcom-rendering/dist/3375.client.web.********************.js 2.7 kB
dotcom-rendering/dist/3410.client.web.********************.js 2.68 kB
dotcom-rendering/dist/3889.client.web.********************.js 8.24 kB
dotcom-rendering/dist/393.client.web.********************.js 921 B
dotcom-rendering/dist/3958.client.web.********************.js 39.9 kB
dotcom-rendering/dist/3986.client.web.********************.js 496 B
dotcom-rendering/dist/4002.client.web.********************.js 4.59 kB
dotcom-rendering/dist/4040.client.web.********************.js 651 B
dotcom-rendering/dist/4045.client.web.********************.js 642 B
dotcom-rendering/dist/405.client.web.********************.js 915 B
dotcom-rendering/dist/4215.client.web.********************.js 409 B
dotcom-rendering/dist/4219.client.web.********************.js 5.74 kB
dotcom-rendering/dist/4265.client.web.********************.js 2.38 kB
dotcom-rendering/dist/4269.client.web.********************.js 667 B
dotcom-rendering/dist/4298.client.web.********************.js 8.41 kB
dotcom-rendering/dist/4390.client.web.********************.js 507 B
dotcom-rendering/dist/4438.client.web.********************.js 802 B
dotcom-rendering/dist/4442.client.web.********************.js 712 B
dotcom-rendering/dist/478.client.web.********************.js 594 B
dotcom-rendering/dist/4870.client.web.********************.js 747 B
dotcom-rendering/dist/4911.client.web.********************.js 780 B
dotcom-rendering/dist/4982.client.web.********************.js 3.82 kB
dotcom-rendering/dist/5020.client.web.********************.js 994 B
dotcom-rendering/dist/5041.client.web.********************.js 3.76 kB
dotcom-rendering/dist/5047.client.web.********************.js 779 B
dotcom-rendering/dist/5144.client.web.********************.js 5.08 kB
dotcom-rendering/dist/5242.client.web.********************.js 529 B
dotcom-rendering/dist/5290.client.web.********************.js 3.24 kB
dotcom-rendering/dist/5499.client.web.********************.js 2.47 kB
dotcom-rendering/dist/5619.client.web.********************.js 926 B
dotcom-rendering/dist/5730.client.web.********************.js 954 B
dotcom-rendering/dist/5772.client.web.********************.js 9.97 kB
dotcom-rendering/dist/5957.client.web.********************.js 5.93 kB
dotcom-rendering/dist/5985.client.web.********************.js 748 B
dotcom-rendering/dist/6043.client.web.********************.js 852 B
dotcom-rendering/dist/6140.client.web.********************.js 852 B
dotcom-rendering/dist/6651.client.web.********************.js 905 B
dotcom-rendering/dist/6693.client.web.********************.js 823 B
dotcom-rendering/dist/6756.client.web.********************.js 525 B
dotcom-rendering/dist/6853.client.web.********************.js 1 kB
dotcom-rendering/dist/7018.client.web.********************.js 787 B
dotcom-rendering/dist/7167.client.web.********************.js 16.5 kB
dotcom-rendering/dist/7329.client.web.********************.js 2.77 kB
dotcom-rendering/dist/7356.client.web.********************.js 1 kB
dotcom-rendering/dist/7554.client.web.********************.js 3.27 kB
dotcom-rendering/dist/7629.client.web.********************.js 2.87 kB
dotcom-rendering/dist/7855.client.web.********************.js 787 B
dotcom-rendering/dist/7983.client.web.********************.js 3.1 kB
dotcom-rendering/dist/8002.client.web.********************.js 801 B
dotcom-rendering/dist/8113.client.web.********************.js 3.48 kB
dotcom-rendering/dist/8288.client.web.********************.js 23 kB
dotcom-rendering/dist/8310.client.web.********************.js 3.74 kB
dotcom-rendering/dist/8344.client.web.********************.js 1.56 kB
dotcom-rendering/dist/8388.client.web.********************.js 618 B
dotcom-rendering/dist/841.client.web.********************.js 788 B
dotcom-rendering/dist/8784.client.web.********************.js 5.09 kB
dotcom-rendering/dist/8818.client.web.********************.js 746 B
dotcom-rendering/dist/8937.client.web.********************.js 888 B
dotcom-rendering/dist/9004.client.web.********************.js 5.85 kB
dotcom-rendering/dist/9106.client.web.********************.js 2.93 kB
dotcom-rendering/dist/9173.client.web.********************.js 724 B
dotcom-rendering/dist/9314.client.web.********************.js 823 B
dotcom-rendering/dist/9343.client.web.********************.js 2.98 kB
dotcom-rendering/dist/9458.client.web.********************.js 4.82 kB
dotcom-rendering/dist/9529.client.web.********************.js 3.24 kB
dotcom-rendering/dist/958.client.web.********************.js 3.17 kB
dotcom-rendering/dist/9591.client.web.********************.js 1.85 kB
dotcom-rendering/dist/9621.client.web.********************.js 719 B
dotcom-rendering/dist/9676.client.web.********************.js 888 B
dotcom-rendering/dist/9856.client.web.********************.js 5.75 kB
dotcom-rendering/dist/9879.client.web.********************.js 3.38 kB
dotcom-rendering/dist/9978.client.web.********************.js 960 B
dotcom-rendering/dist/AdPortals-importable.client.web.********************.js 3.72 kB
dotcom-rendering/dist/AlreadyVisited-importable.client.web.********************.js 425 B
dotcom-rendering/dist/AppsEpic-importable.client.web.********************.js 4.09 kB
dotcom-rendering/dist/AppsFooter-importable.client.web.********************.js 3.57 kB
dotcom-rendering/dist/AppsLightboxImage-importable.client.web.********************.js 3 kB
dotcom-rendering/dist/AppsLightboxImageStore-importable.client.web.********************.js 2.42 kB
dotcom-rendering/dist/AudioAtomWrapper-importable.client.web.********************.js 3.58 kB
dotcom-rendering/dist/AustralianTerritorySwitcher-importable.client.web.********************.js 2.01 kB
dotcom-rendering/dist/Branding-importable.client.web.********************.js 2.54 kB
dotcom-rendering/dist/braze-web-sdk-core.client.web.********************.js 36.9 kB
dotcom-rendering/dist/BrazeMessaging-importable.client.web.********************.js 5.26 kB
dotcom-rendering/dist/CalloutBlockComponent-importable.client.web.********************.js 6.75 kB
dotcom-rendering/dist/CalloutEmbedBlockComponent-importable.client.web.********************.js 5.76 kB
dotcom-rendering/dist/CardCommentCount-importable.client.web.********************.js 4.43 kB
dotcom-rendering/dist/Carousel-importable.client.web.********************.js 5.52 kB
dotcom-rendering/dist/CarouselForNewsletters-importable.client.web.********************.js 5.65 kB
dotcom-rendering/dist/ChartAtom-importable.client.web.********************.js 541 B
dotcom-rendering/dist/CommentCount-importable.client.web.********************.js 3.24 kB
dotcom-rendering/dist/DiscussionContainer-importable.client.web.********************.js 22.7 kB
dotcom-rendering/dist/DiscussionMeta-importable.client.web.********************.js 4.01 kB
dotcom-rendering/dist/DocumentBlockComponent-importable.client.web.********************.js 3.57 kB
dotcom-rendering/dist/EmbedBlockComponent-importable.client.web.********************.js 4.13 kB
dotcom-rendering/dist/EnhancePinnedPost-importable.client.web.********************.js 2.01 kB
dotcom-rendering/dist/FetchOnwardsData-importable.client.web.********************.js 2.55 kB
dotcom-rendering/dist/FilterKeyEventsToggle-importable.client.web.********************.js 3.35 kB
dotcom-rendering/dist/FocusStyles-importable.client.web.********************.js 609 B
dotcom-rendering/dist/FollowWrapper-importable.client.web.********************.js 789 B
dotcom-rendering/dist/FooterLabel-importable.client.web.********************.js 341 B
dotcom-rendering/dist/frameworks.client.web.********************.js 20.7 kB
dotcom-rendering/dist/GetCricketScoreboard-importable.client.web.********************.js 3.76 kB
dotcom-rendering/dist/GetMatchNav-importable.client.web.********************.js 10.7 kB
dotcom-rendering/dist/GetMatchStats-importable.client.web.********************.js 1.63 kB
dotcom-rendering/dist/GetMatchTabs-importable.client.web.********************.js 2.62 kB
dotcom-rendering/dist/guardian-braze-components-banner.client.web.********************.js 14.7 kB
dotcom-rendering/dist/guardian-braze-components-end-of-article.client.web.********************.js 9.29 kB
dotcom-rendering/dist/GuideAtomWrapper-importable.client.web.********************.js 781 B
dotcom-rendering/dist/HeaderTopBar-importable.client.web.********************.js 10.9 kB
dotcom-rendering/dist/index.client.web.********************.js 47.2 kB
dotcom-rendering/dist/InstagramBlockComponent-importable.client.web.********************.js 3.67 kB
dotcom-rendering/dist/InteractiveBlockComponent-importable.client.web.********************.js 6.09 kB
dotcom-rendering/dist/InteractiveContentsBlockComponent-importable.client.web.********************.js 4.66 kB
dotcom-rendering/dist/InteractiveSupportButton-importable.client.web.********************.js 3.45 kB
dotcom-rendering/dist/KeyEventsCarousel-importable.client.web.********************.js 4.55 kB
dotcom-rendering/dist/KnowledgeQuizAtom-importable.client.web.********************.js 3.54 kB
dotcom-rendering/dist/LatestLinks-importable.client.web.********************.js 2.13 kB
dotcom-rendering/dist/LightboxHash-importable.client.web.********************.js 433 B
dotcom-rendering/dist/LightboxLayout-importable.client.web.********************.js 6.46 kB
dotcom-rendering/dist/LiveBlogEpic-importable.client.web.********************.js 3.59 kB
dotcom-rendering/dist/Liveness-importable.client.web.********************.js 4.93 kB
dotcom-rendering/dist/ManyNewsletterSignUp-importable.client.web.********************.js 6.61 kB
dotcom-rendering/dist/MapEmbedBlockComponent-importable.client.web.********************.js 5.66 kB
dotcom-rendering/dist/Metrics-importable.client.web.********************.js 2.29 kB
dotcom-rendering/dist/MostViewedFooter-importable.client.web.********************.js 4.04 kB
dotcom-rendering/dist/MostViewedFooterData-importable.client.web.********************.js 6.74 kB
dotcom-rendering/dist/MostViewedRightWrapper-importable.client.web.********************.js 4.45 kB
dotcom-rendering/dist/OnwardsUpper-importable.client.web.********************.js 4.26 kB
dotcom-rendering/dist/PersonalityQuizAtom-importable.client.web.********************.js 3.65 kB
dotcom-rendering/dist/ProfileAtom-importable.client.web.********************.js 543 B
dotcom-rendering/dist/ProfileAtomWrapper-importable.client.web.********************.js 802 B
dotcom-rendering/dist/PulsingDot-importable.client.web.********************.js 749 B
dotcom-rendering/dist/QandaAtom-importable.client.web.********************.js 539 B
dotcom-rendering/dist/ReaderRevenueDev-importable.client.web.********************.js 470 B
dotcom-rendering/dist/readerRevenueDevUtils.client.web.********************.js 1.89 kB
dotcom-rendering/dist/ReaderRevenueLinks-importable.client.web.********************.js 5.77 kB
dotcom-rendering/dist/RelativeTime-importable.client.web.********************.js 1.99 kB
dotcom-rendering/dist/RichLinkComponent-importable.client.web.********************.js 6.21 kB
dotcom-rendering/dist/SecureSignup-importable.client.web.********************.js 3.5 kB
dotcom-rendering/dist/SendAMessage-importable.client.web.********************.js 4.39 kB
dotcom-rendering/dist/SendTargetingParams-importable.client.web.********************.js 2.11 kB
dotcom-rendering/dist/sentry.client.web.********************.js 771 B
dotcom-rendering/dist/SetABTests-importable.client.web.********************.js 3.37 kB
dotcom-rendering/dist/SetAdTargeting-importable.client.web.********************.js 481 B
dotcom-rendering/dist/shimport.client.web.********************.js 2.79 kB
dotcom-rendering/dist/ShowHideContainers-importable.client.web.********************.js 646 B
dotcom-rendering/dist/ShowMore-importable.client.web.********************.js 5.71 kB
dotcom-rendering/dist/SignInGateMain.client.web.********************.js 3.9 kB
dotcom-rendering/dist/SignInGateMainCheckoutComplete.client.web.********************.js 5 kB
dotcom-rendering/dist/SignInGateSelector-importable.client.web.********************.js 5.63 kB
dotcom-rendering/dist/SlotBodyEnd-importable.client.web.********************.js 6.83 kB
dotcom-rendering/dist/SpotifyBlockComponent-importable.client.web.********************.js 5.49 kB
dotcom-rendering/dist/StickyBottomBanner-importable.client.web.********************.js 5.37 kB
dotcom-rendering/dist/SubNav-importable.client.web.********************.js 2.24 kB
dotcom-rendering/dist/SupportTheG-importable.client.web.********************.js 5.89 kB
dotcom-rendering/dist/TableOfContents-importable.client.web.********************.js 3.1 kB
dotcom-rendering/dist/TimelineAtom-importable.client.web.********************.js 1.24 kB
dotcom-rendering/dist/TweetBlockComponent-importable.client.web.********************.js 1.02 kB
dotcom-rendering/dist/UnsafeEmbedBlockComponent-importable.client.web.********************.js 3.68 kB
dotcom-rendering/dist/VideoFacebookBlockComponent-importable.client.web.********************.js 5.66 kB
dotcom-rendering/dist/VineBlockComponent-importable.client.web.********************.js 3.51 kB
dotcom-rendering/dist/WeatherWrapper-importable.client.web.********************.js 5.45 kB
dotcom-rendering/dist/YoutubeBlockComponent-importable.client.web.********************.js 3.9 kB

compressed-size-action

}) => {
const ophanRequestPromise = interceptOphanRequest({
page,
path: 'img/1',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why img/1 and img/2?

Copy link
Member Author

@arelra arelra Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question!

Looking at the network requests that Ophan makes:

  • img/1 is the single 'view' request that conveys the page URL being viewed.
  • img/2 are the multiple 'event' requests that convey individual pieces of data such as abtests, attentionMS, consent and performance metrics.

Its good to raise though. I will ask the Ophan team what their official naming is for these requests.

Screenshot 2024-01-26 at 13 38 21

Screenshot 2024-01-26 at 13 44 03

@arelra arelra merged commit db02f58 into main Jan 26, 2024
28 checks passed
@arelra arelra deleted the ravi/e2e-ophan branch January 26, 2024 15:28
@prout-bot
Copy link

Seen on PROD (merged by @arelra 7 minutes and 44 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run_chromatic Runs chromatic when label is applied Seen-on-PROD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants