本文整理汇总了Python中utils.appliance.implementations.ui.navigate_to函数的典型用法代码示例。如果您正苦于以下问题:Python navigate_to函数的具体用法?Python navigate_to怎么用?Python navigate_to使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了navigate_to函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_broken_angular_select
def test_broken_angular_select(request):
"""Test that checks the fancy selects do not break.
Prerequisities:
* A fresh downstream appliance
Steps:
1) Create a catalog.
2) Create a catalog item, can be Generic and assign the catalog and OSE Installer dialog
for testing purposes
3) Try ordering the service, but instead of confirming the form, try changing some select.
"""
# OSE Installer dialog, one dropdown from it
the_select = AngularSelect("param_operatingSystemType")
cat = Catalog("Test_catalog_{}".format(fauxfactory.gen_alpha()))
cat.create()
request.addfinalizer(cat.delete)
item = CatalogItem(
item_type="Generic",
name="Catitem_{}".format(fauxfactory.gen_alpha()),
description=fauxfactory.gen_alpha(),
display_in=True,
catalog=cat.name,
dialog="azure-single-vm-from-user-image")
item.create()
request.addfinalizer(item.delete)
sc = service_catalogs.ServiceCatalogs(item.name)
navigate_to(sc, 'Order')
# The check itself
fill(the_select, "Linux")
assert not the_select.is_broken, "The select displayed itself next ot the angular select"
示例2: load_details
def load_details(self, refresh=False):
navigate_to(self, 'Details')
if not self.db_id or refresh:
tmp_dmn = self.domain(method='db')
self.db_id = tmp_dmn.db_id
if refresh:
tb.refresh()
示例3: load_details
def load_details(self, refresh=False):
navigate_to(self, 'Details')
if not self.db_id or refresh:
tmp_ser = self.server(method='db')
self.db_id = tmp_ser.db_id
if refresh:
tb.refresh()
示例4: test_pull_splitter_persistence
def test_pull_splitter_persistence(location):
navigate_to(*location)
# First we move splitter to hidden position by pulling it left twice
pull_splitter_left()
pull_splitter_left()
navigate_to(Server, 'Dashboard')
try:
navigate_to(*location)
except (TypeError, CannotScrollException):
# this exception is expected here since
# some navigation commands try to use accordion when it is hidden by splitter
pass
# Then we check hidden position splitter
if not pytest.sel.elements("//div[@id='left_div'][contains(@class, 'hidden-md')]"):
pytest.fail("Splitter did not persist when on hidden position!")
# Then we iterate over all the other positions
for position in ["col-md-2", "col-md-3", "col-md-4", "col-md-5"]:
# Pull splitter left
pull_splitter_right()
navigate_to(Server, 'Dashboard')
navigate_to(*location)
# Then check its position
if not pytest.sel.elements("//div[@id='left_div'][contains(@class, {})]"
.format(unescape(quoteattr(position)))):
pytest.fail("Splitter did not persist when on " + str(position) + " position!")
示例5: download
def download(self, extension):
navigate_to(self, "Details")
extensions_mapping = {'txt': 'Text', 'csv': 'CSV', 'pdf': 'PDF'}
try:
download_btn("Download as {}".format(extensions_mapping[extension]))
except:
raise ValueError("Unknown extention. check the extentions_mapping")
示例6: _get_state
def _get_state():
navigate_to(cls, 'Saved')
row = records_table.find_row("queued_at", queued_at)
status = sel.text(row.status).strip().lower()
assert status != "error", sel.text(row)
return status == version.pick({"5.6": "finished",
"5.7": "complete"})
示例7: create
def create(self):
navigate_to(self, 'Add')
fill(self.form, {'name_txt': self.name,
'vm_restriction_select': self.vm_restriction,
'product_features_tree': self.product_features},
action=form_buttons.add)
flash.assert_success_message('Role "{}" was saved'.format(self.name))
示例8: update
def update(self, updates):
navigate_to(self, 'Edit')
fill(self.form, {'name_txt': updates.get('name'),
'vm_restriction_select': updates.get('vm_restriction'),
'product_features_tree': updates.get('product_features')},
action=form_buttons.save)
flash.assert_success_message('Role "{}" was saved'.format(updates.get('name', self.name)))
示例9: _retrieve_ext_auth_user_groups
def _retrieve_ext_auth_user_groups(self):
navigate_to(self, 'Add')
fill(self.group_form, {'lookup_ldap_groups_chk': True,
'user_to_look_up': self.user_to_lookup,
},)
sel.wait_for_element(form_buttons.retrieve)
sel.click(form_buttons.retrieve)
示例10: delete
def delete(self, from_dest='All'):
"""
Delete the stack, starting from the destination provided by from_dest
@param from_dest: where to delete from, a valid navigation destination for Stack
"""
# Navigate to the starting destination
if from_dest in navigator.list_destinations(self):
navigate_to(self, from_dest)
else:
msg = 'cfme.cloud.stack does not have destination {}'.format(from_dest)
raise DestinationNotFound(msg)
# Delete using the method appropriate for the starting destination
if from_dest == 'All':
sel.check(Quadicon(self.name, self.quad_name).checkbox())
cfg_btn("Remove Orchestration Stacks", invokes_alert=True)
elif from_dest == 'Details':
cfg_btn("Remove this Orchestration Stack", invokes_alert=True)
sel.handle_alert()
# The delete initiated message may get missed if the delete is fast
try:
flash.assert_message_contain("Delete initiated for 1 Orchestration Stacks")
except FlashMessageException as ex:
if 'No flash message contains' in ex.message:
flash.assert_message_contain("The selected Orchestration Stacks was deleted")
self.wait_for_delete()
示例11: exists
def exists(self):
try:
navigate_to(self, 'Details')
except CandidateNotFound:
return False
else:
return True
示例12: discover
def discover(credential, cancel=False, d_type="Amazon"):
"""
Discover cloud providers. Note: only starts discovery, doesn't
wait for it to finish.
Args:
credential (cfme.Credential): Amazon discovery credentials.
cancel (boolean): Whether to cancel out of the discover UI.
"""
navigate_to(CloudProvider, "Discover")
form_data = {"discover_select": d_type}
if credential:
form_data.update(
{
"username": credential.principal,
"password": credential.secret,
"password_verify": credential.verify_secret,
}
)
fill(
discover_form,
form_data,
action=form_buttons.cancel if cancel else discover_form.start_button,
action_always=True,
)
示例13: load_details
def load_details(self):
# todo: to remove this context related functionality along with making provider
# param mandatory
if not self.provider:
navigate_to(self, 'Details')
else:
navigate_to(self, 'DetailsFromProvider')
示例14: load_details
def load_details(self, refresh=False):
navigate_to(self, 'Details')
if not self.db_id or refresh:
tmp_dsource = self.datasource(method='db')
self.db_id = tmp_dsource.db_id
if refresh:
tb.refresh()
示例15: queue_canned_report
def queue_canned_report(cls, path):
"""Queue report from selection of pre-prepared reports.
Args:
*path: Path in tree after All Reports
Returns: Value of Run At in the table so the run can be then checked.
"""
cls.path = path
navigate_to(cls, "Info")
toolbar.select("Queue")
flash.assert_no_errors()
tabstrip.select_tab("Saved Reports")
queued_at = sel.text(list(records_table.rows())[0].queued_at)
def _get_state():
navigate_to(cls, 'Saved')
row = records_table.find_row("queued_at", queued_at)
status = sel.text(row.status).strip().lower()
assert status != "error", sel.text(row)
return status == version.pick({"5.6": "finished",
"5.7": "complete"})
wait_for(
_get_state,
delay=3,
message="wait for report generation finished",
fail_func=toolbar.refresh()
)
return sel.text(list(records_table.rows())[0].run_at).encode("utf-8")