'This test case checks create volume from image functionality:
Steps:
1. Login to Horizon Dashboard as regular user
2. Navigate to Project -> Compute -> Images
3. Create new volume from image
4. Check that volume is created with expected name
5. Check that volume status is Available'

def test_create_volume_from_image(self):

    images_page = self.images_page
    source_image = self.CONFIG.image.images_list[0]
    target_volume = 'created_from_{0}'.format(source_image)
    volumes_page = images_page.create_volume_from_image(source_image, volume_name=target_volume)
    self.assertTrue(volumes_page.find_message_and_dismiss(messages.INFO))
    self.assertFalse(volumes_page.find_message_and_dismiss(messages.ERROR))
    self.assertTrue(volumes_page.is_volume_present(target_volume))
    self.assertTrue(volumes_page.is_volume_status(target_volume, 'Available'))
    volumes_page.delete_volume(target_volume)
    volumes_page.find_message_and_dismiss(messages.SUCCESS)
    volumes_page.find_message_and_dismiss(messages.ERROR)
    self.assertTrue(volumes_page.is_volume_deleted(target_volume))
