[oe-commits] [bitbake] 05/05: toaster: tests test_new_project_page Catch button not enabled exception

git at git.openembedded.org git at git.openembedded.org
Wed Aug 10 23:07:51 UTC 2016


rpurdie pushed a commit to branch master
in repository bitbake.

commit 06f74fe91f8e162f49a4e856a62a97093b48262a
Author: Michael Wood <michael.g.wood at intel.com>
AuthorDate: Fri Aug 5 09:26:49 2016 +0100

    toaster: tests test_new_project_page Catch button not enabled exception
    
    When using firefox and selenium we get an exception generated when a
    disabled button click is attempted. This should happen in the test but
    we need to catch the exception to make sure it doesn't cause the test to
    fail.
    
    [YOCTO #10056]
    
    Signed-off-by: Michael Wood <michael.g.wood at intel.com>
    Signed-off-by: Elliot Smith <elliot.smith at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/toaster/tests/browser/test_new_project_page.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/toaster/tests/browser/test_new_project_page.py b/lib/toaster/tests/browser/test_new_project_page.py
index 1b038ac..77e5f15 100644
--- a/lib/toaster/tests/browser/test_new_project_page.py
+++ b/lib/toaster/tests/browser/test_new_project_page.py
@@ -22,6 +22,7 @@
 from django.core.urlresolvers import reverse
 from tests.browser.selenium_helpers import SeleniumTestCase
 from selenium.webdriver.support.ui import Select
+from selenium.common.exceptions import InvalidElementStateException
 
 from orm.models import Project, Release, BitbakeVersion
 
@@ -102,7 +103,10 @@ class TestNewProjectPage(SeleniumTestCase):
 
         # Try and click it anyway, if it submits we'll have a new project in
         # the db and assert then
-        self.click("#create-project-button")
+        try:
+            self.click("#create-project-button")
+        except InvalidElementStateException:
+            pass
 
         self.assertTrue(
             (Project.objects.filter(name=project_name).count() == 1),

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list