本文整理汇总了Python中OWDTestToolkit.apps.loop.Loop.delete_single_entry_by_pos方法的典型用法代码示例。如果您正苦于以下问题:Python Loop.delete_single_entry_by_pos方法的具体用法?Python Loop.delete_single_entry_by_pos怎么用?Python Loop.delete_single_entry_by_pos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.loop.Loop
的用法示例。
在下文中一共展示了Loop.delete_single_entry_by_pos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from OWDTestToolkit.apps.loop import Loop [as 别名]
# 或者: from OWDTestToolkit.apps.loop.Loop import delete_single_entry_by_pos [as 别名]
class main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.loop = Loop(self)
self.settings = Settings(self)
self.scenario = "scenarios/urls/single/available/idb"
self.aux_files_dir = self.UTILS.general.get_config_variable("aux_files", "loop")
self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
self.connect_to_network()
# Insert our test contacts
number_of_contacts = 3
contact_given = "Test"
contact_family = map(str, range(1, number_of_contacts + 1))
contact_name = ["{} {}".format(contact_given, contact_family[i])
for i in range(number_of_contacts)]
contact_numbers = ["666666666666", "777777777777", "888888888888"]
test_contacts = [MockContact(name=contact_name[i], givenName=contact_given,
familyName=contact_family[i],
tel={'type': 'Mobile', 'value': contact_numbers[i]})
for i in range(number_of_contacts)]
map(self.UTILS.general.insertContact, test_contacts)
self.loop.initial_test_checks()
# Make sure we're not logged in FxA
self.settings.launch()
self.settings.fxa()
self.settings.fxa_log_out()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.loop.launch()
# This needs to be done at this point, bcs if the app is freshly installed the persistence
# directories are not in its place until the app is launched for the first time
self.loop.update_db("{}/{}".format(self.aux_files_dir, self.scenario))
result = self.loop.wizard_or_login()
if result:
self.loop.firefox_login(self.fxa_user, self.fxa_pass)
self.loop.allow_permission_ffox_login()
self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")
self.loop.switch_to_urls()
previous = self.loop.get_number_of_all_urls()
self.loop.delete_single_entry_by_pos(0)
current = self.loop.get_number_of_all_urls()
self.UTILS.test.test(current == previous - 1, "Check that the entry has been deleted")