You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prevent our tests from failing if an error occurs inside Google Tag Manager (GTM) script. This might be doable by mocking requests loading the GTM script using Puppeteer's Request Interception mechanism, though there may be other routes just as effective.
While looking in that space, it would also be nice to devise a solution that would allow us to check that the acceptance of cookies triggers the injection of the GTM script (mocking may help for that as well).
Why
The cookie banner tests trigger the injection of the GTM script on the page. If that script throws an error, it results in the test failing. This prevents our tests from running their actual assertion and is problematic as we don't control the code in GTM script.
It would be more resilient from us to isolate ourselves from the actual script from GTM during our tests. If we could, though, it would be nice to add tests checking that we do inject the GTM script when cookies are accepted as I don't believe we have anything at the moment.
Who needs to work on this
Developers
Who needs to review this
Developers
Done when
Errors in GTM script do not cause our tests to fail
And either:
Tests have been added to check that the GTM script is injected on the page
An issue has been written to add tests checking the injection of the GTM script on the page
The text was updated successfully, but these errors were encountered:
This makes tests fail when an error happens in a 3rd party code (Google Tag Manager).
This change is only temporary and will be reversed when we implement a longer term solution
to isolate our tests from Google Tag Manager errors.
#3969
What
Prevent our tests from failing if an error occurs inside Google Tag Manager (GTM) script. This might be doable by mocking requests loading the GTM script using Puppeteer's Request Interception mechanism, though there may be other routes just as effective.
While looking in that space, it would also be nice to devise a solution that would allow us to check that the acceptance of cookies triggers the injection of the GTM script (mocking may help for that as well).
Why
The cookie banner tests trigger the injection of the GTM script on the page. If that script throws an error, it results in the test failing. This prevents our tests from running their actual assertion and is problematic as we don't control the code in GTM script.
It would be more resilient from us to isolate ourselves from the actual script from GTM during our tests. If we could, though, it would be nice to add tests checking that we do inject the GTM script when cookies are accepted as I don't believe we have anything at the moment.
Who needs to work on this
Developers
Who needs to review this
Developers
Done when
And either:
The text was updated successfully, but these errors were encountered: