当前位置: 首页>>代码示例>>Python>>正文


Python selectBrowser._getBrowser函数代码示例

本文整理汇总了Python中selectBrowser._getBrowser函数的典型用法代码示例。如果您正苦于以下问题:Python _getBrowser函数的具体用法?Python _getBrowser怎么用?Python _getBrowser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_getBrowser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_histogramLinkRemoval

    def test_histogramLinkRemoval(self):
        driver = self.driver
        browser = selectBrowser._getBrowser()

        # Wait for the image window to be present (ensures browser is fully loaded)
        imageWindow = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))

        # Find the Histogram window
        histWindow = self._getHistogramWindow( driver )
        ActionChains(driver).click(histWindow).perform()

        # Open Link settings for the Histogram window
        linkMenuButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Links...']")))
        ActionChains(driver).click( linkMenuButton ).perform()

        # Remove link from the Histogram to the main image window
        Util.remove_main_link( self, driver, imageWindow )

        # Load an image
        Util.load_image( self, driver, "Default")

        # Find and select the histogram window
        histWindow = self._getHistogramWindow( driver )
        ActionChains(driver).click( histWindow ).perform()

        # Click the settings button to expose the settings
        self._openHistogramSettings( driver )

        # Check that the histogram values are default values
        newMaxZoomValue = self._getTextValue( driver, "histogramZoomMaxValue")
        self.assertEqual( float(newMaxZoomValue), 1, "Histogram is linked to image after link was removed")
开发者ID:daikema,项目名称:CARTAvis,代码行数:31,代码来源:tHistogram.py

示例2: test_histogramChangeLinks

    def test_histogramChangeLinks(self):
        driver = self.driver
        browser = selectBrowser._getBrowser()

        # Wait for the image window to be present (ensures browser is fully loaded)
        imageWindow = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))

        # Find and select the Histogram window
        histWindow = self._getHistogramWindow( driver )
        ActionChains(driver).click( histWindow ).perform()

        # Click the settings button to expose the settings
        self._openHistogramSettings( driver )

         # Open Link settings for the Histogram window
        linkMenuButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Links...']")))
        ActionChains(driver).click( linkMenuButton ).perform()

        # Remove the link from the Histogram to the main image window
        Util.remove_main_link( self, driver, imageWindow )

        # Load an image in a separate window
        imageWindow2 = Util.load_image_different_window( self, driver, "aH.fits")

        # Open link settings for the Histogram
        ActionChains(driver).click( histWindow ).perform()
        linkMenuButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Links...']")))
        ActionChains(driver).click( linkMenuButton ).perform()

        # Link the Histogram to the second image
        Util.link_second_image( self, driver, imageWindow2)

        # Check that the histogram values are not default values
        newMaxZoomValue = self._getTextValue( driver, "histogramZoomMaxValue")
        self.assertNotEqual( float(newMaxZoomValue), 1, "Histogram did not update to newly linked image")
开发者ID:daikema,项目名称:CARTAvis,代码行数:35,代码来源:tHistogram.py

