Exemplo n.º 1
0
 def test_get_workarea_fc_content(self):
     asts = self.get_fc_pages()
     workareas = get_workareas(asts)
     xpath = str(
         "//html[@class='js']/body/div[@id='right']/div[@id='content']")
     self.assertEqual(xpath, workareas[0],
                      "AssertionFailed: xpaths for fc pages.")
Exemplo n.º 2
0
 def test_get_workarea_fce_content(self):
     asts = self.get_fce_pages()
     workareas = get_workareas(asts)
     xpath = str(
         "//html/body/div[@id='main']/div/div[@id='left_menu']/div[@id='left_menu_box']"
     )
     self.assertEqual(xpath, workareas[1],
                      "AssertionFailed: xpaths for fc pages.")
Exemplo n.º 3
0
    def testCheckCorrectnessOfXPaths(self):
        """
        https://github.com/perfidia/selearea/issues/3
        """
        urls = [
                "http://www.bis.put.poznan.pl/",
                "http://www.bis.put.poznan.pl/evPages/show/id/182"
        ]

        asts = []

        for url in urls:
            asts.append(selearea.get_ast(url, driver = self.driver))

        xpaths = selearea.get_workareas(asts)

        self.driver.get(urls[0])

        for xpath in xpaths:
            self.assertIsNotNone(self.driver.find_element_by_xpath(xpath))
Exemplo n.º 4
0
    def testCheckCorrectnessOfXPaths(self):
        """
        https://github.com/perfidia/selearea/issues/3
        """
        urls = [
            "http://www.bis.put.poznan.pl/",
            "http://www.bis.put.poznan.pl/evPages/show/id/182"
        ]

        asts = []

        for url in urls:
            asts.append(selearea.get_ast(url, driver=self.driver))

        xpaths = selearea.get_workareas(asts)

        self.driver.get(urls[0])

        for xpath in xpaths:
            self.assertIsNotNone(self.driver.find_element_by_xpath(xpath))
Exemplo n.º 5
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from selenium import webdriver
from selearea import get_ast, get_workareas

if __name__ == "__main__":
    urls = [
            "http://www.bis.put.poznan.pl/",
            "http://www.bis.put.poznan.pl/evPages/show/id/182"
    ]

    driver = webdriver.Firefox()

    asts = [get_ast(url, driver) for url in urls]

    for workarea in get_workareas(asts):
        print workarea

    driver.close()
Exemplo n.º 6
0
 def test_get_workarea_identical_pages(self):
     asts = self.get_identical_pages()
     workareas = get_workareas(asts)
     self.assertEqual(
         0, len(workareas),
         "AssertionFailed: work area found on identical pages.")
Exemplo n.º 7
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from selenium import webdriver
from selearea import get_ast, get_workareas

if __name__ == "__main__":
    urls = [
        "http://www.bis.put.poznan.pl/",
        "http://www.bis.put.poznan.pl/evPages/show/id/182"
    ]

    driver = webdriver.Firefox()

    asts = [get_ast(url, driver) for url in urls]

    for workarea in get_workareas(asts):
        print workarea

    driver.close()