Skip to content

Commit 3ce8965

Browse files
committed
test: add subject DOB test
1 parent 301f790 commit 3ce8965

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

testing/e2e/src/2.3-start-session.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test.describe('start session', () => {
1818
await expect(startSessionPage.selectField).toHaveValue('PERSONAL_INFO');
1919

2020
// Fill the subject first name field
21-
await startSessionPage.fillSessionForm('firstNameTest', 'lastNameTest');
21+
await startSessionPage.fillSessionForm('firstNameTest', 'lastNameTest', 'Male');
2222

2323
// Verify the field was filled
2424
const firstNameField = startSessionPage.sessionForm.locator('[name="subjectFirstName"]');
@@ -29,5 +29,8 @@ test.describe('start session', () => {
2929

3030
const dobField = startSessionPage.sessionForm.locator('[name="subjectDateOfBirth"]');
3131
await expect(dobField).toHaveValue('01-01-1990');
32+
33+
const sexField = startSessionPage.sessionForm.locator('[name="subjectSex"]');
34+
await expect(sexField).toHaveValue('MALE');
3235
});
3336
});

testing/e2e/src/pages/start-session.page.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ export class StartSessionPage extends AppPage {
1414
this.selectField = page.locator('[name="subjectIdentificationMethod"]');
1515
}
1616

17-
async fillSessionForm(firstName: string, lastName: string) {
17+
async fillSessionForm(firstName: string, lastName: string, sex: string) {
1818
// Wait for the subjectFirstName field to appear after selecting PERSONAL_INFO
1919
const firstNameField = this.sessionForm.locator('[name="subjectFirstName"]');
2020
const lastNameField = this.sessionForm.locator('[name="subjectLastName"]');
2121
const dateOfBirthField = this.sessionForm.locator('[name="subjectDateOfBirth"]');
22+
const sexSelector = this.sessionForm.locator('[name="subjectSex"]');
2223
await firstNameField.waitFor({ state: 'visible' });
2324
await firstNameField.fill(firstName);
2425

@@ -27,6 +28,8 @@ export class StartSessionPage extends AppPage {
2728

2829
await dateOfBirthField.waitFor({ state: 'visible' });
2930
await dateOfBirthField.fill('01-01-1990');
31+
32+
await sexSelector.selectOption(sex);
3033
}
3134

3235
async selectIdentificationMethod(methodName: string) {

0 commit comments

Comments
 (0)