示例3: test_histogramChangeLinks

    def test_histogramChangeLinks(self):
        driver = self.driver
        browser = selectBrowser._getBrowser()

        # This test only works for Chrome at the moment
        if browser == 2:
            # Wait for the image window to be present (ensures browser is fully loaded)
            imageWindow = WebDriverWait(driver, 20).until(
                EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']"))
            )

            # Load an image in a separate window
            imageWindow2 = Util.load_image_different_window(self, driver, "aH.fits")

            # Find and select the Histogram window
            histWindow = self._getHistogramWindow(driver)
            ActionChains(driver).click(histWindow).perform()

            # Click the settings button to expose the settings
            self._openHistogramSettings(driver, histWindow)

            # Open Link settings for the Histogram window
            ActionChains(driver).context_click(histWindow).send_keys(Keys.ARROW_DOWN).send_keys(
                Keys.ARROW_DOWN
            ).send_keys(Keys.ENTER).perform()

            # Remove the link from the Histogram to the main image window
            imageWindow = WebDriverWait(driver, 10).until(
                EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']"))
            )
            ActionChains(driver).move_to_element(imageWindow).context_click(imageWindow).send_keys(
                Keys.ARROW_DOWN
            ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()
            time.sleep(timeout)

            # Exit links before continuing
            ActionChains(driver).move_to_element(imageWindow).context_click(imageWindow).send_keys(
                Keys.ARROW_DOWN
            ).send_keys(Keys.ENTER).perform()
            # Open link settings for the Histogram
            ActionChains(driver).context_click(histWindow).send_keys(Keys.ARROW_DOWN).send_keys(
                Keys.ARROW_DOWN
            ).send_keys(Keys.ENTER).perform()

            # Link the Histogram to the second image
            ActionChains(driver).move_to_element(histWindow).click(histWindow).drag_and_drop(
                histWindow, imageWindow2
            ).perform()
            time.sleep(timeout)

            # Exit links before continuing
            ActionChains(driver).move_to_element(imageWindow).context_click(imageWindow).send_keys(
                Keys.ARROW_DOWN
            ).send_keys(Keys.ENTER).perform()

            # Check that the histogram values are not default values
            newMaxZoomValue = self._getTextValue(driver, "histogramZoomMaxValue")
            self.assertNotEqual(float(newMaxZoomValue), 1, "Histogram did not update to newly linked image")
开发者ID:pfederl,项目名称:CARTAvis,代码行数:58,代码来源:tHistogram.py

示例4: test_animatorChangeLink

    def test_animatorChangeLink(self):
        driver = self.driver
        browser = selectBrowser._getBrowser()
        timeout = 2*selectBrowser._getSleep()

        #Load an image with more than one channel so the channel
        #animator will appear
        imageWindow = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))
        Util.load_image( self, driver, "Default")

        # Enable the animation window
        animWindow = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowAnimation']")))
        ActionChains(driver).click( animWindow ).perform()

        # Remove Animator link to the image window
        linkMenuButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Links...']")))
        ActionChains(driver).click( linkMenuButton ).perform()
        Util.remove_main_link( self, driver, imageWindow)

        # Load an image in a different window
        imageWindow2 = Util.load_image_different_window( self, driver, "Orion.methanol.cbc.contsub.image.fits")

        # Change link to second image
        animWindow = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "ChannelAnimatorUpperBound")))
        ActionChains(driver).double_click( animWindow ).perform()
        
        linkMenuButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Links...']")))
        ActionChains(driver).click( linkMenuButton ).perform()
        
        Util.link_second_image( self, driver, imageWindow2)

        # Find and click the upper spin box
        upperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ChannelUpperBoundSpin']/input")))
        driver.execute_script( "arguments[0].scrollIntoView(true);", upperBoundText)

        # Check that the animator updates to the second image
        upperBound = upperBoundText.get_attribute("value")
        self.assertNotEqual( int(upperBound), 0, "Channel animator did not update to second image values")

        # Show the image animator by loading a second image in the second window
        Util.load_image_windowIndex( self, driver, "aH.fits", 2)

        # Find and click the upper spin box
        imageUpperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ImageUpperBoundSpin']/input")))
        driver.execute_script( "arguments[0].scrollIntoView(true);", imageUpperBoundText)

        # Get the image upper spin value
        imageCount = imageUpperBoundText.get_attribute("value")
        print "Animator image count ", imageCount

        # Check that the Image Animator updates
        self.assertEqual( int(imageCount), 1, "Image Animator did not update after image was linked")
开发者ID:Astroua,项目名称:CARTAvis,代码行数:52,代码来源:tAnimatorLinks.py

