global
def combine_locators(locator, config:)
def combine_locators(locator, config:) [ XPath.attr(:id).equals(locator), XPath.attr(:name).equals(locator), XPath.attr(:value).is(locator), XPath.attr(:title).is(locator), (XPath.attr(:id) == XPath.anywhere(:label)[XPath.string.n.is(locator)].attr(:for)), (XPath.attr(:'aria-label').is(locator) if config.enable_aria_label), (XPath.attr(config.test_id) == locator if config.test_id) ].compact.inject(&:|) end