Fix part question validation
This commit is contained in:
parent
3fe2e23959
commit
eee3ff375d
1 changed files with 3 additions and 1 deletions
|
|
@ -11,8 +11,10 @@ export default class VehiclePartQuestionsPage extends PartQuestionsPage{
|
||||||
|
|
||||||
async selectPartQuestionResponses(partQuestions: IPartQuestion[]) {
|
async selectPartQuestionResponses(partQuestions: IPartQuestion[]) {
|
||||||
for (const pq of partQuestions) {
|
for (const pq of partQuestions) {
|
||||||
|
const escaped = pq.optionToSelect.replace(/"/g, '\\"');
|
||||||
const parentobject=this.page.locator(`fieldset[aria-labelledby="${pq.partQuestionType}"]`);
|
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();
|
await partQuestionOptionButton.nth(0).click();
|
||||||
if (pq.secondaryQuestionOptionToSelect != null) {
|
if (pq.secondaryQuestionOptionToSelect != null) {
|
||||||
const secondaryQuestionButton = parentobject.getByText(`${pq.secondaryQuestionOptionToSelect}`);
|
const secondaryQuestionButton = parentobject.getByText(`${pq.secondaryQuestionOptionToSelect}`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue