'Test checks possibility to create volume from snapshot
Steps:
1. Login to Horizon Dashboard as regular user
2. Navigate to Project -> Compute -> Volumes page
3. Create snapshot for existed volume
4. Create new volume from snapshot
5. Check the volume is created and has \'Available\' status
6. Delete volume snapshot
7. Delete volume'

def test_create_volume_from_snapshot(self):

    volumes_page = self.home_pg.go_to_compute_volumes_volumespage()
    volumes_snapshot_page = volumes_page.create_volume_snapshot(self.VOLUME_NAME, self.VOLUME_SNAPSHOT_NAME)
    self.assertTrue(volumes_page.find_message_and_dismiss(messages.INFO))
    self.assertFalse(volumes_page.find_message_and_dismiss(messages.ERROR))
    self.assertTrue(volumes_snapshot_page.is_volume_snapshot_available(self.VOLUME_SNAPSHOT_NAME))
    new_volume = ('new_' + self.VOLUME_NAME)
    volumes_snapshot_page.create_volume_from_snapshot(self.VOLUME_SNAPSHOT_NAME, new_volume)
    self.assertTrue(volumes_page.is_volume_present(new_volume))
    self.assertTrue(volumes_page.is_volume_status(new_volume, 'Available'))
    volumes_snapshot_page = self.volumes_snapshot_page
    volumes_snapshot_page.delete_volume_snapshot(self.VOLUME_SNAPSHOT_NAME)
    self.assertTrue(volumes_snapshot_page.find_message_and_dismiss(messages.SUCCESS))
    self.assertFalse(volumes_snapshot_page.find_message_and_dismiss(messages.ERROR))
    self.assertTrue(volumes_snapshot_page.is_volume_snapshot_deleted(self.VOLUME_SNAPSHOT_NAME))
    volumes_page = volumes_snapshot_page.switch_to_volumes_tab()
    volumes_page.delete_volume(new_volume)
    self.assertTrue(volumes_page.find_message_and_dismiss(messages.SUCCESS))
    self.assertFalse(volumes_page.find_message_and_dismiss(messages.ERROR))
    self.assertTrue(volumes_page.is_volume_deleted(new_volume))
