Financial-Times / n-test

A CLI tool and module for lightweight testing of web applications in browsers, designed for FT.com
4 stars 2 forks source link

Assert on XHLRequests body #137

Closed umbobabo closed 4 years ago

umbobabo commented 4 years ago

What? Being capable of asserting the body of XHLRequests

Why? It’s happened during the last year that tracking (Spoor, Google tracking and other custom pixels) where broken in a way hard to prevent just with unit or integration tests. That was also due to the way tracking was structured in some case (N-UI) that surely is improving with PageKit. As @i-like-robots says: "Tracking is a haunted forest" (Absolutely true) Considering data are critical for Marketing and Data team and for what we develop in the Conversion team, we thought that was important ensure that the end part (Request triggered in the client) is always working correctly.

This also gives us the capability of test on multiple browsers, potentially revealing browser-specific issue.

Having this earlier would have surely help, but it is still useful for us considering we are in the process of migrating some critical App to PageKit and Origami where we could potentially miss something.

Why n-test? We could do the same with alternatives like Cypress or straight with Puppeteer but n-test is widely used in all our applications so was the easiest way to share this capability so that maybe other Engineer could benefit from it.

umbobabo commented 4 years ago

Implemented with https://github.com/Financial-Times/n-test/pull/136/files