mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
ejabberd: functional tests: Wait until the jsxc buddy list is loaded
Fixes #1894 Tests performed: - All the ejabberd tests pass on both Debian testing and stable Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
1ea6b0b176
commit
aa54421216
@ -49,6 +49,18 @@ def _disable_message_archive_management(browser):
|
|||||||
'disabled')
|
'disabled')
|
||||||
|
|
||||||
|
|
||||||
|
def _is_jsxc_buddy_list_loaded(browser):
|
||||||
|
"""Return whether the jsxc buddy list has been loaded."""
|
||||||
|
if browser.find_by_text('new contact'):
|
||||||
|
# no contacts
|
||||||
|
return True
|
||||||
|
|
||||||
|
buddy_list = browser.find_by_id('jsxc_buddylist').first
|
||||||
|
contacts = buddy_list.find_by_css('.jsxc_rosteritem')
|
||||||
|
|
||||||
|
return len(contacts) > 0
|
||||||
|
|
||||||
|
|
||||||
def _jsxc_login(browser):
|
def _jsxc_login(browser):
|
||||||
"""Login to JSXC."""
|
"""Login to JSXC."""
|
||||||
username = functional.config['DEFAULT']['username']
|
username = functional.config['DEFAULT']['username']
|
||||||
@ -71,6 +83,7 @@ def _jsxc_add_contact(browser):
|
|||||||
functional.set_domain_name(browser, 'localhost')
|
functional.set_domain_name(browser, 'localhost')
|
||||||
functional.install(browser, 'jsxc')
|
functional.install(browser, 'jsxc')
|
||||||
_jsxc_login(browser)
|
_jsxc_login(browser)
|
||||||
|
functional.eventually(_is_jsxc_buddy_list_loaded, args=[browser])
|
||||||
new = browser.find_by_text('new contact')
|
new = browser.find_by_text('new contact')
|
||||||
if new: # roster is empty
|
if new: # roster is empty
|
||||||
new.first.click()
|
new.first.click()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user