swissspidy / wp-performance-action

Reusable GitHub action to measure performance metrics of WordPress sites
Apache License 2.0
24 stars 2 forks source link

Blueprints for test scenarios #174

Open swissspidy opened 1 month ago

swissspidy commented 1 month ago

Like #71, but for the test scenarios themselves. A declarative way for navigating to pages and clicking on things

swissspidy commented 1 month ago

Maybe something like this:

{
  "scenarios": [
    {
      "name": "Homepage LCP",
      "steps": [
        {
          "step": "visit",
          "url": "/"
        }
      ]
    },
    {
      "name": "Search form INP",
      "steps": [
        {
          "step": "visit",
          "url": "/sample-page"
        },
        {
          "step": "getByLabel",
          "arg": "Search"
        },
        {
          "step": "fill",
          "arg": "Lorem ipsum"
        },
        {
          "step": "getByRole",
          "options": {
            "name": "/Search/i"
          }
        },
        {
          "step": "click"
        }
      ]
    }
  ]
}
swissspidy commented 1 month ago

This could also be useful for warming up caches, switching users, or clearing caches