Fix part question validation

This commit is contained in:
JennyNou 2026-03-30 20:47:39 -04:00
parent 3fe2e23959
commit eee3ff375d

View file

@ -11,8 +11,10 @@ export default class VehiclePartQuestionsPage extends PartQuestionsPage{
async selectPartQuestionResponses(partQuestions: IPartQuestion[]) {
for (const pq of partQuestions) {
const escaped = pq.optionToSelect.replace(/"/g, '\\"');
const parentobject=this.page.locator(`fieldset[aria-labelledby="${pq.partQuestionType}"]`);
const partQuestionOptionButton = parentobject.locator(`[buttonlabel="${pq.optionToSelect}"]`);
const partQuestionOptionButton = parentobject.locator(`[buttonlabel="${escaped}"]`);
await partQuestionOptionButton.nth(0).click();
if (pq.secondaryQuestionOptionToSelect != null) {
const secondaryQuestionButton = parentobject.getByText(`${pq.secondaryQuestionOptionToSelect}`);