-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
const { test, expect } = require('@playwright/test'); | ||
|
||
test.describe('ER status', () => { | ||
test.describe.configure({ mode: 'serial' }); | ||
test('Update ER status', async ({ context }) => { | ||
const appPage = await context.newPage(); | ||
await appPage.goto('/'); | ||
await appPage.getByLabel('Email').fill('[email protected]'); | ||
const password = appPage.getByLabel('Password'); | ||
await password.fill('abcd1234'); | ||
await password.press('Enter'); | ||
await expect(appPage).toHaveURL('/er'); | ||
await appPage.getByRole('button', { name: /hospital/i }).click(); | ||
await expect(appPage.getByText(/available beds/i)).toBeVisible(); | ||
await expect(appPage.getByText(/er conditions/i)).toBeVisible(); | ||
await appPage.getByRole('button', { name: /update hospital/i }).click(); | ||
await appPage.getByRole('textbox', { name: /er beds/i }).fill('5'); | ||
await appPage.getByRole('textbox', { name: /behavioral beds/i }).fill('8'); | ||
await appPage.locator('#additionalNotes').fill('scanner broke'); | ||
await appPage.getByRole('button', { name: /confirm/i }).click(); | ||
}); | ||
|
||
test('EMS checks hospital status', async ({ context }) => { | ||
const appPage = await context.newPage(); | ||
await appPage.goto('/'); | ||
await appPage.getByLabel('Email').fill('[email protected]'); | ||
const password = appPage.getByLabel('Password'); | ||
await password.fill('abcd1234'); | ||
await password.press('Enter'); | ||
await expect(appPage).toHaveURL('/ems'); | ||
await appPage.getByRole('button', { name: /hospital info/i }).click(); | ||
// await expect(appPage.locator('.hospitalstatusrow_container') | ||
// .filter({ hasText: /ucsf parnassus/i }) | ||
// .filter({ has: appPage.locator('.hospitalstatusrow__notes').filter({ hasText: 'scanner fixed' })})).toBeVisible(); | ||
const row = appPage.locator('.hospitalstatusrow_container').filter({ hasText: /ucsf parnassus/i }); | ||
|
||
// await expect(row.locator('.hospitalstatusrow__data', { hasText: '5' })).toBeVisible(); | ||
// await expect(row.locator('.hospitalstatusrow__data', { hasText: '8' })).toBeVisible(); | ||
await expect(row.locator('.hospitalstatusrow__notes').filter({ hasText: 'scanner broke' })).toBeVisible(); | ||
await context.close(); | ||
}); | ||
|
||
test('Update ER status reset', async ({ context }) => { | ||
const appPage = await context.newPage(); | ||
await appPage.goto('/'); | ||
await appPage.getByLabel('Email').fill('[email protected]'); | ||
const password = appPage.getByLabel('Password'); | ||
await password.fill('abcd1234'); | ||
await password.press('Enter'); | ||
await expect(appPage).toHaveURL('/er'); | ||
await appPage.getByRole('button', { name: /hospital/i }).click(); | ||
await expect(appPage.getByText(/available beds/i)).toBeVisible(); | ||
await expect(appPage.getByText(/er conditions/i)).toBeVisible(); | ||
await appPage.getByRole('button', { name: /update hospital/i }).click(); | ||
await appPage.getByRole('textbox', { name: /er beds/i }).fill('0'); | ||
await appPage.getByRole('textbox', { name: /behavioral beds/i }).fill('0'); | ||
await appPage.locator('#additionalNotes').fill(''); | ||
await appPage.getByRole('button', { name: /confirm/i }).click(); | ||
}); | ||
|
||
test('EMS checks hospital status after reset', async ({ context }) => { | ||
const appPage = await context.newPage(); | ||
await appPage.goto('/'); | ||
await appPage.getByLabel('Email').fill('[email protected]'); | ||
const password = appPage.getByLabel('Password'); | ||
await password.fill('abcd1234'); | ||
await password.press('Enter'); | ||
await expect(appPage).toHaveURL('/ems'); | ||
await appPage.getByRole('button', { name: /hospital info/i }).click(); | ||
const row = appPage.locator('.hospitalstatusrow_container', { hasText: /ucsf parnassus/i }); | ||
// console.log("ROW: ", row) | ||
await expect(row.locator('.hospitalstatusrow__data', { hasText: '5' })).not.toBeVisible(); | ||
await expect(row.locator('.hospitalstatusrow__data', { hasText: '8' })).not.toBeVisible(); | ||
await expect(row.locator('.hospitalstatusrow__notes', { hasText: 'scanner broke' })).not.toBeVisible(); | ||
await context.close(); | ||
}); | ||
}); |