'This test case checks launch instance from image functionality:
Steps:
1. Login to Horizon Dashboard as regular user
2. Navigate to Project -> Compute -> Images
3. Launch new instance from image
4. Check that instance is create
5. Check that status of newly created instance is Active
6. Check that image_name in correct in instances table'

def test_launch_instance_from_image(self):

    images_page = self.images_page
    source_image = self.CONFIG.image.images_list[0]
    target_instance = 'created_from_{0}'.format(source_image)
    instances_page = images_page.launch_instance_from_image(source_image, target_instance)
    self.assertTrue(instances_page.find_message_and_dismiss(messages.SUCCESS))
    self.assertFalse(instances_page.find_message_and_dismiss(messages.ERROR))
    self.assertTrue(instances_page.is_instance_active(target_instance))
    actual_image_name = instances_page.get_image_name(target_instance)
    self.assertEqual(source_image, actual_image_name)
    instances_page.delete_instance(target_instance)
    self.assertTrue(instances_page.find_message_and_dismiss(messages.SUCCESS))
    self.assertFalse(instances_page.find_message_and_dismiss(messages.ERROR))
    self.assertTrue(instances_page.is_instance_deleted(target_instance))
