11import { expect } from '@playwright/test' ;
22import { type Visit } from '@openmrs/esm-framework' ;
3- import { generateRandomPatient , deletePatient , type Patient , startVisit , endVisit } from '../commands' ;
3+ import { generateRandomPatient , deletePatient , startVisit , endVisit } from '../commands' ;
4+ import { type Patient } from '../types' ;
45import { HomePage } from '../pages' ;
56import { test } from '../core' ;
67
@@ -20,10 +21,7 @@ test('Recording vitals tutorial', async ({ page }) => {
2021 } ) ;
2122
2223 await test . step ( 'And I click the `Help` button' , async ( ) => {
23- await page
24- . locator ( '[id="single-spa-application\\:\\@openmrs\\/esm-help-menu-app-page-0"]' )
25- . getByRole ( 'button' )
26- . click ( ) ;
24+ await homePage . helpButton ( ) . click ( ) ;
2725 } ) ;
2826
2927 await test . step ( 'And I click the `Tutorials` button' , async ( ) => {
@@ -97,31 +95,13 @@ test('Recording vitals tutorial', async ({ page }) => {
9795 await expect ( page . getByRole ( 'heading' , { name : / v i t a l s f o r m / i, level : 4 } ) ) . toBeVisible ( ) ;
9896 } ) ;
9997
100- await test . step ( 'When I fill `37` as the temperature ' , async ( ) => {
98+ await test . step ( 'And I fill in the Vitals form ' , async ( ) => {
10199 await page . getByRole ( 'spinbutton' , { name : / t e m p e r a t u r e / i } ) . fill ( '37' ) ;
102- } ) ;
103-
104- await test . step ( 'And I fill `120` as the systolic' , async ( ) => {
105100 await page . getByRole ( 'spinbutton' , { name : / s y s t o l i c / i } ) . fill ( '120' ) ;
106- } ) ;
107-
108- await test . step ( 'And I fill `100` as the diastolic' , async ( ) => {
109101 await page . getByRole ( 'spinbutton' , { name : / d i a s t o l i c / i } ) . fill ( '100' ) ;
110- } ) ;
111-
112- await test . step ( 'And I fill `65` as the pulse' , async ( ) => {
113102 await page . getByRole ( 'spinbutton' , { name : / p u l s e / i } ) . fill ( '65' ) ;
114- } ) ;
115-
116- await test . step ( 'And I fill `16` as the respiration rate' , async ( ) => {
117103 await page . getByRole ( 'spinbutton' , { name : / r e s p i r a t i o n r a t e / i } ) . fill ( '16' ) ;
118- } ) ;
119-
120- await test . step ( 'And I fill `98` as the oxygen saturation' , async ( ) => {
121104 await page . getByRole ( 'spinbutton' , { name : / o x y g e n s a t u r a t i o n / i } ) . fill ( '98' ) ;
122- } ) ;
123-
124- await test . step ( 'And I add additional notes' , async ( ) => {
125105 await page . getByPlaceholder ( / t y p e a n y a d d i t i o n a l n o t e s h e r e / i) . fill ( 'Test notes' ) ;
126106 } ) ;
127107
0 commit comments