本文整理汇总了Python中Utils.Config.get_base_url方法的典型用法代码示例。如果您正苦于以下问题:Python Config.get_base_url方法的具体用法?Python Config.get_base_url怎么用?Python Config.get_base_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils.Config
的用法示例。
在下文中一共展示了Config.get_base_url方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import get_base_url [as 别名]
def test(self):
driver = Config.get_driver()
self.verificationErrors = []
listID = Config.find_element(Config.main_listByName, "POS").get_attribute("id")
taskIDs = InitCase.init_case(menu=listID, view="clean", taskNo=5)
for i in range(3):
n = Config.find_element(Config.taskTitleID, random.choice(taskIDs))
ActionChains(driver).drag_and_drop_by_offset(n, 0, 90).perform()
newOrder = Config.find_elements(Config.task)
newOrderIDs = []
for t in newOrder:
newOrderIDs.append(t.get_attribute("data-task-id"))
mainWindow = driver.current_window_handle
driver.execute_script("$(window.open())")
window2 = driver.window_handles
window2.remove(mainWindow)
driver.switch_to_window(window2)
driver.get(Config.get_base_url())
InitCase.init_case(menu="ALL", view="clean", taskNo=5)
platform2Order = Config.find_elements(Config.task)
for t in range(len(platform2Order)):
try: self.assertEqual(platform2Order[t].get_attribute("data-task-id"), newOrderIDs[t])
except AssertionError as e: self.verificationErrors.append(str(e))
driver.close()
driver.switch_to_window(mainWindow)
示例2: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import get_base_url [as 别名]
def test(self):
driver = Config.get_driver()
InitCase.init_case(menu="MAIN")
self.verificationErrors = []
lists = Config.find_elements(Config.main_list)
for l in lists:
if l.get_attribute("id") in ["pre_all_tasks", "new"]: lists.remove(l)
listsToAdd = range(4-len(lists))
for lst in listsToAdd:
Config.find_element(Config.main_newList).click()
Config.find_element(Config.listTitleEdit).send_keys(str(lst))
Config.find_element(Config.listTitleEdit).send_keys(Keys.ENTER)
lists.append(Config.find_element(Config.main_listByName, str(lst)))
allTasks = Config.find_element(Config.main_AllTasks)
for i in range(3):
ActionChains(Config.get_driver()).click_and_hold(random.choice(lists)).perform()
time.sleep(0.5)
ActionChains(Config.get_driver()).move_to_element_with_offset(allTasks, 238, 0).perform()
time.sleep(0.5)
ActionChains(Config.get_driver()).release().perform()
time.sleep(1)
listPositions = {}
for li in lists:
listPositions[li.get_attribute("id")] = self.get_position(li)
mainWindow = driver.current_window_handle
driver.execute_script("$(window.open())")
window2 = driver.window_handles
window2.remove(mainWindow)
driver.switch_to_window(window2)
driver.get(Config.get_base_url())
InitCase.init_case(menu="MAIN")
window2Lists = Config.find_elements(Config.main_list)
for ls in window2Lists:
if ls.get_attribute("id") in ["pre_all_tasks", "new"]: window2Lists.remove(ls)
for lt in window2Lists:
try: self.assertEqual(self.get_position(lt), listPositions[lt.get_attribute("id")])
except AssertionError as e: self.verificationErrors.append(e)
driver.close()
driver.switch_to_window(mainWindow)
self.assertEqual([], self.verificationErrors)
示例3: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import get_base_url [as 别名]
def test(self):
driver = Config.get_driver()
self.verificationErrors = []
listID = Config.find_element(Config.main_listByName, "POS").get_attribute("id")
taskIDs = InitCase.init_case(menu=listID, view="date", taskNo=5)
for i in range(3):
n = Config.find_element(Config.taskTitleID, random.choice(taskIDs))
ActionChains(driver).drag_and_drop_by_offset(n, 0, 90).perform()
Config.find_element(Config.taskTitleID, random.choice(taskIDs)).click()
Config.wait_for_element(Config.task_TimeSelector)
Config.find_element(Config.task_TimeSelector).click()
selectDay = self.select_day(Config.find_element(Config.cal_selectedDay).get_attribute("data-full"))
Config.find_element(Config.cal_dayByDate, selectDay).click()
Config.find_element(Config.cal_OK).click()
Config.find_element(Config.task_closeButton).click()
Config.wait_for_element(Config.task_closeButton, present=False)
ActionChains(driver).drag_and_drop(Config.find_element(Config.taskTitleBySectionName, "Today"), Config.find_element(Config.list_sectionByName, "Upcoming")).perform()
InitCase.select_view("clean")
newOrder = Config.find_elements(Config.task)
newOrderIDs = []
for t in newOrder:
newOrderIDs.append(t.get_attribute("data-task-id"))
mainWindow = driver.current_window_handle
driver.execute_script("$(window.open())")
window2 = driver.window_handles
window2.remove(mainWindow)
driver.switch_to_window(window2)
driver.get(Config.get_base_url())
InitCase.init_case(menu=listID, view="clean", taskNo=5)
platform2Order = Config.find_elements(Config.task)
for t in range(len(platform2Order)):
try: self.assertEqual(platform2Order[t].get_attribute("data-task-id"), newOrderIDs[t])
except AssertionError as e: self.verificationErrors.append(str(e))
driver.close()
driver.switch_to_window(mainWindow)