def parse_css_or_locator_to_tuple(css_selector_or_locator): if isinstance(css_selector_or_locator, str): return by_css(css_selector_or_locator) if isinstance(css_selector_or_locator, tuple): return css_selector_or_locator raise TypeError("s argument should be string or tuple!")
def css(selector): return bys.by_css(selector)
def test_by_css(): assert by("a") == ('css selector', 'a') assert by_css("span") == ('css selector', 'span')