Skip to content

Commit

Permalink
Fix login error
Browse files Browse the repository at this point in the history
  • Loading branch information
kdaud committed Jan 8, 2025
1 parent 4d423e6 commit 39b0b08
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions e2e/utils/functions/openmrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class OpenMRS {
await this.page.locator('#username').fill(`${process.env.OZONE_USERNAME}`);
await this.page.getByRole('button', { name: /continue/i }).click();
await this.page.locator('#password').fill(`${process.env.OZONE_PASSWORD}`);
await this.page.getByRole('button', { name: /sign in/ }).click();
await this.page.getByRole('button', { name: /sign in/i }).click();
}

async createPatient() {
Expand All @@ -68,10 +68,8 @@ export class OpenMRS {
await this.page.locator('div[aria-label="day, "]').fill('16');
await this.page.locator('div[aria-label="month, "]').fill('08');
await this.page.locator('div[aria-label="year, "]').fill('2002');
await this.page.getByRole('button', { name: /register patient/i }).click();
await this.createPatientButton().click();
await expect(this.page.getByText(/new patient created/i)).toBeVisible(), delay(3000);;
await this.page.getByRole('button', { name: 'Close', exact: true }).click();
}

async goToHomePage() {
Expand Down Expand Up @@ -202,8 +200,8 @@ export class OpenMRS {

async navigateToLabOrderForm() {
await this.page.getByLabel(/order basket/i).click(), delay(2000);
await expect(this.page.getByRole('button', { name: /add/i, exact: true }).nth(1)).toBeVisible();
await this.page.getByRole('button', { name: /add/i, exact: true }).nth(1).click();
await expect(this.page.getByRole('button', { name: 'Add', exact: true }).nth(1)).toBeVisible();
await this.page.getByRole('button', { name: 'Add', exact: true }).nth(1).click();
}

async saveLabOrder() {
Expand Down Expand Up @@ -248,8 +246,8 @@ export class OpenMRS {
async navigateToDrugOrderForm() {
await expect(this.page.getByLabel(/order basket/i)).toBeVisible();
await this.page.getByLabel(/order basket/i).click(), delay(2000);
await expect(this.page.getByRole('button', { name: /add/i, exact: true }).nth(0)).toBeVisible();
await this.page.getByRole('button', { name: /add/i, exact: true }).nth(0).click();
await expect(this.page.getByRole('button', { name: 'Add', exact: true }).nth(0)).toBeVisible();
await this.page.getByRole('button', { name: 'Add', exact: true }).nth(0).click();
}

async fillDrugOrderForm() {
Expand Down Expand Up @@ -278,7 +276,7 @@ export class OpenMRS {
async createDrugOrderWithFreeTextDosage() {
await expect(this.page.getByLabel(/order basket/i)).toBeVisible();
await this.page.getByLabel(/order basket/i).click(), delay(2000);
await expect(this.page.getByRole('button', { name: /add/i, exact: true }).nth(0)).toBeVisible();
await expect(this.page.getByRole('button', { name: 'Add', exact: true }).nth(0)).toBeVisible();
await this.page.getByRole('button', { name: 'Add', exact: true }).nth(0).click();
await this.page.getByRole('searchbox').fill('Aspirin 325mg');
await this.page.getByRole('button', { name: 'Order form' }).click();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"!playwright-report/"
],
"scripts": {
"ozone-pro": "npx playwright test",
"ozone-pro": "npx playwright test odoo-openmrs",
"ozone-foss": "npx playwright test odoo-openmrs erpnext-openmrs openmrs-senaite",
"openmrs-distro-his": "npx playwright test odoo-openmrs openmrs-senaite"
},
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dotenv.config();

const config: PlaywrightTestConfig = {
testDir: './e2e/tests',
timeout: 10 * 60 * 1000,
timeout: 3 * 60 * 1000,
expect: {
timeout: 40 * 1000,
},
Expand Down

0 comments on commit 39b0b08

Please sign in to comment.