Monitoring tests

There is some kind of checks that we'd like to perform constantly that are not related to user flows. I'm speaking about back-end cache management, robots.txt, and sitemap.xml checks, assets compression, etc. Tests that check these features could be called "Monitoring Tests" because are little and fast tests that could be launched even once a minute. These kind of tests are usually generic or related to something that broke in the past.

For example, the next test checks that the main.js file of the https://react-redux.realworld.io website is served with the correct content-encoding header

File: cypress/integration/examplesmonitoring-tests/brotli.monitoring.spec.js

/// <reference types="Cypress" />

it("The Brotli-compressed assets should be served with the correct content encoding", () => {
  cy.request({
    url: "https://react-redux.realworld.io/main.js",
    headers: { "Accept-Encoding": "br" }
  })
    .should(xhr => expect(xhr.status).to.eq(200))
    .its("headers.content-encoding")
    .should("equal", "br");
});

Read more about the Monitoring tests into the The concept of "Monitoring Tests" article.

Again: following a naming convention allows you to launch only the monitoring tests.

Author: Stefano Magni

results matching ""

    No results matching ""