lib/runner.js
function getCssSelectorForElement(element, selectorParts = []) {
			if (isElementNode(element)) {
				const identifier = buildElementIdentifier(element);
				selectorParts.unshift(identifier);
				if (!element.id && element.parentNode) {
					return getCssSelectorForElement(element.parentNode, selectorParts);
				}
			}
			return selectorParts.join(' > ');
		}
function getCssSelectorForElement(element, selectorParts = []) {
			if (isElementNode(element)) {
				const identifier = buildElementIdentifier(element);
				selectorParts.unshift(identifier);
				if (!element.id && element.parentNode) {
					return getCssSelectorForElement(element.parentNode, selectorParts);
				}
			}
			return selectorParts.join(' > ');
		}
function getCssSelectorForElement ( element , selectorParts = [ ] ) { if ( isElementNode ( element ) ) { const identifier = buildElementIdentifier ( element ) ; selectorParts . unshift ( identifier ) ; if ( ! element . id && element . parentNode ) { return getCssSelectorForElement ( element . parentNode , selectorParts ) ; } } return selectorParts . join ( ' > ' ) ; }
Get a CSS selector for an element.
@private
@param {HTMLElement} element - An element to get a selector for.
@param {Array} [selectorParts=[]] - Internal parameter used for recursion.
@returns {String} Returns the CSS selector as a string.
Get a CSS selector for an element .