diff --git a/manifest.json b/manifest.json index 52aad9ce..27866250 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "JDN — Page Object Generator", "description": "JDN – helps Test Automation Engineer to create Page Objects in the test automation framework and speed up test development", "devtools_page": "index.html", - "version": "3.15.29", + "version": "3.15.30", "icons": { "128": "icon128.png" }, diff --git a/package-lock.json b/package-lock.json index b9f94015..c2885c06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "jdn-ai-chrome-extension", - "version": "3.15.29", + "version": "3.15.30", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 53a75f26..c8155c0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jdn-ai-chrome-extension", - "version": "3.15.29", + "version": "3.15.30", "description": "jdn-ai chrome extension", "scripts": { "start": "webpack --watch --env devenv", diff --git a/src/features/locators/utils/escapeLocatorString.ts b/src/features/locators/utils/escapeLocatorString.ts index 5fe3356f..a58e156e 100644 --- a/src/features/locators/utils/escapeLocatorString.ts +++ b/src/features/locators/utils/escapeLocatorString.ts @@ -7,6 +7,7 @@ export const fullEscapeLocatorString = (str: string = ''): string => { .replaceAll(/\\/g, '\\\\') // escape backslash .replaceAll(/\"/g, '\\"') // escape double quotes .replaceAll(/\'/g, "\\'") // escape single quotes + .replaceAll(/\b/g, '\\b') // escape backspaces .replaceAll(/\t/g, '\\t') // escape tabs .replaceAll(/\n/g, '\\n') // escape newlines .replaceAll(/\r/g, '\\r') // escape carriage returns diff --git a/src/features/pageObjects/utils/pageObjectTemplate.ts b/src/features/pageObjects/utils/pageObjectTemplate.ts index 60436f77..a5a2542c 100644 --- a/src/features/pageObjects/utils/pageObjectTemplate.ts +++ b/src/features/pageObjects/utils/pageObjectTemplate.ts @@ -49,13 +49,13 @@ export const getPageObjectTemplateForJdi = ( const { name: className, library } = pageObject; const locatorsCode = locators.map((locator) => { - const locatorEscaped = locator.locatorValue.output?.replace(/\\/g, '\\\\').replace(/"/g, '\\"'); + const locatorOutput = locator.locatorValue.output; const { locatorType } = pageObject; const currentLocatorType = locator.locatorType || locatorType || LocatorType.xPath; return ` ${locator.annotationType}(${getLocatorPrefix( locator.annotationType, currentLocatorType, - )}"${locatorEscaped}")\n public ${locator.type} ${locator.name};`; + )}"${locatorOutput}")\n public ${locator.type} ${locator.name};`; }); const hasFindByAnnotationType: boolean = hasAnnotationType(locators, AnnotationType.FindBy);