<commit_before>(Selenium) Page Objects in Python
=================================

Page Objects 101
----------------
'Page Objects' is a pattern for creating Selenium scripts that makes heavy use of OO principles to enable code reuse and improve maintenance. Rather than having test methods that are a series of Se commands that are sent to the server, your scripts become a series of interactions with objects that represent a page (or part of one) -- thus the name.  

Without Page Objects
    class LoginExample(unittest.TestCase):
        def incorrect_login(self):
            self.selenium.open('/')
            self.selenium.click('css=div.account_mast a:first')
            self.selenium.waitForPageToLoad("30000")
            self.selenium.type('username', 'monkey')
            self.selenium.type('password', '<PASSWORD>')
            self.selenium.click('submit')
            self.selenium.wait_for_page_to_Load("30000")
            self.assertEqual(self.selenium.get_ext("css=div.error > p"), "Incorrect username or password.")

With Page Objects
    class LoginExample(CustomTestCase.CustomTestCase):
        @attr(tags=['deep', 'website', 'login'])
        def incorrect_login(self):
            h = HomePage()
            h.open_default_url()
            l = h.go_to_login_page()
            l.username = "foo"
            l.password = "<PASSWORD>"
            l.do_login()
            self.assertEqual(l.error_message, "Incorrect username or password.")
<commit_msg>and now fixing some api methods that dont actually exist in python -- but do in php<commit_after>(Selenium) Page Objects in Python
=================================

Page Objects 101
----------------
'Page Objects' is a pattern for creating Selenium scripts that makes heavy use of OO principles to enable code reuse and improve maintenance. Rather than having test methods that are a series of Se commands that are sent to the server, your scripts become a series of interactions with objects that represent a page (or part of one) -- thus the name.  

Without Page Objects
    class LoginExample(unittest.TestCase):
        def incorrect_login(self):
            self.selenium.open('/')
            self.selenium.click('css=div.account_mast a:first')
            self.selenium.wait_for_page_to_load("30000")
            self.selenium.type('username', 'monkey')
            self.selenium.type('password', '<PASSWORD>')
            self.selenium.click('submit')
            self.selenium.wait_for_page_to_load("30000")
            self.assertEqual(self.selenium.get_text("css=div.error > p"), "Incorrect username or password.")

With Page Objects
    class LoginExample(CustomTestCase.CustomTestCase):
        @attr(tags=['deep', 'website', 'login'])
        def incorrect_login(self):
            h = HomePage()
            h.open_default_url()
            l = h.go_to_login_page()
            l.username = "foo"
            l.password = "<PASSWORD>"
            l.do_login()
            self.assertEqual(l.error_message, "Incorrect username or password.")

{'fraction_non_alphanumeric': 0.1269319302860901, 'fraction_numerical': 0.008549819138441302, 'mean_word_length': 2.77888198757764, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '2157937', 'n_tokens_mistral': 840, 'n_tokens_neox': 784, 'n_words': 249}