From 8aa5860d2661d33d3af0e45d83c06f02cb6c0480 Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 5 Oct 2023 20:21:59 -0400 Subject: [PATCH] fix(queries): escape string in "When I find element by title" --- src/queries/title.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/queries/title.ts b/src/queries/title.ts index 546d0fe84..77d87476d 100644 --- a/src/queries/title.ts +++ b/src/queries/title.ts @@ -30,8 +30,8 @@ import { setCypressElement } from '../utils'; */ export function When_I_find_element_by_title(title: string) { const selector = [ - `svg title:contains('${title}')`, - `[title='${title}']`, + `svg title:contains(${JSON.stringify(title)})`, + `[title=${JSON.stringify(title)}]`, ].join(','); setCypressElement(cy.get(selector).first()); }