From 86d2d4a11be0b5a87e8464e45114c41d934be690 Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Fri, 19 Jun 2015 18:15:28 +0200 Subject: [PATCH] Wait until the image is registered in Sahara image test The tests consistently fails, probably because the availability of the image in the table is checked too soon. Add a bit of delay with a new wait method. Change-Id: I9e39c35fb67455b4e4f3c2b12265b8540420ad01 Closes-Bug: #1466744 --- .../pages/project/data_processing/imageregistrypage.py | 3 +++ .../test/integration_tests/tests/test_sahara_image_registry.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openstack_dashboard/test/integration_tests/pages/project/data_processing/imageregistrypage.py b/openstack_dashboard/test/integration_tests/pages/project/data_processing/imageregistrypage.py index 429287e689..310035a7d5 100644 --- a/openstack_dashboard/test/integration_tests/pages/project/data_processing/imageregistrypage.py +++ b/openstack_dashboard/test/integration_tests/pages/project/data_processing/imageregistrypage.py @@ -76,3 +76,6 @@ class ImageregistryPage(basepage.BaseNavigationPage): self.register_form.user_name.text = user_name self.register_form.description.text = description self.register_form.submit.click() + + def wait_until_image_registered(self, name): + self._wait_until(lambda x: self.is_image_registered(name)) diff --git a/openstack_dashboard/test/integration_tests/tests/test_sahara_image_registry.py b/openstack_dashboard/test/integration_tests/tests/test_sahara_image_registry.py index 15fa86c5dd..cd9854c141 100644 --- a/openstack_dashboard/test/integration_tests/tests/test_sahara_image_registry.py +++ b/openstack_dashboard/test/integration_tests/tests/test_sahara_image_registry.py @@ -16,8 +16,6 @@ from openstack_dashboard.test.integration_tests.tests import decorators IMAGE_NAME = helpers.gen_random_resource_name("image") -# TODO(svasheka): Fix test_sahara_image_registry and turn it back on. -@decorators.skip_because(bugs=["1466744"]) @decorators.services_required("sahara") class TestSaharaImageRegistry(helpers.TestCase): @@ -32,6 +30,7 @@ class TestSaharaImageRegistry(helpers.TestCase): image_reg_pg = self.home_pg.go_to_dataprocessing_imageregistrypage() image_reg_pg.register_image(IMAGE_NAME, self.CONFIG.scenario.ssh_user, "Test description") + image_reg_pg.wait_until_image_registered(IMAGE_NAME) self.assertTrue(image_reg_pg.is_image_registered(IMAGE_NAME), "Image was not registered.") self.assertFalse(image_reg_pg.is_error_message_present(),