wp-media / wp-rocket-e2e

Playwright E2E testing repo
GNU General Public License v3.0
0 stars 0 forks source link

Add "comments" in the JSON of expected results to track "weird" expectations and avoid confusion and questions #121

Closed MathieuLamiot closed 1 day ago

MathieuLamiot commented 2 months ago

Context https://wp-media.slack.com/archives/C05NH7JU4S2/p1719573044181989

Expected behavior

MathieuLamiot commented 6 days ago

From @Khadreal:

Hello, Following this https://wp-media.slack.com/archives/C05NH7JU4S2/p1719573044181989 for https://github.com/wp-media/wp-rocket-e2e/issues/121 but not quite sure what the comments should be like

So, on this issue, there are two things to do:

  1. Define a way to add "comments" to the templates in the JSON file, as JSON files don't natively support comments.
  2. Write the comments for the two templates that are confusing.

For instance here, we could do:

  "lcp_6647_svgbg_template": {
    "comment": "Contains only SVG and background-image styles starting with data:image. Those are not captured by our OCI feature.",
    "lcp": [],
    "viewport": [],
    "enabled": true
  },

About this one Maybe:

  "lcp_single_double": {
    "comment": "LCP on this template is from an <input> tag which is not handled by default. Hence, we expect no LCP to be identified.",
    "lcp": [
    ],
    "viewport": [],
    "enabled": true
  },

Note that those added comments should be duplicated for both mobile and desktop json files.

What is really needed in this issue? From a development perspective, it's quite shallow. What is needed here is mostly: