[gnome-continuous-yocto/gnomeostree-3.28-rocko: 1308/8267] bitbake: toaster-tests: new custom image button shouldn't show for non-image builds



commit 8ccf8392aa07c14b99f946585f27aff8f2e425de
Author: Elliot Smith <elliot smith intel com>
Date:   Tue Jul 12 15:54:57 2016 -0700

    bitbake: toaster-tests: new custom image button shouldn't show for non-image builds
    
    [YOCTO #9514]
    
    (Bitbake rev: 9bc014d89434400c1493fa9f07ce3a51d37dab51)
    
    Signed-off-by: Elliot Smith <elliot smith intel com>
    Signed-off-by: bavery <brian avery intel com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 .../tests/browser/test_builddashboard_page.py      |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py 
b/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py
index cdb0616..14e77a3 100644
--- a/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py
+++ b/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py
@@ -48,6 +48,10 @@ class TestBuildDashboardPage(SeleniumTestCase):
                                            started_on=now,
                                            completed_on=now)
 
+        self.build3 = Build.objects.create(project=project,
+                                           started_on=now,
+                                           completed_on=now)
+
         # exception
         msg1 = 'an exception was thrown'
         self.exception_message = LogMessage.objects.create(
@@ -71,6 +75,11 @@ class TestBuildDashboardPage(SeleniumTestCase):
             layer=layer, build=self.build1
         )
 
+        # non-image recipes related to a build, for testing the new custom
+        # image button
+        layer_version2 = Layer_Version.objects.create(layer=layer,
+            build=self.build3)
+
         # image recipes
         self.image_recipe1 = Recipe.objects.create(
             name='recipeA',
@@ -248,3 +257,14 @@ class TestBuildDashboardPage(SeleniumTestCase):
         ]
 
         self._check_labels_in_modal(modal, expected_recipes)
+
+    def test_new_custom_image_button_no_image(self):
+        """
+        Check that a build which builds non-image recipes doesn't show
+        the new custom image button on the dashboard.
+        """
+        self._get_build_dashboard(self.build3)
+        selector = '[data-role="new-custom-image-trigger"]'
+        self.assertFalse(self.element_exists(selector),
+            'new custom image button should not show for builds which ' \
+            'don\'t have any image recipes')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]