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}`);