lib/runner.js
function buildElementIdentifier(element) {
			if (element.id) {
				return `#${element.id}`;
			}
			let identifier = element.tagName.toLowerCase();
			if (!element.parentNode) {
				return identifier;
			}
			const siblings = getSiblings(element);
			const childIndex = siblings.indexOf(element);
			if (!isOnlySiblingOfType(element, siblings) && childIndex !== -1) {
				identifier += `:nth-child(${childIndex + 1})`;
			}
			return identifier;
		}
function buildElementIdentifier(element) {
			if (element.id) {
				return `#${element.id}`;
			}
			let identifier = element.tagName.toLowerCase();
			if (!element.parentNode) {
				return identifier;
			}
			const siblings = getSiblings(element);
			const childIndex = siblings.indexOf(element);
			if (!isOnlySiblingOfType(element, siblings) && childIndex !== -1) {
				identifier += `:nth-child(${childIndex + 1})`;
			}
			return identifier;
		}
function buildElementIdentifier ( element ) { if ( element . id ) { return ` ${ element . id } ` ; } let identifier = element . tagName . toLowerCase ( ) ; if ( ! element . parentNode ) { return identifier ; } const siblings = getSiblings ( element ) ; const childIndex = siblings . indexOf ( element ) ; if ( ! isOnlySiblingOfType ( element , siblings ) && childIndex !== - 1 ) { identifier += ` ${ childIndex + 1 } ` ; } return identifier ; }
Build a unique CSS element identifier.
@private
@param {HTMLElement} element - An element to get a CSS element identifier for.
@returns {String} Returns the CSS element identifier as a string.
Build a unique CSS element identifier .