-
Notifications
You must be signed in to change notification settings - Fork 20
Selenium test for WebUI #398
base: main
Are you sure you want to change the base?
Conversation
So we can refer to them in integration/selenium tests.
We properly update the query cache after a mutation. This helps avoid races where client serves stale data after we invalidate the query.
- A framework for writing selenium test against the WebUI. - Also contains an initial test for the UI. - Brings various annotations for IDs in critical UI elements to simplify testing.
Benchmark resultsNexmark
Galen
LDBC
Nexmark (with Persistence)
|
/// This is the SQL code that will be saved. | ||
/// | ||
/// I noticed that if you put newlines immediately after the braces, the code | ||
/// editor might add another brace to complete it, and then the code won't be |
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.
that's a stupid editor. should have an option not to do that.
|
||
/// A config for a HTTP endpoint. | ||
/// | ||
/// The \x08 is a backspace character, which is needed to remove the space that |
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.
sick
<PageHeader | ||
title={<Typography variant='h5'>Pipeline Creator</Typography>} | ||
subtitle={<Typography variant='body2'>Define an end-to-end pipeline with analytics.</Typography>} | ||
/> | ||
<Grid item xs={12}> | ||
{/* id referenced by webui-tester */} |
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.
why is the comment in braces?
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.
.jsx/.tsx requires this -- you can't just put /* */
See: https://www.educative.io/answers/how-to-add-comments-in-jsx
let caps = DesiredCapabilities::chrome(); | ||
let driver = WebDriver::new("http://localhost:9515", caps).await?; | ||
|
||
let timeouts = |
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.
describe the three fields?
TimeoutConfiguration::new(None, None, Some(std::time::Duration::from_millis(2000))); | ||
driver.update_timeouts(timeouts).await?; | ||
|
||
driver.goto("http://localhost:3000").await?; |
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.
where do all these ports come from?
should they be in a config file?
|
||
/// Set the name of the program. | ||
pub async fn set_name(&self, name: &str) -> WebDriverResult<()> { | ||
let elem = self.form_name.resolve().await?; |
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.
this kind of code is repeated over and over, wonder whether it could be a utility function.
/// Wait until `save_status` reaches "SAVED". | ||
/// | ||
/// Return an error if it doesn't reach "SAVED" within the given timeout. | ||
pub async fn wait_until_saved(&self, timeout: Duration) -> Result<()> { |
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.
this function is also very similar. perhaps a common trait?
} | ||
return Err(anyhow!("`table` not found in program tables")); | ||
} else { | ||
return Err(anyhow!("`connector_name` not found in inputs")); |
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.
If the error branch is shorter I usually prefer to handle it first and have no 'else'
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 actually like the else
branch, shows that both outcomes are handled with minimal cognitive load. Every time there is no else branch I worry...
I didn't make this up, I follow suggestions from Code Complete (2nd ed, chap 15) which says:
- Write the nominal path through the code first; then write the unusual cases
- Consider the else clause If you think you need a plain if statement, consider
whether you don’t actually need an if-then-else statement. A classic General Motors
analysis found that 50 to 80 percent of if statements should have had an else clause
(Elshoff 1976).
|
||
/// Find the pipeline identified with `name` and press pause. | ||
pub async fn pause(&self, name: &str) -> Result<()> { | ||
let row_idx = self.find_row(name).await?; |
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.
factor out first two lines in a separate function?
} | ||
|
||
impl PipelineDetails { | ||
pub async fn get_records_for_table(&self, table_name: &str) -> Result<usize> { |
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.
what is the result?
No description provided.