示例5: test_animatorChangeLink

    def test_animatorChangeLink(self):
        driver = self.driver
        browser = selectBrowser._getBrowser()

        # This test does not work on Firefox
        if browser == 2:
            # Load image in a separate window
            imageWindow2 = Util.load_image_different_window( self, driver, "N15693D.fits")

            # Click on the Animator to enable it
            animWindow = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.boundWidgets.Animator']")))
            self.assertIsNotNone( animWindow, "Could not find Animator window")
            ActionChains(driver).click( animWindow ).perform()
            # Make sure the animation window is enabled by clicking an element within the window
            channelText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "ChannelIndexText")))
            ActionChains(driver).click( channelText ).perform()
            
            # Remove Animator link to the main image window
            ActionChains(driver).context_click( channelText ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

            # Change the link location of the animator to the second image
            ActionChains(driver).move_to_element( animWindow ).click( animWindow ).drag_and_drop(animWindow, imageWindow2).perform()

            # Exit Links
            ActionChains(driver).move_to_element( animWindow ).context_click( animWindow ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

            # Find and click the upper spin box
            upperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ChannelUpperBoundSpin']/input")))
            self.assertIsNotNone( upperBoundText, "Could not find upper bound spin box" )
            driver.execute_script( "arguments[0].scrollIntoView(true);", upperBoundText)

            # Check that the animator updates to the second image
            upperBound = upperBoundText.get_attribute("value")
            self.assertNotEqual( int(upperBound), 0, "Channel animator did not update to second image values")

            # Show the Image Animator
            ActionChains(driver).context_click( channelText ).send_keys(Keys.ARROW_DOWN).send_keys(
                Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(
                Keys.ARROW_RIGHT).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

            # Find and click the upper spin box 
            imageUpperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ImageUpperBoundSpin']/input")))
            self.assertIsNotNone( imageUpperBoundText, "Could not find upper bound for image animator")
            driver.execute_script( "arguments[0].scrollIntoView(true);", imageUpperBoundText)
            imageUpperBoundText.click()

            # Get the image upper spin value 
            imageCount = imageUpperBoundText.get_attribute("value")

            # Check that the Image Animator updates
            self.assertEqual( int(imageCount), 0, "Image Animator did not update after image was linked")
开发者ID:pfederl,项目名称:CARTAvis,代码行数:51,代码来源:tAnimatorLinks.py

示例6: test_animatorRemoveLink

    def test_animatorRemoveLink(self):
        driver = self.driver
        browser = selectBrowser._getBrowser()

        # This test does not work on Firefox
        if browser == 2:
            # Click on the Animator to enable it
            animWindow = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.boundWidgets.Animator']")))
            self.assertIsNotNone( animWindow, "Could not find Animator window")
            ActionChains(driver).click( animWindow ).perform()
            # Make sure the animation window is enabled by clicking an element within the window
            channelText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "ChannelIndexText")))
            ActionChains(driver).click( channelText ).perform()

            # Navigate to view links from the Animator settings        
            ActionChains(driver).context_click( channelText ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

            # Remove Animator link to the main image window
            ActionChains(driver).move_to_element( animWindow ).context_click( animWindow ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

            # Exit Links
            ActionChains(driver).move_to_element( animWindow ).context_click( animWindow ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

            # Load an image
            Util.load_image(self, driver, "Default")

            # Find and click the upper spin box
            upperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ChannelUpperBoundSpin']/input")))
            self.assertIsNotNone( upperBoundText, "Could not find upper bound spin box" )
            driver.execute_script( "arguments[0].scrollIntoView(true);", upperBoundText)

            # Check that the Channel Animator values remained at default values
            upperBound = upperBoundText.get_attribute("value")
            self.assertEqual( int(upperBound), -1, "Channel Animator is still linked to image after link was removed")

           # Show the Image Animator
            ActionChains(driver).context_click( channelText ).send_keys(Keys.ARROW_DOWN).send_keys(
                Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(
                Keys.ARROW_RIGHT).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

            # Find and click the upper spin box 
            imageUpperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ImageUpperBoundSpin']/input")))
            self.assertIsNotNone( imageUpperBoundText, "Could not find upper bound for image animator")
            driver.execute_script( "arguments[0].scrollIntoView(true);", imageUpperBoundText)
            imageUpperBoundText.click()

            # Get the image upper spin value 
            imageCount = imageUpperBoundText.get_attribute("value")

            # Check that the Image Animator is at default values
            self.assertEqual( int(imageCount), -1, "Image Animator is still linked to image after the link was removed")
开发者ID:pfederl,项目名称:CARTAvis,代码行数:51,代码来源:tAnimatorLinks.py

示例7: load_image

def load_image(unittest, driver, imageName, imageId = "pwUID0"): 
    browser = selectBrowser._getBrowser()
    timeout = selectBrowser._getSleep()

    # If image is not specified, load default image
    # Change this to a test image available where the tests are running
    # Test image will ideally have more than 3 channels for a successful test run
    if imageName == "Default":
        #imageName = "N15693D.fits"
        #imageName="TWHydra_CO2_1line.image.fits"
        imageName="Orion.methanol.cbc.contsub.image.fits"

    # Wait 30 seconds for the imageWindow to appear on the page
    imageWindow = WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))

    # Find a window capable of loading an image and select the window
    ActionChains(driver).double_click( imageWindow ).perform()
    
    # Pause, otherwise stale element for Chrome
    if browser == 2:
        time.sleep( timeout)

    # Click the data button
    dataButton = driver.find_element_by_xpath( "//div[text()='Data']/..")
    ActionChains(driver).click(dataButton).perform()    
    
    # Look for the open button and click it to open the file dialog.
    openDataButton = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div/div[text()='Open...']/..")))
    ActionChains(driver).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

    # Select the specific image
    loadButton = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.ID, "loadFileButton")))
    fileDiv = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[text()='"+imageName+"']")))
    driver.execute_script( "arguments[0].scrollIntoView(true);", fileDiv)
    fileDiv.click()
    
    # Click the load button
    loadButton = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.ID, "loadFileButton")))
    loadButton.click()
    
    # Now close the file dialog
    closeButton = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.ID, "closeFileLoadButton")))
    closeButton.click()
    
    # Check that the window is displaying an image.
    viewElement = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.boundWidgets.View.View']")))
    imageElement = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.ID, imageId)))

    return imageWindow
