Exemplo n.º 1
0
    def test_jquery_menu(self):
        welcome_page = WelcomePage(self.driver)
        welcome_page.verify_welcome_page().click_on_link("JQuery UI Menus")

        jquery_menu_page = JQueryUIMenuPage(self.driver)
        jquery_menu_page.verify_jquery_menu_page()
        jquery_menu_page.verify_jquery_menu()
Exemplo n.º 2
0
    def click_on_link(self, link_txt):
        """
        This method is to click on the links present on the welcome page.

        param link_txt: link text present on the Welcome page
        type link_txt: string

        return: returns the instance of the next navigating page.
        rtype: instance
        """

        logging.info("# Click on link '%s'" % link_txt)
        self.services.assert_and_click_by_xpath(self.xpath_link % link_txt)

        # Link Text: Checkboxes
        if link_txt == "Checkboxes":
            checkbox_page = CheckboxPage(self.driver)
            checkbox_page.verify_checkbox_page()
            return checkbox_page

        # Link Text: Dropdown
        if link_txt == "Dropdown":
            dropdown_page = DropdownPage(self.driver)
            dropdown_page.verify_dropdown_page()
            return dropdown_page

        # Link Text: Dropdown
        if link_txt == "Context Menu":
            context_menu_page = ContextMenuPage(self.driver)
            context_menu_page.verify_context_menu_page()
            return context_menu_page

        # Link Text: Challenging DOM
        if link_txt == "Challenging DOM":
            challenging_dom_page = ChallengingDomPage(self.driver)
            challenging_dom_page.verify_challenging_dom_page()
            return challenging_dom_page

        # Link Text: Disappearing Elements
        if link_txt == "Disappearing Elements":
            disappearing_elements_page = DisappearingElementsPage(self.driver)
            disappearing_elements_page.verify_disappearing_elements_page()
            return disappearing_elements_page

        # Link Text: Dynamic Controls
        if link_txt == "Dynamic Controls":
            dynamic_controls_page = DynamicControlsPage(self.driver)
            dynamic_controls_page.verify_dynamic_controls_page()
            return dynamic_controls_page

        # Link Text: Dynamic Loading
        if link_txt == "Dynamic Loading":
            dynamic_loading_page = DynamicLoadingPage(self.driver)
            dynamic_loading_page.verify_dynamic_loading_page()
            return dynamic_loading_page

        # Link Text: Dynamic Loading
        if link_txt == "Drag and Drop":
            drag_and_drop_page = DragAndDropPage(self.driver)
            drag_and_drop_page.verify_drag_and_drop_page()
            return drag_and_drop_page

        # Link Text: JQuery UI Menus
        if link_txt == "JQuery UI Menus":
            jquery_menu_page = JQueryUIMenuPage(self.driver)
            jquery_menu_page.verify_jquery_menu_page()
            return jquery_menu_page

        return self