'Returns True if the group with supplied group)index is scrolled near the top of the page
(expects 10 px padding).
The group_index must be supplied because JQuery must be used to get this information, and it
does not have access to the bounded selector.'

def scrolled_to_top(self, group_index):

    title_selector = (((("$('" + self.TITLE_SELECTOR) + "')[") + str(group_index)) + ']')
    top_script = (('return    ' + title_selector) + '.getBoundingClientRect().top;')
    EmptyPromise((lambda : (8 < self.browser.execute_script(top_script) < 12)), "Expected    tag    title    '{}'    to    scroll    to    top,    but    was    at    location    {}".format(self.title, self.browser.execute_script(top_script))).fulfill()
    active_script = (('return    ' + title_selector) + '    ===    document.activeElement;')
    return self.browser.execute_script(active_script)
