Created
November 15, 2013 15:51
-
-
Save weissjeffm/7486569 to your computer and use it in GitHub Desktop.
nav data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def menu_item(text): | |
return "//div[@class='navbar']/a[.='{}']".format(text) | |
def make_menu_items(dct): | |
return {k: menu_item(v) for k, v in dct} | |
menu = Region(locators= | |
make_menu_items( | |
{'cloud_intelligence': 'Cloud Intelligence', | |
'services': 'Services', | |
'clouds': 'Services', | |
'infrastructure': 'Infrastructure', | |
'control': 'Control', | |
'automate': 'Automate', | |
'optimize': 'Optimize', | |
'configure': 'Configuration', | |
"dashboard": 'Dashboard', # Cloud Intelligence | |
"reports": 'Reports', | |
"usage": 'Usage', | |
"chargeback": 'Chargeback', | |
"timelines": 'Timelines', | |
"rss": 'RSS', | |
"my_services": "My Services", # Services | |
"catalogs": "Catalogs", | |
"requests": "Requests", | |
"workloads": "workloads", | |
"providers": ""})) | |
def move_to_fn(el): | |
return lambda: move_to_element(el) | |
def click_fn(el): | |
return lambda: click(el) | |
menu_tree = [["cloud_intelligence", move_to_fn(menu.cloud_intelligence), | |
[["dashboard", lambda: None], | |
["reports", click_fn(menu.reports)], | |
["usage", lambda: None], | |
["chargeback", click_fn(menu.chargeback)], | |
["timelines", lambda: None], | |
["rss", lambda: None]], | |
["services", move_to_fn(menu.services), | |
[]], | |
["clouds", move_to_fn(menu.clouds), | |
[]], | |
["infrastructure", move_to_fn(menu.infrastructure), | |
[]], | |
["control", move_to_fn(menu.control), | |
[]], | |
["automate", move_to_fn(menu.automate), | |
[]], | |
["optimize", move_to_fn(menu.optimize), | |
[]], | |
["configure", move_to_fn(menu.configure), | |
[]]] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment