def detach_volume_from_volumes_lp(self, volume_id, timeout_in_seconds=240): """ Navigate to volumes landing page. Detach volume. :param instance_id: :param volume_id: """ BasePage(self).goto_volumes_view_via_menu() VolumeLanding(self).click_action_detach_volume_on_view_page(volume_id) DetachVolumeModal(self).detach_volume(volume_id) VolumeLanding(self).verify_volume_status_is_available(volume_id, timeout_in_seconds)
def delete_volume_from_view_page(self, volume_id, timeout_in_seconds=240): """ Navigates to volumes view page and deletes volume. :param timeout_in_seconds: :param volume_id: """ BasePage(self).goto_volumes_view_via_menu() VolumeLanding(self).click_action_delete_volume_on_view_page(volume_id) DeleteVolumeModal(self).delete_volume() VolumeLanding(self).verify_volume_status_is_deleted(volume_id, timeout_in_seconds)
def attach_volume_from_volume_lp(self, instance_id, volume_id, device=None, timeout_in_seconds=240): """ Navigates to volumes landing page, attaches a given volume to a given instance. :param device: :param timeout_in_seconds: :param instance_id: :param volume_id: """ BasePage(self).goto_volumes_view_via_menu() VolumeLanding(self).click_action_attach_to_instance(volume_id) AttachVolumeModalSelectInstance(self).attach_volume(instance_id, device) VolumeLanding(self).verify_volume_status_is_attached(volume_id, timeout_in_seconds)
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: """ 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 verify_sort_position_for_volume(self, volume_id, position=1): """ :param volume_id: :param position: sorting position. Note: not zero-based (e.g. use 1 for first row) :type position: int """ VolumeLanding(self).verify_volume_id_by_sort_position(volume_id, position=position)
def click_sortable_column_header_on_volumes_landing_page(self, column_name='name'): """ Sort volumes table by a given column (see <th> element's st-sort attr for possible column_name values) :param column_name: header column name :type column_name: str """ BasePage(self).goto_volumes_view_via_menu() VolumeLanding(self).click_sortable_column_header(column_name=column_name)
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 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 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_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