当前位置: 首页>>代码示例>>Python>>正文


Python Helpers.wait_by_class方法代码示例

本文整理汇总了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
开发者ID:sajedts,项目名称:pipedrive,代码行数:75,代码来源:test.py


注:本文中的helpers.Helpers.wait_by_class方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。