本文整理汇总了Python中helpers.Helpers.wait_by_class方法的典型用法代码示例。如果您正苦于以下问题:Python Helpers.wait_by_class方法的具体用法?Python Helpers.wait_by_class怎么用?Python Helpers.wait_by_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers.Helpers
的用法示例。
在下文中一共展示了Helpers.wait_by_class方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from helpers import Helpers [as 别名]
# 或者: from helpers.Helpers import wait_by_class [as 别名]
class TestPipedrive:
def __init__(self, driver, base_url, credentials):
self.driver = driver
self.base_url = base_url
self.credentials = credentials
self.myHelpers = Helpers(self.driver)
def test_1_sing_in(self):
mySingIn = SignIn(self.driver, self.base_url)
mySingIn.get()
mySingIn.input_email().send_keys(self.credentials['email'])
mySingIn.input_password().send_keys(self.credentials['password'])
mySingIn.button_sing_in().click()
self.myHelpers.wait_by_class("userInfo")
del mySingIn
def test_2_new_deal(self):
myPipeLine = PipeLine(self.driver, self.base_url)
myAddDeal = AddDeal(self.driver, self.base_url)
myPipeLine.div_user_info()
myPipeLine.button_add_deal().click()
self.myHelpers.wait_by_class("addDealDialog")
myAddDeal.input_person().send_keys('Homer Simpson')
myAddDeal.input_organization().send_keys('The Nuclear Power Plant')
myAddDeal.input_value().send_keys('1000000')
deal_title = myAddDeal.input_title().get_attribute('value').encode('utf-8')
myAddDeal.button_save().click()
time.sleep(3)
myPipeLine.get()
self.myHelpers.wait_by_class("userInfo")
time.sleep(3)
deal_found = False
for deal in myPipeLine.deal_list_idea_stage():
if deal_title in myPipeLine.title_deal(deal).text:
deal_found = True
break
assert deal_found, 'Deal not found in idea stage'
del myPipeLine
del myAddDeal
def test_3_sign_out(self):
myPipeLine = PipeLine(self.driver, self.base_url)
myPipeLine.div_user_info().click()
myPipeLine.link_log_out().click()
time.sleep(3)
assert ('https://app.pipedrive.com/auth/logged_out' in self.driver.current_url)
del myPipeLine