@dev-blinq/cucumber_client 1.0.1223-dev → 1.0.1224-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -357,6 +357,7 @@ function generateUniqueCSSSelector(element, options) {
|
|
|
357
357
|
const root = options?.root || window.document;
|
|
358
358
|
const separator = options?.separator || " > ";
|
|
359
359
|
const isUnique = options?.isunique || ((selector) => getMatchingElements(selector, options).length === 1);
|
|
360
|
+
const noCSSId = options?.noCSSId || false;
|
|
360
361
|
|
|
361
362
|
if (!(element instanceof Element)) return null;
|
|
362
363
|
|
|
@@ -364,7 +365,7 @@ function generateUniqueCSSSelector(element, options) {
|
|
|
364
365
|
|
|
365
366
|
let selector = "";
|
|
366
367
|
const id = element.getAttribute("id");
|
|
367
|
-
if (id && !/\d/.test(id)) {
|
|
368
|
+
if (id && !/\d/.test(id) && (!noCSSId)) {
|
|
368
369
|
selector = "#" + cssEscape(id);
|
|
369
370
|
if (isUnique(selector)) return selector;
|
|
370
371
|
}
|