def get_element_index_by_text(elements, text: str, complete_match=True):
    """
    Loops through the list of elements, checks if the text is equal or in
    text and returns the index of it if so
    """
    for i in range(0, len(elements)):
        if complete_match:
            if elements[i].text == text:
                return i
        else:
            if text in elements[i].text:
                return i
    return -1