Esempio n. 1
0
    def testDriver(self):
        """
        https://github.com/perfidia/selearea/issues/1
        """
        selearea.get_ast(self.getUrl("simple.html"), driver = self.driver)

        self.assertEqual(len(self.driver.find_elements_by_id("a")), 1)
Esempio n. 2
0
    def testDriver(self):
        """
        https://github.com/perfidia/selearea/issues/1
        """
        selearea.get_ast(self.getUrl("simple.html"), driver=self.driver)

        self.assertEqual(len(self.driver.find_elements_by_id("a")), 1)
Esempio n. 3
0
    def get_fce_pages(self):
        urls = {
            "http://www.bis.put.poznan.pl/",
            "http://www.bis.put.poznan.pl/evPages/show/id/182"
        }

        return [get_ast(url) for url in urls]
Esempio n. 4
0
    def get_fc_pages(self):
        urls = {
            "http://fc.put.poznan.pl",
            "http://fc.put.poznan.pl/rekrutacja/post-powanie-kwalifikacyjne%2C29.html",
            "http://fc.put.poznan.pl/o-wydziale/witamy%2C39.html"
        }

        return [get_ast(url) for url in urls]
Esempio n. 5
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))
Esempio n. 6
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))
Esempio 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()
Esempio n. 8
0
 def test_get_none_page(self):
     with self.assertRaises(ValueError):
         get_ast(None)
Esempio n. 9
0
    def test_get_wrong_page(self):
        url = "putpoznan.pl"

        with self.assertRaises(ValueError):
            get_ast(url)
Esempio n. 10
0
    def get_identical_pages(self):
        urls = {
            "http://www.bis.put.poznan.pl/", "http://www.bis.put.poznan.pl/"
        }

        return [get_ast(url) for url in urls]
Esempio n. 11
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()