File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,5 +16,18 @@ test.describe('start session', () => {
1616
1717 // Verify the selection was made
1818 await expect ( startSessionPage . selectField ) . toHaveValue ( 'PERSONAL_INFO' ) ;
19+
20+ // Fill the subject first name field
21+ await startSessionPage . fillSessionForm ( 'firstNameTest' , 'lastNameTest' ) ;
22+
23+ // Verify the field was filled
24+ const firstNameField = startSessionPage . sessionForm . locator ( '[name="subjectFirstName"]' ) ;
25+ await expect ( firstNameField ) . toHaveValue ( 'firstNameTest' ) ;
26+
27+ const lastNameField = startSessionPage . sessionForm . locator ( '[name="subjectLastName"]' ) ;
28+ await expect ( lastNameField ) . toHaveValue ( 'lastNameTest' ) ;
29+
30+ const dobField = startSessionPage . sessionForm . locator ( '[name="subjectDateOfBirth"]' ) ;
31+ await expect ( dobField ) . toHaveValue ( '01-01-1990' ) ;
1932 } ) ;
2033} ) ;
Original file line number Diff line number Diff line change @@ -14,8 +14,19 @@ export class StartSessionPage extends AppPage {
1414 this . selectField = page . locator ( '[name="subjectIdentificationMethod"]' ) ;
1515 }
1616
17- async fillSessionForm ( firstName : string ) {
18- await this . sessionForm . getByLabel ( 'subjectId' ) . fill ( firstName ) ;
17+ async fillSessionForm ( firstName : string , lastName : string ) {
18+ // Wait for the subjectFirstName field to appear after selecting PERSONAL_INFO
19+ const firstNameField = this . sessionForm . locator ( '[name="subjectFirstName"]' ) ;
20+ const lastNameField = this . sessionForm . locator ( '[name="subjectLastName"]' ) ;
21+ const dateOfBirthField = this . sessionForm . locator ( '[name="subjectDateOfBirth"]' ) ;
22+ await firstNameField . waitFor ( { state : 'visible' } ) ;
23+ await firstNameField . fill ( firstName ) ;
24+
25+ await lastNameField . waitFor ( { state : 'visible' } ) ;
26+ await lastNameField . fill ( lastName ) ;
27+
28+ await dateOfBirthField . waitFor ( { state : 'visible' } ) ;
29+ await dateOfBirthField . fill ( '01-01-1990' ) ;
1930 }
2031
2132 async selectIdentificationMethod ( methodName : string ) {
You can’t perform that action at this time.
0 commit comments