开发者ID:daikema,项目名称:CARTAvis,代码行数:49,代码来源:Util.py

示例8: test_animatorChangeLink

    def test_animatorChangeLink(self):
        driver = self.driver
        browser = selectBrowser._getBrowser()
        timeout = selectBrowser._getSleep()

        imageWindow = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))

        # Enable the animation window by clicking an element within the window
        channelText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "ChannelIndexText")))
        ActionChains(driver).click( channelText ).perform()

        # Remove Animator link to the image window
        linkMenuButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Links...']")))
        ActionChains(driver).click( linkMenuButton ).perform()
        Util.remove_main_link( self, driver, imageWindow)

        # Load an image in a different window
        imageWindow2 = Util.load_image_different_window( self, driver, "N15693D.fits")

        # Change link to second image
        ActionChains(driver).click( channelText ).perform()
        linkMenuButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Links...']")))
        ActionChains(driver).click( linkMenuButton ).perform()
        Util.link_second_image( self, driver, imageWindow2)

        # Find and click the upper spin box
        upperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ChannelUpperBoundSpin']/input")))
        driver.execute_script( "arguments[0].scrollIntoView(true);", upperBoundText)

        # Check that the animator updates to the second image
        upperBound = upperBoundText.get_attribute("value")
        self.assertNotEqual( int(upperBound), 0, "Channel animator did not update to second image values")

        # Show the Image Animator
        animateToolBar = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Animate']")))
        ActionChains(driver).click( animateToolBar ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(
            Keys.ENTER).perform()
        time.sleep(timeout)

        # Find and click the upper spin box 
        imageUpperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ImageUpperBoundSpin']/input")))
        driver.execute_script( "arguments[0].scrollIntoView(true);", imageUpperBoundText)

        # Get the image upper spin value 
        imageCount = imageUpperBoundText.get_attribute("value")

        # Check that the Image Animator updates
        self.assertEqual( int(imageCount), 0, "Image Animator did not update after image was linked")
开发者ID:durga2112,项目名称:CARTAvis,代码行数:48,代码来源:tAnimatorLinks.py

示例9: load_image_different_window

def load_image_different_window(unittest, driver, imageName):
    timeout = selectBrowser._getSleep()
    browser = selectBrowser._getBrowser()

    # Find a window capable of loading an image.
    imageWindow = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))
    ActionChains(driver).click(imageWindow).perform()
    time.sleep( timeout )
    
    # Add a new window below the main casa image window
    emptyWindow = add_window( unittest, driver)
    
    # Change the plugin of the empty window to an image loader 
    ActionChains(driver).context_click( emptyWindow ).send_keys(Keys.ARROW_DOWN
        ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_RIGHT).send_keys(Keys.ENTER).perform()

    # Ensure that there is a new image window
    imageWindow2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.ID, "CasaImageLoader2")))
    ActionChains(driver).double_click( imageWindow2 ).perform()

    # Click the data button
    dataButton = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[text()='Data']/..")))
    ActionChains(driver).click(dataButton).perform()
    
    # Look for the open button and click it to open the file dialog.
    openDataButton = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div/div[text()='Open...']/..")))
    ActionChains(driver).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

    # Select the specific image
    loadButton = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.ID, "loadFileButton")))
    fileDiv = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[text()='"+imageName+"']")))
    driver.execute_script( "arguments[0].scrollIntoView(true);", fileDiv)
    fileDiv.click()
    
    # Click the load button
    loadButton = driver.find_element_by_id( "loadFileButton")
    loadButton.click()
    
    # Now close the file dialog
    closeButton = driver.find_element_by_id( "closeFileLoadButton")
    closeButton.click()
    
    # Check that the window is displaying an image.
    viewElement = driver.find_element_by_xpath("//div[@qxclass='skel.boundWidgets.View.View']")
    imageElement = driver.find_element_by_id("pwUID0")

    # Return the second image loader window for further linking tests
    return imageWindow2
