-
Notifications
You must be signed in to change notification settings - Fork 1
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
OZ-336: Added E2E tests beyond data count in Superset tables #40
Conversation
eff286c
to
3946e9a
Compare
@Ruhanga, this PR is ready for review. |
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'd leave the file name as is testAnalyticsIntegration.spec.ts
since this is basically an analytics integration and superset is simply a way to visualise the data. A few other comments to address.
|
||
await page.getByRole('tab', { name: 'Query history' }).click(); | ||
await homePage.clearSQLEditor(); | ||
let sqlQuerry2 = `SELECT * FROM patients WHERE given_name like '${patientName.firstName}' AND family_name like '${patientName.givenName}';`; |
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'd name this variable sqlQuery
or explicitly patientQuery
|
||
await page.getByRole('tab', { name: 'Query history' }).click(); | ||
await homePage.clearSQLEditor(); | ||
let sqlQuery2 = `SELECT patient_id FROM patients WHERE given_name like '${patientName.firstName}' AND family_name like '${patientName.givenName}';`; |
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.
Same here..
|
||
await page.getByRole('tab', { name: 'Query history' }).click(); | ||
await homePage.clearSQLEditor(); | ||
let sqlQuery2 = `SELECT patient_id FROM patients WHERE given_name like '${patientName.firstName}' AND family_name like '${patientName.givenName}';`; |
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.
Same here, or more explicitly patientIdQuery
.
const patientIdValue = Number(patientId); | ||
await page.getByRole('tab', { name: 'Results' }).click(); | ||
await homePage.clearSQLEditor(); | ||
let sqlQuery3 = `SELECT * FROM _orders WHERE patient_id=${patientIdValue};`; |
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'd rename this to orderQuery
.
const updatedNumberOfPatients = await page.getByRole('gridcell', { name: ' ' }).nth(0).textContent(); | ||
let updatedPatientCount = Number(updatedNumberOfPatients); | ||
|
||
await expect(updatedPatientCount).toBeGreaterThan(initialPatientCount); |
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.
For patient you should actually check that it's a +1.
@Ruhanga I've adapted the Superset tests to retrieve test patient from patients table using OpenMRS ID. |
await page.getByRole('textbox').first().clear(); | ||
await page.getByRole('textbox').fill('SELECT COUNT (*) FROM visits;'); | ||
await homePage.clearSQLEditor(); | ||
let visitCountsQuery = `SELECT COUNT (*) FROM visits;` |
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.
visitCountsQuery
➙ visitsCountQuery
const patientIdValue = Number(patientId); | ||
await page.getByRole('tab', { name: 'Results' }).click(); | ||
await homePage.clearSQLEditor(); | ||
let visitQuery = `SELECT * FROM visits WHERE patient_id=${patientIdValue};`; |
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.
visitQuery
➙ patientVisitQuery
await page.getByRole('textbox').first().clear(); | ||
await page.getByRole('textbox').fill('SELECT COUNT(*) FROM _orders;'); | ||
await homePage.clearSQLEditor(); | ||
let orderCountsQuery = `SELECT COUNT(*) FROM _orders;` |
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.
orderCountsQuery
➙ ordersCountQuery
await page.getByRole('textbox').first().clear(); | ||
await page.getByRole('textbox').fill('SELECT COUNT(*) FROM encounters;'); | ||
await homePage.clearSQLEditor(); | ||
let encounterCountsQuery = `SELECT COUNT(*) FROM encounters;` |
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.
encounterCountsQuery
➙ encountersCountQuery
await page.getByRole('textbox').first().clear(); | ||
await page.getByRole('textbox').fill('SELECT COUNT (*) FROM _conditions;'); | ||
await homePage.clearSQLEditor(); | ||
let conditionCountsQuery = `SELECT COUNT (*) FROM _conditions;` |
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.
conditionCountsQuery
➙ conditionsCountQuery
Ticket → OZ-336
Description → This PR adds E2E tests beyond data count in Superset tables verifying that;