Skip to content

Commit

Permalink
OZ-336: Test Superset data beyond counts
Browse files Browse the repository at this point in the history
  • Loading branch information
kdaud committed Sep 21, 2023
1 parent dfee40d commit b71d346
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 2 deletions.
76 changes: 74 additions & 2 deletions e2e/tests/testAnalyticsIntegration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ test('Starting an OpenMRS visit increases visits count in Superset', async ({ pa
await expect(updatedCount).toBeGreaterThan(initialCount);
});

test('Starting an OpenMRS visit adds the visit to the visits table in Superset', async ({ page }) => {
// setup
const homePage = new HomePage(page);
await homePage.goToSuperset();
await expect(page).toHaveURL(/.*superset/);
await homePage.selectDBSchema();
await page.getByRole('textbox').first().clear();
await page.getByRole('textbox').fill('SELECT COUNT * FROM visits;');

});

test('Creating an OpenMRS order increases orders count in Superset', async ({ page }) => {
// setup
const homePage = new HomePage(page);
Expand Down Expand Up @@ -74,6 +85,18 @@ test('Creating an OpenMRS order increases orders count in Superset', async ({ pa
await expect(updatedCount).toBeGreaterThan(initialCount);
});

test('Creating an OpenMRS order adds the order to the orders table in Superset', async ({ page }) => {
// setup
const homePage = new HomePage(page);
await homePage.startPatientVisit();
await homePage.goToSuperset();
await expect(page).toHaveURL(/.*superset/);
await homePage.selectDBSchema();
await page.getByRole('textbox').first().clear();
await page.getByRole('textbox').fill('SELECT * FROM _orders;');

});

test('Creating an OpenMRS order increases encounters count in Superset', async ({ page }) => {
// setup
const homePage = new HomePage(page);
Expand Down Expand Up @@ -107,6 +130,18 @@ test('Creating an OpenMRS order increases encounters count in Superset', async (
await expect(updatedCount).toBeGreaterThan(initialCount);
});

test('Creating an OpenMRS order adds the encounter to the encounters table in Superset', async ({ page }) => {
// setup
const homePage = new HomePage(page);
await homePage.startPatientVisit();
await homePage.goToSuperset();
await expect(page).toHaveURL(/.*superset/);
await homePage.selectDBSchema();
await page.getByRole('textbox').first().clear();
await page.getByRole('textbox').fill('SELECT * FROM encounters;');

});

test('Adding an OpenMRS patient condition increases conditions count in Superset', async ({ page }) => {
// setup
const homePage = new HomePage(page);
Expand Down Expand Up @@ -137,7 +172,19 @@ test('Adding an OpenMRS patient condition increases conditions count in Superset
await expect(updatedCount).toBeGreaterThan(initialCount);
});

test('Adding OpenMRS patient biometrics increases observations count in Superset', async ({ page }) => {
test('Adding an OpenMRS patient condition adds the condition to the conditions table in Superset', async ({ page }) => {
// setup
const homePage = new HomePage(page);
await homePage.startPatientVisit();
await homePage.goToSuperset();
await expect(page).toHaveURL(/.*superset/);
await homePage.selectDBSchema();
await page.getByRole('textbox').first().clear();
await page.getByRole('textbox').fill('SELECT COUNT * FROM _conditions;');

});

test('Adding an OpenMRS patient biometrics increases observations count in Superset', async ({ page }) => {
// setup
const homePage = new HomePage(page);
await homePage.startPatientVisit();
Expand Down Expand Up @@ -167,7 +214,20 @@ test('Adding OpenMRS patient biometrics increases observations count in Superset
await expect(updatedCount).toBeGreaterThan(initialCount);
});

test('Adding OpenMRS patient appointment increases appointments count in Superset', async ({ page }) => {

test('Adding an OpenMRS patient biometrics adds the observation to the observations table in Superset', async ({ page }) => {
// setup
const homePage = new HomePage(page);
await homePage.startPatientVisit();
await homePage.goToSuperset();
await expect(page).toHaveURL(/.*superset/);
await homePage.selectDBSchema();
await page.getByRole('textbox').first().clear();
await page.getByRole('textbox').fill('SELECT COUNT * FROM observations;');

});

test('Adding an OpenMRS patient appointment increases appointments count in Superset', async ({ page }) => {
// setup
const homePage = new HomePage(page);
await homePage.startPatientVisit();
Expand Down Expand Up @@ -199,6 +259,18 @@ test('Adding OpenMRS patient appointment increases appointments count in Superse
await expect(updatedCount).toBeGreaterThan(initialCount);
});

test('Adding an OpenMRS patient appointment adds the appointment to the appointments table in Superset', async ({ page }) => {
// setup
const homePage = new HomePage(page);
await homePage.startPatientVisit();
await homePage.goToSuperset();
await expect(page).toHaveURL(/.*superset/);
await homePage.selectDBSchema();
await page.getByRole('textbox').first().clear();
await page.getByRole('textbox').fill('SELECT * FROM appointments;');

});

test.afterEach(async ({ page }) => {
const homePage = new HomePage(page);
await homePage.deletePatient();
Expand Down
1 change: 1 addition & 0 deletions e2e/utils/functions/testBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class HomePage {
await this.page.locator('form').getByRole('button', { name: 'Start a visit' }).click();

await expect(this.page.getByText('Facility Visit started successfully')).toBeVisible();
await delay(4000);
}

async endPatientVisit() {
Expand Down

0 comments on commit b71d346

Please sign in to comment.