DigitalConsumer.ISS/playwright-tests/pages/VehiclePartsPage.ts
2026-03-25 15:43:57 -04:00

23 lines
No EOL
1,021 B
TypeScript

import { expect, type Locator, type Page } from "@playwright/test";
import { PartQuestionsPage } from "./PartQuestionsPage";
import { IPartQuestion } from '@business-logic/types/CustomerDetails';
export default class VehiclePartQuestionsPage extends PartQuestionsPage{
issPageValue = 'vehicle-parts';
constructor(page: Page) {
super(page);
}
async selectPartQuestionResponses(partQuestions: IPartQuestion[]) {
for (const pq of partQuestions) {
const parentobject=this.page.locator(`fieldset[aria-labelledby="${pq.partQuestionType}"]`);
const partQuestionOptionButton = parentobject.locator(`[buttonlabel="${pq.optionToSelect}"]`);
await partQuestionOptionButton.nth(0).click();
if (pq.secondaryQuestionOptionToSelect != null) {
const secondaryQuestionButton = parentobject.getByText(`${pq.secondaryQuestionOptionToSelect}`);
await secondaryQuestionButton.nth(1).click();
}
}
}
}