Univention Bugzilla – Attachment 5208 Details for
Bug 21728
UDM Web Test per Selenium
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Short python selenium test: Login at UMC, open app in appcenter
selenium-test.py (text/plain), 1.74 KB, created by
Sönke Schwardt-Krummrich
on 2013-04-30 13:21 CEST
(
hide
)
Description:
Short python selenium test: Login at UMC, open app in appcenter
Filename:
MIME Type:
Creator:
Sönke Schwardt-Krummrich
Created:
2013-04-30 13:21 CEST
Size:
1.74 KB
patch
obsolete
>#!/usr/bin/python >import selenium >import selenium.webdriver >import time >import sys > >class SeleniumUMC: > def __init__(self, url, username=None, password=None): > self.url = url > self.username = username if username else 'Administrator' > self.password = password if password else 'univention' > > def wait_for_func(self, timeout, func, *args): > success = False > timeout = time.time() + timeout > while not success: > try: > return func(*args) > success = True > except (selenium.common.exceptions.ElementNotVisibleException, > selenium.common.exceptions.NoSuchFrameException): > if time.time() > timeout: > raise > else: > time.sleep(0.1) > > def setup(self): > self.browser = selenium.webdriver.Firefox() > > def shutdown(self): > self.browser.close() > > def run_all_tests(self): > for func in [ x for x in dir(self) if x.startswith('test_') ]: > self.setup() > getattr(self, func)() > time.sleep(10) > self.shutdown() > > def perform_umc_login(self): > self.browser.get(self.url) > self.wait_for_func(10, self.browser.switch_to_frame, "umc_LoginDialog_Iframe") > elem = self.browser.find_element_by_name("username") > self.wait_for_func(10, elem.send_keys, self.username) > elem = self.browser.find_element_by_name("password") > elem.send_keys(self.password) > self.browser.find_element_by_id("umc_SubmitButton_label").click() > time.sleep(3) > self.browser.switch_to_default_content() > > >class SeleniumAppCenterOX(SeleniumUMC): > def test_open_ox_in_appcenter(self): > self.perform_umc_login() > time.sleep(3) > elem = self.wait_for_func(10, self.browser.find_element_by_class_name, 'umcAppCenter-icon50-apps-oxseforucs') > elem.click() > > >x = SeleniumAppCenterOX('http://10.200.18.35/univention-management-console/?module=appcenter') >x.run_all_tests() >sys.exit(0)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 21728
:
3087
| 5208 |
5209