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


Python Remote.implicitly_wait方法代码示例

本文整理汇总了Python中selenium.webdriver.Remote.implicitly_wait方法的典型用法代码示例。如果您正苦于以下问题:Python Remote.implicitly_wait方法的具体用法?Python Remote.implicitly_wait怎么用?Python Remote.implicitly_wait使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在selenium.webdriver.Remote的用法示例。


在下文中一共展示了Remote.implicitly_wait方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: driver

# 需要导入模块: from selenium.webdriver import Remote [as 别名]
# 或者: from selenium.webdriver.Remote import implicitly_wait [as 别名]
def driver():
    """
    Selenium driver fixture
    """
    # Start a selenium server running chrome
    capabilities = DesiredCapabilities.CHROME.copy()
    capabilities['chromeOptions'] = {
        'binary': os.getenv('CHROME_BIN', '/usr/bin/google-chrome-stable'),
        'args': ['--no-sandbox'],
    }
    driver = Remote(
        os.getenv('SELENIUM_URL', 'http://chrome:5555/wd/hub'),
        capabilities,
    )
    driver.implicitly_wait(10)
    yield driver
    driver.close()
开发者ID:mitodl,项目名称:micromasters,代码行数:19,代码来源:conftest.py

示例2: TestTarget

# 需要导入模块: from selenium.webdriver import Remote [as 别名]
# 或者: from selenium.webdriver.Remote import implicitly_wait [as 别名]
class TestTarget(unittest.TestCase):
    LOGIN = 'tech-testing-ha2-9'
    DOMAIN = '@bk.ru'
    PASSWORD = os.environ.get('TTHA2PASSWORD')

    def setUp(self):
        self.created = False
        browser = os.environ.get('TTHA2BROWSER', 'FIREFOX')
        self.driver = Remote(
            command_executor='http://127.0.0.1:4444/wd/hub',
            desired_capabilities=getattr(DesiredCapabilities, browser).copy()
        )
        self.driver.implicitly_wait(30)
        auth_page = LoginPage(self.driver)
        auth_page.open()
        auth_form = auth_page.form
        auth_form.set_login(self.LOGIN)
        auth_form.set_domain(self.DOMAIN)
        auth_form.set_password(self.PASSWORD)
        auth_form.submit()

    def tearDown(self):
        if self.created:
            delete_company(self.driver)
        self.driver.quit()


    def test_login(self):
        EMAIL = self.LOGIN + self.DOMAIN

        top_email = CreateCompanyPage(self.driver).top_menu
        email = top_email.get_email
        assert EMAIL in email

    def test_place_select(self):
        RUS = u'Россия'

        create_page = CreateCompanyPage(self.driver)
        create_page.open()
        where_settings = create_page.where_form
        where_settings.choose_place()
        assert RUS in where_settings.get_chosen()


    def test_place_without_one(self):
        RUS = u'Россия (81 из 82)'

        create_page = CreateCompanyPage(self.driver)
        create_page.open()
        where_settings = create_page.where_form
        where_settings.choose_place()
        where_settings.choose_place_without_one_region()
        assert RUS in where_settings.get_chosen()


    def test_restrict(self):
        RESTRICT = u'12+'
        create_page = CreateCompanyPage(self.driver)
        create_page.open()
        whom_settings = create_page.whom_form
        whom_settings.choose_restrict()
        restrict = whom_settings.get_restrict()
        self.assertEquals(RESTRICT, restrict)

    def test_create(self):
        COMPANY_NAME = "Sunny"

        create_company(self.driver)
        self.created = True
        current_page = CurrentPage(self.driver)
        current_form = current_page.company
        assert COMPANY_NAME in current_form.get_title()


    def test_restrict_final(self):
        RESTRICT = u'12+'

        create_company(self.driver)
        self.created = True
        current = CurrentPage(self.driver)
        current_form = current.company
        current_form.edit()
        edit_form = EditPage(self.driver).edit_form
        restrict = edit_form.get_restrict()
        self.assertEquals(RESTRICT, restrict)
开发者ID:elviraux,项目名称:tech-testing-ha2,代码行数:87,代码来源:TestMakeGroup.py


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