Ejemplo n.º 1
0
class AkvoWebTestCase(SeleniumTestCase):
    def setUp(self):
        SeleniumTestCase.setUp(self)
        self.navigator = SeleniumNavigator(self.selenium)
        self.site_navigator = AkvoSiteNavigator(self.selenium)

    def open_home_page(self):
        self.site_navigator.open_home_page()
        self.assert_title_is("Akvo.org - See it happen")

    def open_projects_page(self):
        self.site_navigator.open_projects_page()
        self.verify_location_and_page_title(all_projects_page(),
                                            "Akvo.org - All projects")

    def open_all_projects_page(self):
        self.site_navigator.open_all_projects_page()
        self.verify_location_and_page_title(all_projects_page(),
                                            "Akvo.org - All projects")

    def open_focus_areas_page(self):
        self.site_navigator.open_focus_areas_page()
        self.verify_location_and_cms_page_title(focus_areas_page(),
                                                "Focus areas")

    def open_partners_page(self):
        self.site_navigator.open_partners_page()
        self.verify_location_and_cms_page_title(partners_page(),
                                                "Akvo strategic partners")

    def open_akvopedia_page(self):
        self.site_navigator.open_akvopedia_page()
        self.verify_location_and_page_title(akvopedia_page(),
                                            "Main Page - Akvopedia")

    def open_about_page(self):
        self.site_navigator.open_about_page()
        self.verify_location_and_cms_page_title(about_page(), "About us")

    def open_blog_page(self):
        self.site_navigator.open_blog_page()
        self.verify_location_and_page_title(blog_page(), "Akvo blog")

    def verify_location_and_cms_page_title(self, expected_location,
                                           expected_title_prefix):
        self.verify_location_and_page_title(
            expected_location,
            "%s | Akvo - See it happen" % expected_title_prefix)

    def verify_location_and_page_title(self, expected_location,
                                       expected_title):
        self.assert_location_contains(expected_location)
        self.assert_title_starts_with(expected_title)
Ejemplo n.º 2
0
class AkvoWebTestCase(SeleniumTestCase):

    def setUp(self):
        SeleniumTestCase.setUp(self)
        self.navigator = SeleniumNavigator(self.selenium)
        self.site_navigator = AkvoSiteNavigator(self.selenium)

    def open_home_page(self):
        self.site_navigator.open_home_page()
        self.assert_title_is("Akvo.org - See it happen")

    def open_projects_page(self):
        self.site_navigator.open_projects_page()
        self.verify_location_and_page_title(all_projects_page(), "Akvo.org - All projects")

    def open_all_projects_page(self):
        self.site_navigator.open_all_projects_page()
        self.verify_location_and_page_title(all_projects_page(), "Akvo.org - All projects")

    def open_focus_areas_page(self):
        self.site_navigator.open_focus_areas_page()
        self.verify_location_and_cms_page_title(focus_areas_page(), "Focus areas")

    def open_partners_page(self):
        self.site_navigator.open_partners_page()
        self.verify_location_and_cms_page_title(partners_page(), "Akvo strategic partners")

    def open_akvopedia_page(self):
        self.site_navigator.open_akvopedia_page()
        self.verify_location_and_page_title(akvopedia_page(), "Main Page - Akvopedia")

    def open_about_page(self):
        self.site_navigator.open_about_page()
        self.verify_location_and_cms_page_title(about_page(), "About us")

    def open_blog_page(self):
        self.site_navigator.open_blog_page()
        self.verify_location_and_page_title(blog_page(), "Akvo blog")

    def verify_location_and_cms_page_title(self, expected_location, expected_title_prefix):
        self.verify_location_and_page_title(expected_location, "%s | Akvo - See it happen" % expected_title_prefix)

    def verify_location_and_page_title(self, expected_location, expected_title):
        self.assert_location_contains(expected_location)
        self.assert_title_starts_with(expected_title)