Exemplo n.º 1
0
    def test_crawl_test(self):
        """
        Checks all listed Pages for missing localization strings.
        @param self:
        """

        helper_login_admin(self)
        #time.sleep(1)
        pages = ["/microblogging"]
        pages_exclude = ["/terms_of_use", "/data_privacy", "/imprint", "/about"]
        done = [""]
        while pages:
            for page in pages:
                self.driver.get(self.live_server_url + page)
                time.sleep(2)
                self.assertNotIn('_', self.driver.find_element_by_tag_name('body').text, "Localization missing in " + page)
                pages.remove(page)
                done.append(page)
                elem = self.driver.find_element_by_xpath("//*")
                contents = elem.get_attribute("innerHTML")
                dom = lxml.html.fromstring(contents)
                for link in dom.xpath('//a/@href'):
                    if (link != "#") and (link != " ") and not ("http:" in link) and not ("https:" in link) and \
                            not (link in pages) and not (link in done) and not (link in pages_exclude) and \
                            not ("static" in link) and not ("{{" in link):
                        pages.append(link)
Exemplo n.º 2
0
 def test_profile_localizations(self):
     """
     Checks all listed Pages for missing localization strings.
     @param self:
     """
     helper_login_admin(self)
     time.sleep(1)
     self.driver.get(self.live_server_url + '/profile')
     self.assertNotIn('_', self.driver.find_element_by_tag_name('body').text, "Localization on profile not done")
     self.driver.get(self.live_server_url + '/profile/password')
     self.assertNotIn('_', self.driver.find_element_by_tag_name('body').text, "Localization on profile password not done")
Exemplo n.º 3
0
 def test_complete(self):
     helper_login_admin(self)
     self.driver.get(self.live_server_url + '/microblogging')
     self.driver.find_element_by_css_selector(".microblogInput").send_keys(
         "testtweet")
     self.driver.find_element_by_css_selector("input.btn").click()
Exemplo n.º 4
0
 def test_complete(self):
     helper_login_admin(self)
     self.driver.get(self.live_server_url + '/microblogging')
     self.driver.find_element_by_css_selector(".microblogInput").send_keys("testtweet")
     self.driver.find_element_by_css_selector("input.btn").click()