本文整理汇总了Python中selectBrowser._getSleep函数的典型用法代码示例。如果您正苦于以下问题:Python _getSleep函数的具体用法?Python _getSleep怎么用?Python _getSleep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_getSleep函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _getLastValue
def _getLastValue(self, driver):
timeout = selectBrowser._getSleep()
lastValueButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@class='qx-toolbar']/div[@qxclass='qx.ui.toolbar.Button'][5]")))
self.assertIsNotNone( lastValueButton, "Could not find button to go to the last valid value")
driver.execute_script( "arguments[0].scrollIntoView(true);", lastValueButton)
ActionChains(driver).click( lastValueButton ).perform()
time.sleep( timeout )
开发者ID:pfederl,项目名称:CARTAvis,代码行数:7,代码来源:tAnimator.py
示例2: test_groupRename
def test_groupRename(self):
driver = self.driver
timeout = selectBrowser._getSleep()
#Load images
Util.load_image( self, driver, "Orion.methanol.cbc.contsub.image.fits")
Util.load_image( self, driver, "Orion.cont.image.fits")
Util.load_image( self, driver, "TWHydra_CO2_1line.image.fits")
time.sleep( 2 )
#Open the image settings
#Open the stack tab
Util.openSettings( self, driver, "Image", True )
Util.clickTab( driver, "Stack" )
#Turn off auto select
autoSelectCheck = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "autoSelectImages")))
ActionChains(driver).click( autoSelectCheck ).perform()
#Group the bottom two images.
secondItem = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Image.Stack.TreeItem']/div[text()='Orion.cont.image.fits']/..")))
actions = ActionChains( driver).key_down(Keys.SHIFT).click( secondItem )
actions.key_up( Keys.SHIFT ).perform()
#Click the group check box.
groupCheck = WebDriverWait( driver, 10).until( EC.presence_of_element_located((By.ID, "stackGroupImages")))
ActionChains(driver).click( groupCheck ).perform()
time.sleep(2)
#Change the name of the group to twoImageRGB & verify that there is a tree node with that name..
nameText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//input[starts-with(@id, 'stackLayerName')]")))
Util._changeElementText(self, driver, nameText, "twoImageRGB")
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[contains(text(),'twoImageRGB')]")))
开发者ID:Astroua,项目名称:CARTAvis,代码行数:35,代码来源:tStack.py
示例3: test_minimize_restore
def test_minimize_restore(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# Find a window capable of loading an image and select the window
imageWindow = WebDriverWait(driver, 30).until(EC.visibility_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))
ActionChains(driver).click( imageWindow ).perform()
time.sleep( timeout )
# Click the Window button
windowButton = driver.find_element_by_xpath( "//div[text()='Window']/..")
ActionChains(driver).click( windowButton ).perform()
# Look for the minimize button in the submenu.
minimizeButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div/div[text()='Minimize']/..")))
ActionChains(driver).click( minimizeButton ).perform()
# Verify that there is a Restore button on the status bar and no DisplayWindowImage.
restoreButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[contains(text(), 'Restore: CasaImageLoader')]/..")))
# Restore the window. Verify the restore button is gone from the status bar and there is a DisplayWindowImage
ActionChains(driver).click( restoreButton ).perform()
#Check that the clipping menu item is no longer available
try:
restoreLabel = WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.toolbar.MenuButton']/div[contains(text(), 'Restore: CasaImageLoader')]")))
self.assertTrue( False, "Should not be able to locate the restore image loader button")
except Exception:
print "Test restore button was successfully removed"
imageWindow = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))
开发者ID:daikema,项目名称:CARTAvis,代码行数:30,代码来源:tWindow.py
示例4: test_animator_to_casaimageloader
def test_animator_to_casaimageloader(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# Wait for the image window to be present (ensures browser is fully loaded)
imageWindow = WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))
# Get the animation window count and make sure it is non-zero
animWindowList = driver.find_elements_by_xpath("//div[@qxclass='skel.widgets.Window.DisplayWindowAnimation']")
animWindowCount = len( animWindowList )
self.assertGreater( animWindowCount, 0, "There are not any animators")
# Get the image window count
imageWindowList = driver.find_elements_by_xpath("//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")
imageWindowCount = len( imageWindowList )
# Locate an animator window and bring up the right-context menu,
# changing to a CasaImageLoader.
Util.animation_to_image_window( self, driver )
time.sleep( timeout )
# Verify that the animation count has gone down by one and the image count
# has increased by one.
animWindowList = driver.find_elements_by_xpath("//div[@qxclass='skel.widgets.Window.DisplayWindowAnimation']")
newAnimWindowCount = len( animWindowList )
self.assertEqual( animWindowCount - 1, newAnimWindowCount, "Animation count did not decrease")
imageWindowList = driver.find_elements_by_xpath("//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")
newImageWindowCount = len( imageWindowList )
self.assertEqual( newImageWindowCount - 1, imageWindowCount, "Image window count did not increase")
开发者ID:durga2112,项目名称:CARTAvis,代码行数:29,代码来源:tView.py
示例5: test_animatorIncreaseFrame
def test_animatorIncreaseFrame(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# Open a test image so we have something to animate
Util.load_image(self, driver, "aH.fits")
Util.load_image(self, driver, "aJ.fits")
Util.load_image(self, driver, "Default")
# Go to the first channel value and record the frame value
self._getFirstValue(driver, "Channel")
firstChannelValue = self._getCurrentValue(driver, "Channel")
# Find the increment by one button on the Channel Animator Tape Deck and click it
self._getNextValue(driver, "Channel")
# Check that the channel text box value is now 1
currChannelValue = self._getCurrentValue(driver, "Channel")
print "Check increase frame..."
print "oldChannelValue= 0 newChannelValue=", currChannelValue
self.assertEqual(int(currChannelValue), int(firstChannelValue) + 1, "Failed to increment Channel Animator")
# Record the first image value
self._getFirstValue(driver, "Image")
firstImageValue = self._getCurrentValue(driver, "Image")
# Find the increment by one button on the Animator Tape Deck and click it
self._getNextValue(driver, "Image")
# Check that the image text box value is now 1
currImageValue = self._getCurrentValue(driver, "Image")
print "Check increase image..."
print "oldImageValue=", firstImageValue, "newImageValue=", currImageValue
self.assertEqual(int(currImageValue), int(firstImageValue) + 1, "Failed to increment the Image Animator")
开发者ID:confluence,项目名称:CARTAvis,代码行数:34,代码来源:tAnimatorSettings.py
示例6: test_load_images
def test_load_images(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# Load a specific image.
imageWindow = Util.load_image(self, driver, "aH.fits")
time.sleep( timeout )
Util.load_image( self, driver, "aJ.fits")
time.sleep( timeout )
Util.load_image( self, driver, "N15693D.fits")
time.sleep( timeout )
Util.load_image( self, driver, "Orion.cont.image.fits")
time.sleep( timeout )
Util.load_image( self, driver, "Orion.methanol.cbc.contsub.image.fits")
time.sleep( timeout )
Util.load_image( self, driver, "TWHydra_CO2_1line.image.fits")
time.sleep( timeout )
Util.load_image( self, driver, "br1202_wide.image")
time.sleep( timeout )
Util.load_image( self, driver, "TWHydra_CO3_2line.image")
time.sleep( timeout )
Util.load_image( self, driver, "TWHydra_cont1.3mm.image")
time.sleep( timeout )
Util.load_image( self, driver, "v2.0_ds2_l000_13pca_map20.fits")
time.sleep( timeout )
#Find the image animator and verify that there are 9 images loaded
upperBoundText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@id='ImageUpperBoundSpin']/input")))
driver.execute_script( "arguments[0].scrollIntoView(true);", upperBoundText)
imageCount = upperBoundText.get_attribute("value")
print "Image Count: ", imageCount
self.assertEqual( imageCount, str(9), "Wrong number of images were loaded")
开发者ID:Astroua,项目名称:CARTAvis,代码行数:32,代码来源:tLoadImage.py
示例7: test_negativeRegionWidth
def test_negativeRegionWidth(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# Load a specific image.
imageWindow = Util.load_image(self, driver, "Default")
time.sleep( timeout )
# Load a specific region in the image.
Util.load_image( self, driver, "OrionMethanolRegion.crtf")
time.sleep( 4 )
#Open the image settings
#Open the stack tab
Util.openSettings( self, driver, "Image", True )
time.sleep(4)
Util.clickTab( driver, "Regions" )
#Change the width to -40 and check for an error.
widthText = driver.find_element_by_xpath("//div[@id='RectangleRegionWidth']/input")
driver.execute_script( "arguments[0].scrollIntoView(true);", widthText )
Util._changeElementText(self, driver, widthText, -10)
widthError = driver.find_element_by_xpath("//div[@id='RectangleRegionWidth']/div[contains(text(),'Range error:')]")
self.assertIsNotNone( widthError, "No error was posted")
time.sleep( timeout )
#Change the width to 40 and check that the error is not there
Util._changeElementText(self, driver, widthText, 40 );
try:
widthError = driver.find_element_by_xpath("//div[@id='RectangleRegionWidth']/div[contains(text(),'Range error:')]")
self.assertTrue( False, "Should not be able to find a range error.")
except Exception:
print "Good, the error disappeared!"
开发者ID:slovelan,项目名称:NRAODev,代码行数:33,代码来源:tRegion.py
示例8: test_globalIsGlobal
def test_globalIsGlobal(self):
driver = self.driver
timeout = selectBrowser._getSleep()
#Load a default image
Util.load_image( self, driver, "Default")
Util.load_image( self, driver, "aJ.fits")
Util.load_image( self, driver, "aH.fits")
#Store the old colormap
oldMapName = self._getColorMapName( driver )
print "Old map name=",oldMapName
#Choose a new color map
self._chooseNewColorMap( driver )
newMapName = self._getColorMapName( driver )
print "New map name=", newMapName
self.assertTrue( oldMapName != newMapName, "Color map name did not change")
#Animate through the images and make sure they are all using the
#new color map.
for i in range(0,2):
self._nextImage( driver )
imageMapName = self._getColorMapName( driver )
print "Image name=",imageMapName
self.assertTrue( imageMapName == newMapName, "Image name was not changed")
开发者ID:slovelan,项目名称:NRAODev,代码行数:26,代码来源:tColorMap.py
示例9: test_newProfileExisting
def test_newProfileExisting(self):
driver = self.driver
timeout = selectBrowser._getSleep()
print "Timeout=",timeout
#Load two images
Util.load_image(self, driver, "Orion.methanol.cbc.contsub.image.fits" )
time.sleep(1)
Util.load_image(self, driver, "TWHydra_CO2_1line.image.fits" )
time.sleep( 1)
# Show the profile view
self._showProfile( driver )
time.sleep(2)
#Open the profile settings to the Profiles tab.
profileWindow = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowProfile']")))
ActionChains(driver).click( profileWindow ).perform()
time.sleep(2)
Util.openSettings( self, driver, "Profile", True )
time.sleep(2)
Util.clickTab( driver, "Profiles" )
#Get the profiles combo and count how many are listed. Since
#the mode is auto generate and current there should be just one.
self._checkProfileCount( driver, 1)
#Turn off auto generate.
Util.clickTab( driver, "Profiles" )
self._setAutoGenerate( driver, False )
time.sleep( timeout )
#Store the image rest frequency.
restFrequency = self._getRestFrequency( driver )
#Select the other image and test the rest frequency changes to match
#the selected image
comboPath = "//div[starts-with(@id,'ProfileSelectedImage')]"
imageCombo = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, comboPath)))
driver.execute_script( "arguments[0].scrollIntoView(true);", imageCombo )
ActionChains(driver).click( imageCombo ).perform()
ActionChains(driver).click( imageCombo).send_keys(Keys.UP).send_keys( Keys.ENTER).perform()
time.sleep( timeout )
newRestFrequency = self._getRestFrequency( driver )
self.assertNotEqual( restFrequency, newRestFrequency, "Image rest frequency did not change")
#Hit the new profile button.
self._hitNew( driver )
time.sleep( 4 )
#Verify that we now have two profiles.
self._checkProfileCount( driver, 2 )
#Turn on auto generate
Util.clickTab( driver, "Profiles" )
self._setAutoGenerate( driver, True )
time.sleep( timeout )
#Verify that we are back to one profile.
self._checkProfileCount( driver, 1 )
开发者ID:slovelan,项目名称:NRAODev,代码行数:60,代码来源:tProfile.py
示例10: test_profileRegion
def test_profileRegion(self):
driver = self.driver
timeout = selectBrowser._getSleep()
#Load a default image
Util.load_image( self, driver, "Orion.methanol.cbc.contsub.image.fits")
time.sleep( timeout )
#Load a region for the image
Util.load_image( self, driver, "OrionMethanolRegion.crtf")
time.sleep( timeout )
self._showProfile( driver )
time.sleep( timeout )
#Open the profile settings to the Profiles tab.
profileWindow = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowProfile']")))
ActionChains(driver).click( profileWindow ).perform()
time.sleep( timeout )
Util.openSettings( self, driver, "Profile", True )
time.sleep( timeout )
Util.clickTab( driver, "Profiles" )
time.sleep( timeout )
#Check that there is a region we are profiling
regionCombo = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "ProfileSelectedRegion")))
driver.execute_script( "arguments[0].scrollIntoView(true);", regionCombo )
nameDiv = regionCombo.find_element_by_xpath( ".//div/div")
regionName = nameDiv.get_attribute( "innerHTML").strip()
print "Region is ",regionName
self.assertTrue( regionName != "None", "Expected a region to be profiled")
开发者ID:slovelan,项目名称:NRAODev,代码行数:33,代码来源:tProfile.py
示例11: test_clip100
def test_clip100(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# Load a specific image.
imageWindow = Util.load_image(self, driver, "Default")
time.sleep( timeout )
# Store the minimum clip value
minClipText = driver.find_element_by_xpath("//div[@id='clipMinIntensity']/input")
driver.execute_script( "arguments[0].scrollIntoView(true);", minClipText )
minClip = minClipText.get_attribute( "value")
print "Min intensity", minClip
# Press the 100% clip button
ActionChains(driver).double_click( imageWindow ).perform()
clippingButton = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[text()='Clipping']/..")))
ActionChains(driver).click( clippingButton ).send_keys(Keys.ARROW_RIGHT
).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN
).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN
).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN
).send_keys(Keys.ENTER).perform()
time.sleep( timeout )
# Make sure the minimum clip value goes down.
newMinClip = minClipText.get_attribute( "value")
print "New min intensity", newMinClip
self.assertTrue( float(newMinClip) < float(minClip), "Minimum clip value did not go down")
开发者ID:slovelan,项目名称:NRAODev,代码行数:28,代码来源:tLoadImage.py
示例12: test_animator_jump
def test_animator_jump(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# 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']")))
# Set the animator to jump
self._setAnimatorToJump( driver );
# Save the preferences
self._savePreferences(driver )
# Find the wrap radio button in the animator settings and click it
wrapButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.form.RadioButton']/div[text()='Wrap']/following-sibling::div")))
self.assertIsNotNone( wrapButton, "Could not find wrap button in settings")
self._setChecked( driver, wrapButton, True )
# Restore the preferences
self._restorePreferences( driver )
time.sleep( timeout )
# Verify the animator jump end behavior is checked
jumpButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.form.RadioButton']/div[text()='Jump']/following-sibling::div")))
self.assertIsNotNone( jumpButton, "Could not find jump button in settings")
self._verifyChecked( driver, jumpButton )
开发者ID:pfederl,项目名称:CARTAvis,代码行数:26,代码来源:tSnapshotPreferences.py
示例13: test_toolbar_hide
def test_toolbar_hide(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# Wait for the image window to be present (ensures browser is fully loaded)
imageWindow = WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))
ActionChains(driver).click( imageWindow).perform()
time.sleep( timeout )
# Find the preferences button on the menu bar and click it.
menuBar = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Menu.MenuBar']")))
#self.assertIsNotNone( menuBar, "Could not find the menu bar")
preferencesButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[text()='Preferences']/..")))
#self.assertIsNotNone( preferencesButton, "Could not find div with text Preferences")
ActionChains(driver).click(preferencesButton).perform()
# Click the show button on the sub menu.
showButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div/div[text()='Show']/..")))
ActionChains(driver).click( showButton).perform()
showToolButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[text()='Show Tool Bar']/..")))
ActionChains(driver).click( showToolButton).perform()
time.sleep( timeout )
# Verify the toolbar is NOT visible
toolVisible = self._isToolbarVisible( driver )
self.assertFalse( toolVisible, "Tool bar was not hidden")
# Save the preferences
self._savePreferences( driver )
# Show the toolbar
# Find the preferences button on the menu bar and click it.
preferencesButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[text()='Preferences']/..")))
ActionChains(driver).click(preferencesButton).perform()
# Click the show tool bar button on the sub menu.
ActionChains(driver).send_keys( Keys.ARROW_DOWN ).send_keys( Keys.ARROW_RIGHT ).send_keys( Keys.ARROW_DOWN ).send_keys( Keys.ARROW_DOWN ).send_keys( Keys.ENTER ).perform()
time.sleep( timeout )
#Verify the toolbar is now visible
toolBar = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Menu.ToolBar']")))
# Click the restore sessions button
self._clickSessionButton( driver )
self._clickSessionRestoreButton( driver )
# Select tSnapshotPreferences in the restore combo box
self._selectRestoreSnapshot( driver, "tSnapshotPreferences")
# Hit the restore button
self._restoreSnapshot( driver )
# Close the restore dialog
self._closeRestore( driver )
time.sleep( timeout )
# Verify the toolbar is hidden again
toolVisible = self._isToolbarVisible( driver)
self.assertFalse( toolVisible, "Tool bar was not hidden with restore state")
开发者ID:Astroua,项目名称:CARTAvis,代码行数:60,代码来源:tSnapshotPreferences.py
示例14: test_animator_jump
def test_animator_jump(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# 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']")))
# There must be an image loaded with more than one channel to see the animator.
Util.load_image(self,driver, "TWHydra_CO2_1line.image.fits" )
# Set the animator to jump
self._setAnimatorToJump( driver );
# Save the preferences
self._savePreferences(driver )
# Find the wrap radio button in the animator settings and click it
wrapButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "ChannelWrapRadioButton")))
self._setChecked( driver, wrapButton, True )
# Restore the preferences
self._restorePreferences( driver )
time.sleep( timeout )
# Verify the animator jump end behavior is checked
jumpButton = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='qx.ui.form.RadioButton']/div[text()='Jump']/following-sibling::div")))
self._verifyChecked( driver, jumpButton )
开发者ID:Astroua,项目名称:CARTAvis,代码行数:27,代码来源:tSnapshotPreferences.py
示例15: test_deleteImageFromRegion
def test_deleteImageFromRegion(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# Load a specific image.
imageWindow = Util.load_image(self, driver, "Default")
time.sleep( timeout )
# Load a specific region in the image.
Util.load_image( self, driver, "OrionMethanolRegion.crtf")
time.sleep( 4 )
#Open the image settings
#Open the regions tab
Util.openSettings( self, driver, "Image", True )
time.sleep(4)
Util.clickTab( driver, "Regions" )
#Verify that there is one region in the region list.
self._checkRegionCount( driver, 1 );
# Click on the Data->Close->Image button to close the image.
ActionChains(driver).double_click( imageWindow ).perform()
dataButton = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "//div[text()='Data']/..")))
ActionChains(driver).click( dataButton ).send_keys(Keys.ARROW_DOWN).send_keys(Keys.ARROW_DOWN).send_keys(
Keys.ARROW_RIGHT).send_keys(Keys.ENTER).perform()
time.sleep( timeout )
开发者ID:slovelan,项目名称:NRAODev,代码行数:27,代码来源:tRegion.py
示例16: test_unitChange
def test_unitChange(self):
driver = self.driver
timeout = selectBrowser._getSleep()
#Load a 2D image
Util.load_image( self, driver, "aH.fits")
#Get the old units
unitCombo = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "colorImageUnits")))
driver.execute_script( "arguments[0].scrollIntoView(true);", unitCombo )
unitText = unitCombo.find_element_by_xpath( ".//div/div")
oldUnits = unitText.text
print "Old units=", oldUnits
#Change the units
ActionChains(driver).click(unitCombo).send_keys( Keys.ARROW_DOWN).send_keys( Keys.ARROW_DOWN
).send_keys( Keys.ENTER).perform()
time.sleep( timeout )
#Verify the units are changed.
unitCombo = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "colorImageUnits")))
driver.execute_script( "arguments[0].scrollIntoView(true);", unitCombo )
unitText = unitCombo.find_element_by_xpath( ".//div/div")
newUnits = unitText.text
print "New units=",newUnits
self.assertTrue( newUnits != oldUnits, "Color map units did not change")
开发者ID:slovelan,项目名称:NRAODev,代码行数:26,代码来源:tColorMap.py
示例17: test_sameViewTwice
def test_sameViewTwice(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# Wait for the image window to be present (ensures browser is fully loaded)
imageWindow = WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))
# Get the image window count and make sure it is non-zero
imageWindowList = driver.find_elements_by_xpath("//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")
imageWindowCount = len( imageWindowList )
print "Original image count ", imageWindowCount
self.assertGreater( imageWindowCount, 0, "There are not any images")
# Locate an image window and bring up the right-context menu,
# changing to a CasaImageLoader.
imageWindow = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")))
ActionChains(driver).context_click( imageWindow ).perform();
# Change the plugin to another image loader
ActionChains(driver).send_keys( Keys.ARROW_DOWN).send_keys( Keys.ARROW_DOWN).send_keys( Keys.ARROW_RIGHT).send_keys(Keys.ENTER).perform()
time.sleep( timeout )
# Verify that the image count has remained the same
imageWindowList2 = driver.find_elements_by_xpath("//div[@qxclass='skel.widgets.Window.DisplayWindowImage']")
newImageWindowCount = len( imageWindowList2 )
print "New Image Count ", newImageWindowCount
self.assertEqual( imageWindowCount, newImageWindowCount, "Image window count did not remain the same")
开发者ID:Astroua,项目名称:CARTAvis,代码行数:26,代码来源:tView.py
示例18: test_channelAnimatorChangeImage
def test_channelAnimatorChangeImage(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# Load two images
# The images have different numbers of channels
Util.load_image(self, driver, "Default")
Util.load_image(self, driver, "aH.fits")
# Go to the first image
self._getFirstValue(driver, "Image")
# Go to the last channel of the image
self._getLastValue(driver, "Channel")
# Get the last channel value of the first image
firstImageChannelValue = self._getCurrentValue(driver, "Channel")
print "firstImageChannelValue=", firstImageChannelValue
# Go to the next image
self._getNextValue(driver, "Image")
# Go to the last channel of the image
self._getLastValue(driver, "Channel")
# Get the channel upper spin box value of the second image
# Check that the upper spin box value updated
# Get the channel upper spin box value of the first image
secondImageChannelValue = self._getCurrentValue(driver, "Channel")
print "First image channel ", firstImageChannelValue, " second image channel ", secondImageChannelValue
self.assertNotEqual(
int(secondImageChannelValue),
int(firstImageChannelValue),
"Channel value did not update after changing image in window",
)
开发者ID:confluence,项目名称:CARTAvis,代码行数:35,代码来源:tAnimatorSettings.py
示例19: test_rangeMethod
def test_rangeMethod(self):
driver = self.driver
timeout = selectBrowser._getSleep()
#Load a default image
Util.load_image( self, driver, "aH.fits")
#Show the image settings
Util.openSettings( self, driver, "Image", True )
# Navigate to Contour tab of the Histogram Settings
self._clickContourTab( driver )
# Set a minimum contour level of 0.1 and a maximum contour level of 0.9
self._typeText( driver, "imageContourLevelMin", 0.1 )
self._typeText( driver, "imageContourLevelMax", 0.9 )
# Change the level count to 3.
self._setLevelCount( driver, 3 )
# Hit the Add/Update ContourSet button
self._clickAddContourSetButton( driver )
# Check that there is now a Tab called Default under Contour Sets
self._clickDefaultContourSetTab( driver )
# Check that we have levels 0.1, 0.5, 0.9
levels = self._getLevels( driver, "contourLevelListDefault" )
self.assertEqual( len(levels), 3, "Three contour levels were not generated")
self.assertEqual( levels[0], str(0.1), "First contour was not 0.1")
self.assertEqual( levels[1], str(0.5), "Second contour was not 0.5")
self.assertEqual( levels[2], str(0.9), "Third contour was not 0.9")
开发者ID:Astroua,项目名称:CARTAvis,代码行数:33,代码来源:tContour.py
示例20: test_layout_image
def test_layout_image(self):
driver = self.driver
timeout = selectBrowser._getSleep()
# Wait for the image window to be present (ensures browser is fully loaded)
imageWindow = WebDriverWait(driver, 30).until(
EC.visibility_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']"))
)
# Find the layout button on the menu bar and click it.
self._clickLayoutButton(driver)
# Find the layout image button in the submenu and click it.
imageLayoutButton = driver.find_element_by_xpath("//div[text()='Image Layout']/..")
# imageLayoutButton = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//div[text()='Image Layout']/..")))
ActionChains(driver).click(imageLayoutButton).perform()
time.sleep(timeout)
# Check that there is an Image Window
imageWindow = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.XPATH, "//div[@qxclass='skel.widgets.Window.DisplayWindowImage']"))
)
# Check that there are no other Windows
windowCount = Util.get_window_count(self, driver)
self.assertEqual(windowCount, 1, "Image Layout should have only one window")
开发者ID:durga2112,项目名称:CARTAvis,代码行数:26,代码来源:tLayout.py
注:本文中的selectBrowser._getSleep函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论