Skip to content

Commit

Permalink
OZ-517: Fix extra button click to create partitions for SENAITE 2.5.0 (
Browse files Browse the repository at this point in the history
  • Loading branch information
VaishSiddharth authored Nov 20, 2024
1 parent 921dfb7 commit ad19da6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
1 change: 0 additions & 1 deletion e2e/tests/keycloak-superset-flows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ test('Logging out from Superset ends the session in Keycloak and logs out the us

// replay
await superset.logout();
await keycloak.confirmLogout();
await expect(page).toHaveURL(/.*login/);

// verify
Expand Down
12 changes: 6 additions & 6 deletions e2e/tests/openmrs-senaite-flows.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ test('Published coded lab results from SENAITE are viewable in the OpenMRS lab r
// verify
await page.goto(`${O3_URL}`);
await openmrs.viewTestResults();
await expect(page.locator('tbody tr td:nth-child(1) p')).toContainText('Hepatitis C test - qualitative');
await expect(page.locator('tbody tr td:nth-child(2) p')).toContainText('Negative');
await expect(page.locator('tr:nth-child(1) td:nth-child(1) p span span')).toContainText('Hepatitis C test - qualitative');
await expect(page.locator('tr:nth-child(1) td:nth-child(2)')).toContainText('Negative');
});

test('Published numeric lab results from SENAITE are viewable in the OpenMRS lab results viewer.', async ({ page }) => {
Expand All @@ -101,8 +101,8 @@ test('Published numeric lab results from SENAITE are viewable in the OpenMRS lab
// verify
await page.goto(`${O3_URL}`);
await openmrs.viewTestResults();
await expect(page.locator('tbody tr td:nth-child(1) p')).toContainText('Total bilirubin');
await expect(page.locator('tbody tr td:nth-child(2) p')).toContainText('64');
await expect(page.locator('tr:nth-child(1) td:nth-child(1) p span span')).toContainText('Total bilirubin');
await expect(page.locator('tr:nth-child(1) td:nth-child(2)')).toContainText('64');
});

test('Published free text lab results from SENAITE are viewable in the OpenMRS lab results viewer.', async ({ page }) => {
Expand All @@ -119,8 +119,8 @@ test('Published free text lab results from SENAITE are viewable in the OpenMRS l
// verify
await page.goto(`${O3_URL}`);
await openmrs.viewTestResults();
await expect(page.locator('tbody tr td:nth-child(1) p')).toContainText('Stool microscopy with concentration');
await expect(page.locator('tbody tr td:nth-child(2) p')).toContainText('Positive');
await expect(page.locator('tr:nth-child(1) td:nth-child(1) p span span')).toContainText('Stool microscopy with concentration');
await expect(page.locator('tr:nth-child(1) td:nth-child(2)')).toContainText('Positive');
});

test.afterEach(async ({ page }) => {
Expand Down
3 changes: 2 additions & 1 deletion e2e/utils/functions/openmrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ export class OpenMRS {

async viewTestResults() {
await this.searchPatient(`${patientName.firstName + ' ' + patientName.givenName}`);
await this.page.getByRole('link', { name: 'Results Viewer' }).click();
await expect(this.page.getByRole('link', { name: 'Results' })).toBeVisible();
await this.page.getByRole('link', { name: 'Results' }).click();
}

async navigateToDrugOrderForm() {
Expand Down
8 changes: 8 additions & 0 deletions e2e/utils/functions/senaite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export class SENAITE {
await this.page.locator('input[type=checkbox]').first().click();
await expect(this.page.getByRole('button', { name: 'Receive' })).toBeEnabled();
await this.page.locator('#receive_transition span:nth-child(1)').click();
await delay(2000)
await this.page.locator('th.select-column input[type=checkbox]').click();
await this.page.locator('#create_partitions_transition').click();
await this.page.getByRole('button', { name: 'Create Partitions' }).click();
await expect(this.page.locator('#samples td.contentcell.state_title div>span')).toHaveText('Received');
await this.page.locator('table tbody tr:nth-child(1) td.contentcell.getId div span a').click();
Expand All @@ -40,16 +43,21 @@ export class SENAITE {
async publishLabResults() {
await this.page.locator('#ajax_save_selection').click();
await this.page.getByRole('button', { name: 'Submit' }).click();
await delay(5000);
await expect(this.page.locator('input[name="uids\\:list"]').first()).toBeVisible();
await this.page.locator('input[name="uids\\:list"]').first().check();
await this.page.getByRole('button', { name: 'Verify' }).click();
await delay(5000);
await this.page.getByRole('navigation', { name: 'breadcrumb' }).getByRole('link', { name: `${patientName.firstName + ' ' + patientName.givenName}` }).click();
await expect(this.page.locator('#samples td.contentcell.state_title div>span')).toHaveText('Verified');
await this.page.locator('input[name="uids\\:list"]').check();
await expect(this.page.getByRole('button', { name: 'Publish' })).toBeEnabled();
await this.page.locator('#publish_transition span:nth-child(1)').click();
await delay(5000);
await expect(this.page.getByText(/loading preview/i)).not.toBeVisible();
await this.page.getByRole('button', { name: 'Email' }).click();
await delay(5000);
await expect(this.page.getByText(/generating pdf/i)).not.toBeVisible();
await expect(this.page.getByRole('button', { name: 'Send' })).toBeVisible();
await this.page.getByRole('button', { name: 'Send' }).click();
await expect(this.page.locator('table tbody tr.contentrow.state-published.parent td.contentcell.State span span')).toHaveText('Published');
Expand Down

0 comments on commit ad19da6

Please sign in to comment.