* [PATCH] toaster: tests test_new_project_page Catch button not enabled exception
@ 2016-08-05 8:26 Elliot Smith
0 siblings, 0 replies; 3+ messages in thread
From: Elliot Smith @ 2016-08-05 8:26 UTC (permalink / raw)
To: bitbake-devel
From: Michael Wood <michael.g.wood@intel.com>
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@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
bitbake/lib/toaster/tests/browser/test_new_project_page.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bitbake/lib/toaster/tests/browser/test_new_project_page.py b/bitbake/lib/toaster/tests/browser/test_new_project_page.py
index 1b038ac..77e5f15 100644
--- a/bitbake/lib/toaster/tests/browser/test_new_project_page.py
+++ b/bitbake/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),
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] toaster: tests test_new_project_page Catch button not enabled exception
2016-08-02 14:50 Michael Wood
@ 2016-08-05 8:30 ` Smith, Elliot
0 siblings, 0 replies; 3+ messages in thread
From: Smith, Elliot @ 2016-08-05 8:30 UTC (permalink / raw)
To: Michael Wood; +Cc: toaster
[-- Attachment #1: Type: text/plain, Size: 1978 bytes --]
Sent to bitbake-devel and added to toaster-next.
Thanks.
Elliot
On 2 August 2016 at 15:50, Michael Wood <michael.g.wood@intel.com> wrote:
> 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@intel.com>
> ---
> bitbake/lib/toaster/tests/browser/test_new_project_page.py | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/bitbake/lib/toaster/tests/browser/test_new_project_page.py
> b/bitbake/lib/toaster/tests/browser/test_new_project_page.py
> index 1b038ac..77e5f15 100644
> --- a/bitbake/lib/toaster/tests/browser/test_new_project_page.py
> +++ b/bitbake/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),
> --
> 2.7.4
>
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>
--
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
[-- Attachment #2: Type: text/html, Size: 2932 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] toaster: tests test_new_project_page Catch button not enabled exception
@ 2016-08-02 14:50 Michael Wood
2016-08-05 8:30 ` Smith, Elliot
0 siblings, 1 reply; 3+ messages in thread
From: Michael Wood @ 2016-08-02 14:50 UTC (permalink / raw)
To: toaster
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@intel.com>
---
bitbake/lib/toaster/tests/browser/test_new_project_page.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bitbake/lib/toaster/tests/browser/test_new_project_page.py b/bitbake/lib/toaster/tests/browser/test_new_project_page.py
index 1b038ac..77e5f15 100644
--- a/bitbake/lib/toaster/tests/browser/test_new_project_page.py
+++ b/bitbake/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),
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-05 8:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-05 8:26 [PATCH] toaster: tests test_new_project_page Catch button not enabled exception Elliot Smith
-- strict thread matches above, loose matches on Subject: below --
2016-08-02 14:50 Michael Wood
2016-08-05 8:30 ` Smith, Elliot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.