def verify_charts_on_volume_monitoring_page(self, volume_id): """ Volume Monitoring page should display charts when attached to an instance :param volume_id: """ BasePage(self).goto_volumes_view_via_menu() VolumeLanding(self).goto_volume_detail_page_via_actions(volume_id) VolumeDetailPage(self).goto_monitoring_tab(volume_id) VolumeDetailPage(self).verify_charts_on_volume_monitoring_page(volume_id)
def verify_attach_notice_on_volume_monitoring_page(self, volume_id): """ Volume Monitoring page should display notice to attach volume to instance when unattached :param volume_id: """ BasePage(self).goto_volumes_view_via_menu() VolumeLanding(self).goto_volume_detail_page_via_actions(volume_id) VolumeDetailPage(self).goto_monitoring_tab(volume_id) VolumeDetailPage(self).verify_attach_notice_on_volume_monitoring_page(volume_id)
def delete_volume_from_detail_page(self, volume_id, volume_name=None): """ Navigates to volume detail page and deletes volume. Waits for volume state to become 'deleted' on landing page. :param volume_id: :param volume_name: """ BasePage(self).goto_volumes_view_via_menu() VolumeView(self).goto_volume_detail_page_via_actions(volume_id) VolumeDetailPage(self).verify_volume_detail_page_loaded(volume_id, volume_name) VolumeDetailPage(self).click_action_delete_volume_on_detail_page() DeleteVolumeModal(self).delete_volume() VolumeView(self).verify_volume_status_is_deleted(volume_id, 240)
def attach_volume_from_volume_detail_page(self, instance_id, volume_id, device=None, timeout_in_seconds=240): """ Navigates to volume detail page, attaches volume to instance. :param instance_id: :param volume_id: :param device: :param timeout_in_seconds: """ BasePage(self).goto_volumes_view_via_menu() VolumeLanding(self).goto_volume_detail_page_via_link(volume_id) VolumeDetailPage(self).click_action_attach_volume_on_detail_page() AttachVolumeModalSelectInstance(self).attach_volume(instance_id, device=device) VolumeDetailPage(self).verify_volume_status_is_attached(timeout_in_seconds)
def create_volume_from_snapshot_on_snapshot_lp(self, snapshot_id, volume_name=None, availability_zone=None, volume_size=None, timeout_in_seconds=240): """ Navigates to snapshot landing page. Goes to "create volume from snapshot" in the actions menu. Creates volume from snapshot. :param snapshot_id: :param volume_name: :param availability_zone: :param volume_size: :param timeout_in_seconds: """ BasePage(self).goto_snapshots_view_via_menu() SnapshotLanding(self).click_action_create_volume_from_snapshot(snapshot_id) CreateVolumeDialog(self).create_volume(volume_name, volume_size=volume_size, availability_zone=availability_zone, timeout_in_seconds=timeout_in_seconds) VolumeDetailPage(self).verify_volume_status_is_available(timeout_in_seconds=timeout_in_seconds) volume = VolumeDetailPage(self).get_volume_name_and_id() print volume return volume
def delete_volume_from_detail_page(self, volume_id, volume_name=None, timeout_in_seconds=240): """ Navigates to volume detail page and deletes volume. Waits for volume state to become 'deleted' on landing page. :param timeout_in_seconds: :param volume_id: :param volume_name: """ print "" print "====== Running delete_volume_from_detail_page ======" print "" BasePage(self).goto_volumes_view_via_menu() VolumeLanding(self).goto_volume_detail_page_via_actions(volume_id) VolumeDetailPage(self).verify_volume_detail_page_loaded(volume_id, volume_name) VolumeDetailPage(self).click_action_delete_volume_on_detail_page() DeleteVolumeModal(self).delete_volume() VolumeLanding(self).verify_volume_status_is_deleted(volume_id, timeout_in_seconds)
def create_volume_from_view_page(self, volume_name=None, create_from_snapshot=False, snapshot_id = None, volume_size=None, availability_zone=None, timeout_in_seconds=240): """ Navigates to volumes view page and creates volume. :param volume_name: :param create_from_snapshot: :param snapshot_id: :param volume_size: :param availability_zone: """ BasePage(self).goto_volumes_view_via_menu() VolumeLanding(self).click_create_volume_btn_on_landing_page() CreateVolumeDialog(self).create_volume(volume_name, create_from_snapshot, snapshot_id, volume_size, availability_zone) VolumeDetailPage(self).verify_volume_status_is_available(timeout_in_seconds=timeout_in_seconds) volume = VolumeDetailPage(self).get_volume_name_and_id() print volume return volume
def create_snapshot_on_volume_detail_page(self, volume_id, snapshot_name=None, snapshot_description=None, timeout_in_seconds=240): """ Navigates to volume detail page and creates a snapshot. :param timeout_in_seconds: :param volume_id: :param snapshot_name: :param snapshot_description: """ BasePage(self).goto_volumes_view_via_menu() VolumeLanding(self).goto_volume_detail_page_via_actions(volume_id) VolumeDetailPage(self).click_create_snapshot_from_volume_tile(volume_id) CreateSnapshotModal(self).create_snapshot(snapshot_name, snapshot_description) VolumeDetailPage(self).goto_detail_page_of_newly_created_snapshot(volume_id) snapshot=SnapshotDetailPage(self).get_snapshot_name_and_id(snapshot_name) SnapshotDetailPage(self).verify_snapshot_status_is_completed(timeout_in_seconds) print snapshot return snapshot
def create_volume_from_dashboard(self, volume_name=None, create_from_snapshot=False,snapshot_id=None, volume_size=None, availability_zone=None, timeout_in_seconds=240 ): """ Navigates to dashboard and creates volume. :param volume_name: :param create_from_snapshot: :param snapshot_id: :param volume_size: :param availability_zone: :param timeout_in_seconds: """ BasePage(self).goto_dashboard_via_menu() Dashboard(self).click_create_volume_link() CreateVolumeDialog(self).create_volume(volume_name=volume_name, create_from_snapshot=create_from_snapshot, snapshot_id=snapshot_id, volume_size=volume_size, availability_zone=None) VolumeDetailPage(self).verify_volume_status_is_available(timeout_in_seconds=timeout_in_seconds) volume = VolumeDetailPage(self).get_volume_name_and_id() print volume return volume