开发者ID:durga2112,项目名称:CARTAvis,代码行数:48,代码来源:Util.py

示例10: load_image_different_window

def load_image_different_window(unittest, driver, imageName):
    timeout = selectBrowser._getSleep()
    browser = selectBrowser._getBrowser()

    # Find a window capable of loading an image.
    imageWindow = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))
    ActionChains(driver).click(imageWindow).perform()
    time.sleep( timeout )
    
    # Add a new window below the main casa image window
    emptyWindow = add_window( unittest, driver)
    
    # Change the plugin of the empty window to an image loader 
    ActionChains(driver).context_click( emptyWindow ).send_keys(Keys.ARROW_DOWN
        ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_RIGHT).send_keys(Keys.ENTER).perform()
    return load_image_windowIndex( unittest, driver,imageName, 2 )
开发者ID:Astroua,项目名称:CARTAvis,代码行数:16,代码来源:Util.py

示例11: test_statsChangeLinkUpdate

    def test_statsChangeLinkUpdate(self):
        driver = self.driver 
        browser = selectBrowser._getBrowser()

        # Test only works on Chrome
        if browser ==2:
            # Load an image in a new image window
            imageWindow2 = Util.load_image_different_window( self, driver, "aH.fits")

            # Find and click on the Statistics window 
            statsWindow = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='Statistics']")))
            self.assertIsNotNone( statsWindow, "Could not find statistics window")
            ActionChains(driver).click( statsWindow ).perform()

            # In Stastics context menu, open Link Settings
            ActionChains(driver).context_click( statsWindow ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()
            
            # Remove the link from the Statistics Window to the image window
            imageWindow = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))
            ActionChains(driver).move_to_element( imageWindow ).context_click( imageWindow ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

            # Change the link to the loaded image 
            ActionChains(driver).move_to_element( statsWindow ).click( statsWindow ).drag_and_drop( statsWindow, imageWindow2).perform()

            # Exit links
            ActionChains(driver).move_to_element( statsWindow ).context_click( statsWindow ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

            # Move to the center of the image window so data appears in the Stats Window
            ActionChains(driver).move_to_element( imageWindow2 ).perform()

            # Sometimes text does not appear, therefore move mouse cursor
            ActionChains(driver).move_by_offset( 100, 100 ).perform()

            # First check that there is text in the Stats Window
            statsText = len(driver.find_elements_by_xpath("//div[@qxclass='skel.boundWidgets.Label']"))
            self.assertEqual( int(statsText), 1, "Should be able to find text in Stats Window")

            # Check that the Stastics window is linked to the image window
            statsText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.boundWidgets.Label']")))
            statsText = statsText.get_attribute('textContent')         
                
            # Check that the Default sky text appears in the Stats Window
            statsText = statsText.startswith("Default sky")
            self.assertEqual( statsText, 1, "Stats window did not link to image after previous link was removed and new link was created to different window")
开发者ID:pfederl,项目名称:CARTAvis,代码行数:44,代码来源:tStatistics.py

示例12: test_animatorRemoveLink

    def test_animatorRemoveLink(self):
        driver = self.driver
        browser = selectBrowser._getBrowser()
        timeout = selectBrowser._getSleep()

        # Locate the image window on the page; ensures browser is fully loaded
        imageWindow = WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))

        # Make sure the animation window is enabled by clicking an element within the window
        channelText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "ChannelIndexText")))
        ActionChains(driver).click( channelText ).perform()

        # Remove link from main image window to Animator 
        linkMenuButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Links...']")))
        ActionChains(driver).click( linkMenuButton ).perform()
        Util.remove_main_link( self, driver, imageWindow)

        # Load an image
        Util.load_image(self, driver, "Default")

        # Find and click the upper spin box
        upperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ChannelUpperBoundSpin']/input")))
        driver.execute_script( "arguments[0].scrollIntoView(true);", upperBoundText)

        # Check that the Channel Animator values remained at default values
        upperBound = upperBoundText.get_attribute("value")
        self.assertEqual( int(upperBound), 0, "Channel Animator is still linked to image after link was removed")

       # Show the Image Animator
        animateToolBar = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Animate']")))
        ActionChains(driver).click( animateToolBar ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(
            Keys.ENTER).perform()
        time.sleep(timeout)

        # Find and click the upper spin box 
        imageUpperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ImageUpperBoundSpin']/input")))
        driver.execute_script( "arguments[0].scrollIntoView(true);", imageUpperBoundText)

        # Get the image upper spin value 
        imageCount = imageUpperBoundText.get_attribute("value")

        # Check that the Image Animator is at default values
        self.assertEqual( int(imageCount), 0, "Image Animator is still linked to image after the link was removed")
开发者ID:durga2112,项目名称:CARTAvis,代码行数:43,代码来源:tAnimatorLinks.py

示例13: test_animatorAddLink

    def test_animatorAddLink(self):
        driver = self.driver 
        timeout = selectBrowser._getSleep()
        browser = selectBrowser._getBrowser()

        # Load image in a separate window
        imageWindow2 = Util.load_image_different_window( self, driver, "N15693D.fits")

        # Make sure the animation window is enabled by clicking an element within the window
        channelText = driver.find_element_by_id("ChannelIndexText")
        ActionChains(driver).click( channelText ).perform()

        # Navigate to view links from the Animator settings        
        linkMenuButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Links...']")))
        ActionChains(driver).click( linkMenuButton ).perform()

        # Add link from the Animator to the image
        Util.link_second_image( self, driver, imageWindow2)

        # Find and click the upper spin box
        upperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ChannelUpperBoundSpin']/input")))
        driver.execute_script( "arguments[0].scrollIntoView(true);", upperBoundText)

        # Check that the animator updates 
        upperBound = upperBoundText.get_attribute("value")
        self.assertNotEqual( int(upperBound), 0, "Channel animator did not update to linked image")

        # Show the Image Animator
        animateToolBar = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Animate']")))
        ActionChains(driver).click( animateToolBar ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(
            Keys.ENTER).perform()
        time.sleep(timeout)

        # Find and click the upper spin box 
        imageUpperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ImageUpperBoundSpin']/input")))
        driver.execute_script( "arguments[0].scrollIntoView(true);", imageUpperBoundText)

        # Get the image upper spin value 
        imageCount = imageUpperBoundText.get_attribute("value")

        # Check that the Image Animator updates
        self.assertEqual( int(imageCount), 0, "Image Animator did not update after image was linked")
开发者ID:durga2112,项目名称:CARTAvis,代码行数:42,代码来源:tAnimatorLinks.py

示例14: test_animatorAddLink

    def test_animatorAddLink(self):
        driver = self.driver
        timeout = 2*selectBrowser._getSleep()
        browser = selectBrowser._getBrowser()

        # Load image in a separate window, but make sure it has at least
        # one channel.
        imageWindow2 = Util.load_image_different_window( self, driver, "TWHydra_CO2_1line.image.fits")

        # Make sure the animation window is enabled by clicking an element within the window
        animWindow = driver.find_element_by_xpath( "//div[@qxclass='skel.widgets.Window.DisplayWindowAnimation']" )
        ActionChains(driver).click( animWindow ).perform()

        # Navigate to view links from the Animator settings
        linkMenuButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[text()='Links...']")))
        ActionChains(driver).click( linkMenuButton ).perform()

        # Add link from the Animator to the image
        Util.link_second_image( self, driver, imageWindow2)
        ActionChains(driver).send_keys( Keys.ESCAPE).perform()
        # Find and click the upper spin box
        upperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ChannelUpperBoundSpin']/input")))
        driver.execute_script( "arguments[0].scrollIntoView(true);", upperBoundText)

        # Check that the animator updates
        upperBound = upperBoundText.get_attribute("value")
        print "Upper bound ", upperBound
        self.assertNotEqual( int(upperBound), 0, "Channel animator did not update to linked image")

        # Show the Image Animator by loading a second image.
        Util.load_image_windowIndex( self, driver, "aH.fits", 2)

        # Find and click the upper spin box
        imageUpperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ImageUpperBoundSpin']/input")))
        driver.execute_script( "arguments[0].scrollIntoView(true);", imageUpperBoundText)

        # Get the image upper spin value
        imageCount = imageUpperBoundText.get_attribute("value")

        # Check that the Image Animator updates
        self.assertEqual( int(imageCount), 1, "Image Animator did not update after image was linked")
开发者ID:Astroua,项目名称:CARTAvis,代码行数:41,代码来源:tAnimatorLinks.py

示例15: test_histogramLinkRemoval

    def test_histogramLinkRemoval(self):
        driver = self.driver
        browser = selectBrowser._getBrowser()

        # This test only works for Chrome at the moment
        if browser == 2:
            # Find the Histogram window
            histWindow = self._getHistogramWindow(driver)

            # Open Link settings for the Histogram window
            ActionChains(driver).context_click(histWindow).send_keys(Keys.ARROW_DOWN).send_keys(
                Keys.ARROW_DOWN
            ).send_keys(Keys.ENTER).perform()

            imageWindow = driver.find_element_by_xpath("//div[@class='qx-window-pane']")
            ActionChains(driver).move_to_element(imageWindow).context_click().perform()

            # Remove link from the main image window from the Histogram
            ActionChains(driver).move_to_element(imageWindow).context_click().send_keys(Keys.ARROW_DOWN).send_keys(
                Keys.ARROW_DOWN
            ).send_keys(Keys.ENTER).perform()

            # Exit Links before continuing
            ActionChains(driver).context_click().send_keys(Keys.ARROW_DOWN).send_keys(Keys.ENTER).perform()

            # Load an image
            Util.load_image(self, driver, "Default")

            # Find and select the histogram window
            histWindow = self._getHistogramWindow(driver)
            ActionChains(driver).click(histWindow).perform()

            # Click the settings button to expose the settings
            self._openHistogramSettings(driver, histWindow)

            # Check that the histogram values are default values
            newMaxZoomValue = self._getTextValue(driver, "histogramZoomMaxValue")
            self.assertEqual(float(newMaxZoomValue), 1, "Histogram is linked to image after link was removed")
开发者ID:pfederl,项目名称:CARTAvis,代码行数:38,代码来源:tHistogram.py


注:本文中的selectBrowser._getBrowser函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。