PSA: If marketing has access to Google Tag Manager, your automated tests are already dead.
Consider this a warning to anyone setting up a new E2E suite.
Stage 1: False Hope You build a beautiful suite of 150 critical user journey tests. They run perfectly in your local environment. You feel like a god.
Stage 2: The Ambush Your marketing team decides they want to run a weekend promo. They inject a massive newsletter popup via GTM that loads asynchronously, usually about 3 seconds after the page renders.
Stage 3: The Slot Machine Pipeline Your tests now randomly pass or fail based on server speed. If the script clicks the checkout button in 2.5 seconds, it passes. If the server is slow and the popup loads first, it intercepts the click and the pipeline crashes.
I don't want to wrap every single .click() command in my entire framework in a massive try/catch block just to look for a random modal. Why is it so incredibly hard to get a test framework to just act like a normal human being and dismiss an overlay if it sees one? How do you guys handle unexpected third-party scripts without writing incredibly ugly test code?