當前位置: 首頁>>代碼示例>>Python>>正文


Python GuiOps.attach_volume_from_volume_detail_page方法代碼示例

本文整理匯總了Python中guiops.guiops.GuiOps.attach_volume_from_volume_detail_page方法的典型用法代碼示例。如果您正苦於以下問題:Python GuiOps.attach_volume_from_volume_detail_page方法的具體用法?Python GuiOps.attach_volume_from_volume_detail_page怎麽用?Python GuiOps.attach_volume_from_volume_detail_page使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在guiops.guiops.GuiOps的用法示例。


在下文中一共展示了GuiOps.attach_volume_from_volume_detail_page方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: VolumeOperationsSequence

# 需要導入模塊: from guiops.guiops import GuiOps [as 別名]
# 或者: from guiops.guiops.GuiOps import attach_volume_from_volume_detail_page [as 別名]
class VolumeOperationsSequence(GuiOps):

    def __init__(self):
        parser = Option_parser()
        self.console_url = parser.parse_options()['console_url']
        self.webdriver_url = parser.parse_options()['web_driver']
        self.account = parser.parse_options()['account']
        self.user = parser.parse_options()['user_name']
        self.password = parser.parse_options()['password']
        self.sauce = parser.parse_options()['sauce']
        self.browser = parser.parse_options()['browser']
        self.version = parser.parse_options()['version']
        self.platform = parser.parse_options()['platform']
        self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url,
                             sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform)

    def volume_ops_test(self):
        self.tester.login(self.account, self.user, self.password)
        volume1_name = self.id_generator()+"-volume"
        volume1 = self.tester.create_volume_from_view_page(volume1_name, volume_size=2, availability_zone="one")
        volume1_id = volume1.get("volume_id")
        instance1 = self.tester.launch_instance_from_dashboard(availability_zone="one", timeout_in_seconds=400)
        instance1_id = instance1.get("instance_id")
        self.tester.verify_attach_notice_on_volume_monitoring_page(volume1_id)
        self.tester.attach_volume_from_instance_detail_page(volume1_id, instance1_id, timeout_in_seconds=400)
        self.tester.verify_charts_on_volume_monitoring_page(volume1_id)
        self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=800)
        self.tester.attach_volume_from_instance_lp(volume1_id, instance1_id, timeout_in_seconds=800)
        self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=800)
        self.tester.attach_volume_from_volume_detail_page(instance1_id, volume1_id, device="/dev/vdd",
                                                          timeout_in_seconds=800)
        self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=800)
        self.tester.attach_volume_from_volume_lp(instance1_id, volume1_id, timeout_in_seconds=800)
        self.tester.terminate_instance_from_view_page(instance1_id)
        self.tester.delete_volume_from_view_page(volume1_id)
        volume2 = self.tester.create_volume_from_dashboard(volume_size=3, availability_zone="two")
        volume2_id = volume2.get("volume_id")
        self.tester.delete_volume_from_detail_page(volume2_id)
        self.sortable_volumes_tables_test()
        self.tester.logout()
        self.tester.exit_browser()

    def sortable_volumes_tables_test(self):
        volume1_name = "!!!!"+self.id_generator()+"-volume"
        volume1 = self.tester.create_volume_from_view_page(volume1_name, volume_size=1, availability_zone="one")
        volume1_id = volume1.get("volume_id")
        volume2_name = "~~~~"+self.id_generator()+"-volume"
        volume2 = self.tester.create_volume_from_dashboard(volume2_name, volume_size=1, availability_zone="one")
        volume2_id = volume2.get("volume_id")
        # Test ascending sort by name column
        self.tester.click_sortable_column_header_on_volumes_landing_page(column_name='name')
        self.tester.verify_sort_position_for_volume(volume1_id, position=1)
        # Test descending sort by name column (second click sorts descending)
        self.tester.click_sortable_column_header_on_volumes_landing_page(column_name='name')
        self.tester.verify_sort_position_for_volume(volume2_id, position=1)
        # Cleanup volumes
        self.tester.delete_volume_from_view_page(volume1_id)
        self.tester.delete_volume_from_view_page(volume2_id)
開發者ID:datatonic,項目名稱:eucaconsole,代碼行數:60,代碼來源:volumes.py

示例2: Volume_operations_sequence

# 需要導入模塊: from guiops.guiops import GuiOps [as 別名]
# 或者: from guiops.guiops.GuiOps import attach_volume_from_volume_detail_page [as 別名]
class Volume_operations_sequence(GuiOps):

    def __init__(self):
        parser = Option_parser()
        self.console_url = parser.parse_options()['console_url']
        self.webdriver_url = parser.parse_options()['web_driver']
        self.account = parser.parse_options()['account']
        self.user = parser.parse_options()['user_name']
        self.password = parser.parse_options()['password']
        self.sauce = parser.parse_options()['sauce']
        self.browser = parser.parse_options()['browser']
        self.version = parser.parse_options()['version']
        self.platform = parser.parse_options()['platform']
        self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform)

    def id_generator(self, size = 6, chars=string.ascii_uppercase + string.digits):
        return ''.join(random.choice(chars) for j in range(size))

    def volume_ops_test(self):
        self.tester.login(self.account, self.user, self.password)
        volume1_name = self.id_generator()+"-volume"
        volume1 = self.tester.create_volume_from_view_page(volume1_name, volume_size=2, availability_zone="one")
        volume1_id = volume1.get("volume_id")
        instance1=self.tester.launch_instance_from_dashboard(availability_zone="one", timeout_in_seconds=400)
        instance1_id=instance1.get("instance_id")
        self.tester.attach_volume_from_instance_detail_page(volume1_id, instance1_id,timeout_in_seconds=400)
        self.tester.detach_volume_from_volumes_lp(volume1_id,timeout_in_seconds=400)
        self.tester.attach_volume_from_instance_lp(volume1_id, instance1_id,timeout_in_seconds=400)
        self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=400)
        self.tester.attach_volume_from_volume_detail_page(instance1_id, volume1_id, device="/dev/vdd", timeout_in_seconds=400)
        self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=400)
        self.tester.attach_volume_from_volume_lp(instance1_id, volume1_id, timeout_in_seconds=400)
        self.tester.terminate_instance_from_view_page(instance1_id)
        self.tester.delete_volume_from_view_page(volume1_id)
        volume2=self.tester.create_volume_from_dashboard(volume_size=3, availability_zone="two")
        volume2_id=volume2.get("volume_id")
        self.tester.delete_volume_from_detail_page(volume2_id)
        self.tester.logout()
        self.tester.exit_browser()
開發者ID:mbacchi,項目名稱:eucaconsole,代碼行數:41,代碼來源:volumes.py


注:本文中的guiops.guiops.GuiOps.attach_volume_from_volume_detail_page方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。