Skip to content

Commit

Permalink
OZ-589: Removed unnecessary authentication when running against local…
Browse files Browse the repository at this point in the history
… instance (#96)
  • Loading branch information
kdaud authored Jun 17, 2024
1 parent f197b8a commit 6ac4603
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ TEST_ENVIRONMENT=dev
# Set to true to test Ozone Pro, false to test Ozone FOSS.
TEST_PRO=true

# Set to true to test on localhost.
TEST_LOCALHOST=false

#
# Ozone HIS URLs for dev, qa and demo environments.
#
Expand Down
18 changes: 3 additions & 15 deletions e2e/utils/functions/openmrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@ export class OpenMRS {
}

async goToHomePage() {
if (`${process.env.TEST_LOCALHOST}` == 'true') {
await this.page.goto(`${O3_URL}/home`);
} else {
await this.page.goto(`${O3_URL}/openmrs/spa/home`);
}
await this.page.goto(`${O3_URL}/openmrs/spa/home`);
await expect(this.page).toHaveURL(/.*home/);
}

Expand Down Expand Up @@ -123,11 +119,7 @@ export class OpenMRS {
}

async getPatientUuid() {
if (`${process.env.TEST_LOCALHOST}` == 'true') {
await this.page.goto(`${O3_URL}/home`);
} else {
await this.page.goto(`${O3_URL}/openmrs/spa/home`);
}
await this.page.goto(`${O3_URL}/openmrs/spa/home`);
await this.patientSearchIcon().click();
await this.patientSearchBar().type(`${patientName.firstName + ' ' + patientName.givenName}`);
await this.page.getByRole('link', { name: `${patientFullName}` }).first().click();
Expand All @@ -154,11 +146,7 @@ export class OpenMRS {
}

async voidPatient() {
if (`${process.env.TEST_LOCALHOST}` == 'true') {
await this.page.goto(`http://localhost/openmrs/admin/patients/index.htm`);
} else {
await this.page.goto(`${O3_URL}/openmrs/admin/patients/index.htm`);
}
await this.page.goto(`${O3_URL}/openmrs/admin/patients/index.htm`);
await this.page.getByPlaceholder(' ').type(`${patientName.firstName + ' ' + patientName.givenName}`);
await this.page.locator('#openmrsSearchTable tbody tr.odd td:nth-child(1)').click();
await this.page.locator('input[name="voidReason"]').fill('Void patient created by smoke test');
Expand Down

0 comments on commit 6ac4603

Please sign in to comment.