-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat: test faucet website #702
base: next
Are you sure you want to change the base?
Conversation
dad20af
to
801aa22
Compare
let mut chromedriver = Command::new("chromedriver") | ||
.arg(format!("--port={chromedriver_port}")) | ||
.spawn() | ||
.expect("failed to start chromedriver"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to install Chromedriver and Chrome to run this locally, but I am not sure on why it's running fine in the CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The github CI images have a bunch of pre-installed stuff (I believe the image is like 50GB). This means less cpu wasted installing things etc. And given the amount of webdev, probably almost any semi-popular tooling for it will be pre-installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we create a target in the makefile to install Chromedriver and Chrome?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you can unless you assume the OS? Its a pity the dep doesn't have a bundling option, makes this sort of thing much easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good & interesting (not something I'm familiar with), thank you.
I've left some initial questions and suggestions; I think we may also want to organise the test files a bit somehow but we can address that after everything else.
Right now this tests that the website loads and has the correct title. Would we then extend this with requesting funds from the faucet as well? (separate PR etc maybe).
bin/faucet/src/main.rs
Outdated
.ok_or(anyhow::anyhow!( | ||
"Couldn't get any socket addrs for endpoint: {}", | ||
config.endpoint | ||
))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.ok_or(anyhow::anyhow!( | |
"Couldn't get any socket addrs for endpoint: {}", | |
config.endpoint | |
))?; | |
.with_context(|| format!("no sockets available on {}, config.endpoint))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though I'm unsure under what circumstances that would even occur.
Closes #673
This PR adds a test for the faucet website. It uses
fantoccini
as a browser client to test that all components are loading correctly.To run
fantoccini
it needs a webdriver running. I'm using chromedriver here, which requires to have Chrome installed.Also, this PR introduces a stub for the node RPC API. This allows to run the faucet and test it using the stub, instead of having to run the full node.