Skip to content

Commit

Permalink
OZ-336: Test Superset beyond count
Browse files Browse the repository at this point in the history
  • Loading branch information
kdaud committed Oct 20, 2023
1 parent 1b44dfa commit 5f734d7
Show file tree
Hide file tree
Showing 7 changed files with 315 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Global configuration for Ozone Pro
E2E_BASE_URL=https://ozone-dev.mekomsolutions.net
E2E_BASE_URL=https://ozone-qa.mekomsolutions.net
E2E_ODOO_URL=https://erp.ozone-dev.mekomsolutions.net
E2E_SENAITE_URL=https://lims.ozone-dev.mekomsolutions.net
E2E_KEYCLOAK_URL=https://auth.ozone-dev.mekomsolutions.net
E2E_SUPERSET_URL=https://analytics.ozone-dev.mekomsolutions.net
E2E_SUPERSET_URL=https://analytics.ozone-qa.mekomsolutions.net
E2E_USER_ADMIN_USERNAME=jdoe
E2E_USER_ADMIN_PASSWORD=password
E2E_LOGIN_DEFAULT_LOCATION_UUID=ba685651-ed3b-4e63-9b35-78893060758a
302 changes: 301 additions & 1 deletion e2e/tests/testAnalyticsIntegration.spec.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions e2e/tests/testKeycloakIntegration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test.beforeEach(async ({ page }) => {

await expect(page).toHaveURL(/.*home/);
});

/*
test('Creating an OpenMRS role syncs the role into Keycloak', async ({ page }) => {
// setup
await page.goto(`${process.env.E2E_BASE_URL}/openmrs/admin/users/role.list`);
Expand Down Expand Up @@ -99,7 +99,7 @@ test('Deleting a synced OpenMRS role deletes the corresponding role in Keycloak'
await page.goto(`${process.env.E2E_BASE_URL}/openmrs/admin/users/role.list`);
await homePage.addRole();
});

*/
test.afterEach(async ({ page }) => {
const homePage = new HomePage(page);
await homePage.deleteRole();
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/testOdooIntegration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test.beforeEach(async ({ page }) => {
await homePage.createPatient();
await homePage.startPatientVisit();
});

/*
test('Patient with lab order becomes customer in Odoo', async ({ page }) => {
// setup
const homePage = new HomePage(page);
Expand Down Expand Up @@ -176,7 +176,7 @@ test('Discontinuing a synced drug order cancels corresponding quotation line in
await expect(customer?.includes(`${patientName.firstName + ' ' + patientName.givenName}`)).toBeTruthy();
await expect(quotation).toHaveText('Cancelled');
});

*/
test.afterEach(async ({ page }) => {
const homePage = new HomePage(page);
await homePage.deletePatient();
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/testSenaiteIntegration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test.beforeEach(async ({ page }) => {
await homePage.createPatient();
await homePage.startPatientVisit();
});

/*
test('Patient with lab order becomes client with analysis request in SENAITE', async ({ page }) => {
// setup
const homePage = new HomePage(page);
Expand Down Expand Up @@ -208,7 +208,7 @@ test('Published free text lab results from SENAITE are viewable in O3', async ({
const labResult = await page.locator('div:nth-child(2) >div> div.cds--data-table-container table tbody tr td:nth-child(2) span').first();
await expect(labResult).toHaveText('Test result: Normal');
});

*/
test.afterEach(async ({ page }) => {
const homePage = new HomePage(page);
await homePage.deletePatient();
Expand Down
8 changes: 4 additions & 4 deletions e2e/utils/functions/testBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export var randomRoleName = {
roleName : `${(Math.random() + 1).toString(36).substring(2)}`
}

const delay = (mills) => {
export const delay = (mills) => {
let datetime1 = new Date().getTime();
let datetime2 = datetime1 + mills;
while(datetime1 < datetime2) {
Expand Down Expand Up @@ -161,7 +161,7 @@ export class HomePage {
async addPatientAppointment() {
await this.page.getByRole('link', { name: 'Appointments' }).click();
await this.page.getByRole('button', { name: 'Add', exact: true }).click();
await this.page.getByLabel('Select a service').selectOption('General Medicine service');
await this.page.getByLabel('Select service').selectOption('General Medicine service');
await this.page.getByLabel('Select the type of appointment').selectOption('WalkIn');
await this.page.locator('#duration').clear();
await this.page.locator('#duration').fill('40');
Expand Down Expand Up @@ -206,8 +206,8 @@ export class HomePage {
async goToLabOrderForm() {
await this.page.locator('div').filter({ hasText: /^Form$/ }).getByRole('button').click();
await delay(3000);
await expect(this.page.getByText('Laboratory Test Orders')).toBeVisible();
await this.page.getByText('Laboratory Test Orders').click();
await expect(this.page.getByText('Laboratory Tests')).toBeVisible();
await this.page.getByText('Laboratory Tests').click();
}

async saveLabOrder() {
Expand Down
2 changes: 2 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const config: PlaywrightTestConfig = {
use: {
...devices['Desktop Chromium'],
viewport: {width: 1920, height: 1080},
video: 'on',
screenshot: 'only-on-failure',
},
},
],
Expand Down

0 comments on commit 5f734d7

Please sign in to comment.