'Check if a transcript related button is visible.
Arguments:
button_name (str): name of button
index (int): query index
button_text (str or None): text to match with text on a button, if None then don\'t match texts
Returns:
bool: is button visible'

def is_transcript_button_visible(self, button_name, index=0, button_text=None):

    is_visible = self.q(css=BUTTON_SELECTORS[button_name]).nth(index).visible
    is_text_matched = True
    if (button_text and (button_text != self.q(css=BUTTON_SELECTORS[button_name]).nth(index).text[0])):
        is_text_matched = False
    return (is_visible and is_text_matched)
