<commit_before># -*- coding: utf-8 -*-
"""
Implementation of http://elementalselenium.com/tips/3-work-with-frames
"""

import unittest
from selenium import webdriver


class Frames(unittest.TestCase):

    def setUp(self):
        self.driver = webdriver.Firefox()

    def tearDown(self):
        self.driver.quit()

    def test_example_1(self):
        driver = self.driver
        driver.get('http://the-internet.herokuapp.com/nested_frames')
        driver.switch_to.frame('frame-top')
        driver.switch_to.frame('frame-middle')
        assert driver.find_element_by_id('content').text == "MIDDLE", "content should be MIDDLE"

    def test_example_2(self):
        driver = self.driver
        driver.get('http://the-internet.herokuapp.com/tinymce')
        driver.switch_to.frame('mce_0_ifr')
        editor = driver.find_element_by_id('tinymce')
        before_text = editor.text
        editor.clear()
        editor.send_keys('<NAME>!')
        after_text = editor.text
        assert after_text != before_text, "%s equals %s" % (before_text, after_text)

        driver.switch_to.default_content()
        assert driver.find_element_by_css_selector('h3').text != "", "h3 elemet should not be empty"

if __name__ == "__main__":
    unittest.main()<commit_msg>Fixed a typo in an assertion message<commit_after># -*- coding: utf-8 -*-
"""
Implementation of http://elementalselenium.com/tips/3-work-with-frames
"""

import unittest
from selenium import webdriver


class Frames(unittest.TestCase):

    def setUp(self):
        self.driver = webdriver.Firefox()

    def tearDown(self):
        self.driver.quit()

    def test_example_1(self):
        driver = self.driver
        driver.get('http://the-internet.herokuapp.com/nested_frames')
        driver.switch_to.frame('frame-top')
        driver.switch_to.frame('frame-middle')
        assert driver.find_element_by_id('content').text == "MIDDLE", "content should be MIDDLE"

    def test_example_2(self):
        driver = self.driver
        driver.get('http://the-internet.herokuapp.com/tinymce')
        driver.switch_to.frame('mce_0_ifr')
        editor = driver.find_element_by_id('tinymce')
        before_text = editor.text
        editor.clear()
        editor.send_keys('Hello World!')
        after_text = editor.text
        assert after_text != before_text, "%s equals %s" % (before_text, after_text)

        driver.switch_to.default_content()
        assert driver.find_element_by_css_selector('h3').text != "", "h3 element should not be empty"

if __name__ == "__main__":
    unittest.main()
{'fraction_non_alphanumeric': 0.13136416634279052, 'fraction_numerical': 0.005441119315973571, 'mean_word_length': 3.0727848101265822, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, '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': '5307234', 'n_tokens_mistral': 834, 'n_tokens_neox': 812, 'n_words': 146}