<commit_before>result = None
href = None


def init_results(driver):
    global result
    driver.wait_for_load()
    result = driver.find_element('css selector', 'a.article')
    return result


def assert_link_unchanged():
    global result, href
    assert result.get_attribute('href') == href


def assert_no_intermediate_urls(driver, method, target):
    driver.get_urls()
    method()
    urls = []

    def check_urls():
        urls.extend(driver.get_urls())
        return urls
    driver.wait_until(check_urls)
    assert urls[0] == target


def run(driver):
    global href

    # Open Google news
    driver.navigate('https://news.google.com/?hl=en')<commit_msg>Updated tests to Google News markup change<commit_after>result = None
href = None


def init_results(driver):
    global result
    driver.wait_for_load()
    result = driver.find_element('css selector', 'a[role=heading]')
    return result


def assert_link_unchanged():
    global result, href
    assert result.get_attribute('href') == href


def assert_no_intermediate_urls(driver, method, target):
    driver.get_urls()
    method()
    urls = []

    def check_urls():
        urls.extend(driver.get_urls())
        return urls
    driver.wait_until(check_urls)
    assert urls[0] == target


def run(driver):
    global href

    # Open Google news
    driver.navigate('https://news.google.com/?hl=en')
{'fraction_non_alphanumeric': 0.11424439624005785, 'fraction_numerical': 0.0014461315979754157, 'mean_word_length': 3.4076433121019107, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6397652', 'n_tokens_mistral': 441, 'n_tokens_neox': 435, 'n_words': 99}