Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faucet website testing #673

Open
Mirko-von-Leipzig opened this issue Feb 7, 2025 · 3 comments
Open

Faucet website testing #673

Mirko-von-Leipzig opened this issue Feb 7, 2025 · 3 comments
Assignees
Milestone

Comments

@Mirko-von-Leipzig
Copy link
Contributor

Mirko-von-Leipzig commented Feb 7, 2025

There have been several faucet website bugs recently (caused by me) e.g. #671, where various parts of the website aren't served.

It would be nice to test that the website loads correctly. At the moment this isn't trivially possible without actually running the full faucet, which in turn requires a full node.

Ideally the test would be self-contained, i.e.:

  • serve the website (using a single method to add the route(s), which is then also used in prod)
  • load the website and ensure it loads without errors

The latter would require providing a stub API expected by the webpage.

@Mirko-von-Leipzig
Copy link
Contributor Author

@igamigo this could also be a starting issue; quite self-contained to the faucet.

@bobbinth bobbinth added this to the v0.8 milestone Feb 11, 2025
@TomasArrachea
Copy link
Collaborator

TomasArrachea commented Feb 14, 2025

The latter would require providing a stub API expected by the webpage.

By this you mean to provide a stub of the RPC API of the client, right? So as to instantiate a faucet and test the behaviour without needing the full node.

I was thinking of implementing a test that would hit the root endpoint and check that all components are displayed. For this, we could use a browser client like fantoccini to make the request and check outputs. If this seems like overkilll, other option is to just use reqwest to hit the endpoints separately and check they all return correctly. What do you think?

@Mirko-von-Leipzig
Copy link
Contributor Author

The latter would require providing a stub API expected by the webpage.

By this you mean to provide a stub of the RPC API of the client, right? So as to instantiate a faucet and test the behaviour without needing the full node.

Correct yes.

I was thinking of implementing a test that would hit the root endpoint and check that all components are displayed. For this, we could use a browser client like fantoccini to make the request and check outputs. If this seems like overkilll, other option is to just use reqwest to hit the endpoints separately and check they all return correctly. What do you think?

Ah right. My initial thought was reqwest but I somehow imagined that it would automatically load the site - but of course that requires a "browser".

fantoccini does feel a bit heavy, but maybe this could be a precursor to a full integration test. So not just testing the website loads, but that it also correctly handles various errors and note submissions etc. So in that case I do kinda like it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants