예제 #1
0
    def test_hidden_element_on_page(self):
        welcome_page = WelcomePage(self.driver)
        welcome_page.verify_welcome_page().click_on_link("Dynamic Loading")

        dynamic_loading_page = DynamicLoadingPage(self.driver)
        dynamic_loading_page.click_on_link("Example 1")
        dynamic_loading_page.display_hidden_element()
예제 #2
0
    def test_new_element_rendered_on_page(self):
        welcome_page = WelcomePage(self.driver)
        welcome_page.verify_welcome_page().click_on_link("Dynamic Loading")

        dynamic_loading_page = DynamicLoadingPage(self.driver)
        dynamic_loading_page.click_on_link("Example 2")
        dynamic_loading_page.render_new_element()
예제 #3
0
def dynamic_loading(request):
    _chromedriver = os.path.join(os.getcwd(), 'vendor', 'chromedriver')
    if os.path.isfile(_chromedriver):
        driver_ = webdriver.Chrome(_chromedriver)

    else:
        driver_ = webdriver.Chrome()

    dynamic_loading = DynamicLoadingPage(driver_)

    def quit():
        driver_.quit()

    request.addfinalizer(quit)
    return dynamic_loading
예제 #4
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