From eee3ff375d13718df3cbec96db119dff6c633616 Mon Sep 17 00:00:00 2001 From: JennyNou Date: Mon, 30 Mar 2026 20:47:39 -0400 Subject: [PATCH] Fix part question validation --- playwright-tests/pages/VehiclePartsPage.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playwright-tests/pages/VehiclePartsPage.ts b/playwright-tests/pages/VehiclePartsPage.ts index 70d9a7ee..9a34fd9a 100644 --- a/playwright-tests/pages/VehiclePartsPage.ts +++ b/playwright-tests/pages/VehiclePartsPage.ts @@ -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}`);