kairos icon indicating copy to clipboard operation
kairos copied to clipboard

Expand webui tests to cover docs

Open Itxaka opened this issue 2 years ago • 5 comments

kairos-agent bundles the docs Also runs some webui basic tests

But we bundle the docs as well and we are not even checking if you can access them properly

We should expand the webui docs to at least:

  • Check that the docs link is there in the webui
  • Check that we can follow the link and get to the docs page
  • Maybe check a bit around the docs page to see if navigation is proper? At least to the basic pages like getting started and configuration or something to make sure that not only the index is working but also the subpages

Itxaka avatar Jul 05 '23 09:07 Itxaka

The e2e web tests use cypress: https://github.com/kairos-io/kairos-agent/blob/main/internal/webui/public/cypress/e2e/spec.cy.js

And they are run on CI via the following workflow: https://github.com/kairos-io/kairos-agent/blob/main/.github/workflows/webui.yaml (you can run the earthly target locally)

mauromorales avatar Sep 26 '23 08:09 mauromorales

@mauromorales @Itxaka would it be too much to implement the same thing https://github.com/spectrocloud/librarium has done?

See https://spectrocloud.github.io/librarium/reports/demo-visual-tests/8603071324/1/

the above URL encompasses tests in which we could implement for docs and WebUI.

wcrum avatar Apr 10 '24 19:04 wcrum

@wcrum Because this is an open-source project, it's eligible for the Argos CI open-source free-tier solution, and have an even simpler workflow than what librarium has.

@mauromorales for context, we built something pretty close to what Docusarus uses for Visual Testing.

karl-cardenas-coding avatar Apr 10 '24 21:04 karl-cardenas-coding

@wcrum, @karl-cardenas-coding Thanks for pointing that out, the solution is quite nice, but this seems to work when building a web app/page if I understand correctly.

The tests in this ticket are not meant to validate the content itself, that should happen on the kairos-docs repo. Since we don't have such tests either, maybe we should create a new ticket for that. I think it's quite common that we have a broken link or such.

On the agent, what we want to test is the integration of the agent webui and a copy of the docs which is appended to it. So when the user accesses http://localhost:8080/, they see the installer, can click on the docs link and read the documentation.

Having said that, I'm not sure where we stand here because we had to work on reducing the size of the binaries, so maybe the final decision is to not have the docs integrated in the agent at all.

mauromorales avatar Apr 11 '24 09:04 mauromorales

@mauromorales yeah embedding docs is a challenge in itself. I am not sure if this fits your model, but for Palette docs, we offer an offline docs experience through a Docker image. The image contains all the assets and an HTTP serverthat exposes the site locally. The image is built daily through a GitHub Actions.

karl-cardenas-coding avatar Apr 11 '24 16:04 karl-cardenas-coding