summaryrefslogtreecommitdiff
path: root/service/test/functional/features/steps/mail_list.py
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-09-10 14:54:45 +0200
committerFolker Bernitt <fbernitt@thoughtworks.com>2015-09-10 14:54:45 +0200
commitd411d38b8160e48540ee13e36fdfd6d06b8709c8 (patch)
tree04130fa2398736e4d277ebbde42e2e2269a0937a /service/test/functional/features/steps/mail_list.py
parentf9ac80e67e0a6d27a41316bee52e554d67fe3cbd (diff)
Add 'with ImplicitWait' to allow shorter timeouts
- necessary if elements do not exist, selenium seems to wait the entire explict timeout in this case
Diffstat (limited to 'service/test/functional/features/steps/mail_list.py')
-rw-r--r--service/test/functional/features/steps/mail_list.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/service/test/functional/features/steps/mail_list.py b/service/test/functional/features/steps/mail_list.py
index bae77c52..7962ee28 100644
--- a/service/test/functional/features/steps/mail_list.py
+++ b/service/test/functional/features/steps/mail_list.py
@@ -15,7 +15,6 @@
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
from common import *
from selenium.common.exceptions import NoSuchElementException
-from time import sleep
def find_current_mail(context):
@@ -94,16 +93,19 @@ def impl(context):
@when('I delete the email')
def impl(context):
def last_email():
- return wait_until_elements_are_visible_by_locator(context, (By.CSS_SELECTOR, '#mail-list li'))[0]
- context.current_mail_id = last_email().get_attribute('id')
- last_email().find_element_by_tag_name('input').click()
+ return wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, '#mail-list li'))
+ mail = last_email()
+ context.current_mail_id = mail.get_attribute('id')
+ mail.find_element_by_tag_name('input').click()
find_element_by_id(context, 'delete-selected').click()
_wait_for_mail_list_to_be_empty(context)
def _wait_for_mail_list_to_be_empty(context):
wait_for_loading_to_finish(context)
- assert 0 == len(context.browser.find_elements_by_css_selector('#mail-list li'))
+
+ with ImplicitWait(context, timeout=0.1):
+ assert 0 == len(context.browser.find_elements_by_css_selector('#mail-list li'))
@when('I check all emails')