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


Python MASTER_HELPER.step方法代码示例

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


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

示例1: click_and_get_name_tabs

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
def click_and_get_name_tabs(self):
    actual_tabs = []
    with MASTER_HELPER.step('Find tabs element'):
        ul = self.driver.find_element_by_xpath(
            "//div[@class='ui-tabs ui-widget ui-widget-content ui-corner-all']")
    with MASTER_HELPER.step('Counting tabs'):
        num = ul.find_elements_by_tag_name("li")
    with MASTER_HELPER.step('Valid all tabs'):
        for i in range(1, len(num) + 1):
            tab = self.driver.find_element_by_id("ui-id-" + str(i)).text
            actual_tabs.append(tab)
    return actual_tabs
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:14,代码来源:DemoqaComTabs.py

示例2: send_form

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
def send_form(self):
    with MASTER_HELPER.step('Send text to Name'):
        self.driver.find_element_by_name("your-name").send_keys("slava")
    with MASTER_HELPER.step('Send text to email'):
        self.driver.find_element_by_name("your-email").send_keys("[email protected]")
    with MASTER_HELPER.step('Send text to Your Subject'):
        self.driver.find_element_by_name("your-subject").send_keys("Physik")
    with MASTER_HELPER.step('Send text to Your Massage'):
        self.driver.find_element_by_name("your-message").send_keys("lalala")
    with MASTER_HELPER.step('Click on the Button'):
        self.driver.find_element_by_xpath("//input[@class='wpcf7-form-control wpcf7-submit']").click()
    wait = WebDriverWait(self.driver, 10)
    element = wait.until(EC.visibility_of_element_located((By.XPATH, "//*[@id='wpcf7-f375-p28-o1']/form/div[2]")))
    return element
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:16,代码来源:DemoqaComContact.py

示例3: sent_post_comment

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
def sent_post_comment(self):
    author = "Slava"
    email = "[email protected]"
    url = "google.ru"
    text_message = "hello world"
    with MASTER_HELPER.step('Find and send value to Author'):
        self.driver.find_element_by_id("author").send_keys(author)
    with MASTER_HELPER.step('Find and send value to Email'):
        self.driver.find_element_by_id("email").send_keys(email)
    with MASTER_HELPER.step('Find and send value to URL'):
        self.driver.find_element_by_id("url").send_keys(url)
    with MASTER_HELPER.step('Find and clean value of Comment'):
        self.driver.find_element_by_id("comment").clear()
    with MASTER_HELPER.step('Find and send value to Comment'):
        self.driver.find_element_by_id("comment").send_keys(text_message)
    with MASTER_HELPER.step('Find and click button Post Comment'):
        self.driver.find_element_by_id("submit").click()
    if self.driver.find_element_by_xpath("//body[@id='error-page']/p"):
        return self.driver.current_url
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:21,代码来源:DemoqaComSamplePost.py

示例4: test_valid_phone_number_element

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
 def test_valid_phone_number_element(self):
     with MASTER_HELPER.step('Find and valid Phone Number'):
         assert ("Phone Number" in get_element_text(self, By.XPATH, "//ul[@id='pie_register']/li[6]/div/label"))
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:5,代码来源:test_decoqa_com_registration.py

示例5: test_valid_header_and_menu

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
 def test_valid_header_and_menu(self):
     with MASTER_HELPER.step('Find and valid header and menu item'):
         assert (find_header_and_menu_item(self, 64))
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:5,代码来源:test_decoqa_com_contact.py

示例6: test_send_form

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
 def test_send_form(self):
     with MASTER_HELPER.step('Send form'):
         assert (send_form(self).is_displayed())
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:5,代码来源:test_decoqa_com_contact.py

示例7: test_valid_message_element

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
 def test_valid_message_element(self):
     with MASTER_HELPER.step('Find and valid element Message'):
         assert ("Your Message" in get_element_text(self, By.XPATH, "//form [@class = 'wpcf7-form']/p[4]"))
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:5,代码来源:test_decoqa_com_contact.py

示例8: test_valid_email_element

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
 def test_valid_email_element(self):
     with MASTER_HELPER.step('Find and valid element Emale'):
         assert ("Your Email (required)" in get_element_text(self, By.XPATH, "//form [@class = 'wpcf7-form']/p[2]"))
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:5,代码来源:test_decoqa_com_contact.py

示例9: test_check_tabs

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
 def test_check_tabs(self):
     with MASTER_HELPER.step('Insert expected Tabs'):
         expected_tabs = ['Tab 1 ', 'Tab 2 ', 'Tab 3 ', 'Tab 4 ', 'Tab 5 ']
     with MASTER_HELPER.step('Comparing Tabs'):
         assert (expected_tabs == comparing_tabs(self))
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:7,代码来源:test_demoqa_com_home.py

示例10: send_registration_form

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
def send_registration_form(self):
    with MASTER_HELPER.step('Send text to First Name'):
        with MASTER_HELPER.step('Send text to First Name'):
            self.driver.find_element_by_id("name_3_firstname").send_keys("Ivan")
        with MASTER_HELPER.step('Send text to Last Name'):
            self.driver.find_element_by_id("name_3_lastname").send_keys("Ivanov")
        with MASTER_HELPER.step('Click Single'):
            self.driver.find_element_by_xpath("//ul[@id='pie_register']/li[2]/div/div/input[1]").click()
        with MASTER_HELPER.step('Click Dance '):
            self.driver.find_element_by_xpath("//ul[@id='pie_register']/li[3]/div/div[1]/input[1]").click()
        with MASTER_HELPER.step('Click Reading'):
            self.driver.find_element_by_xpath("//ul[@id='pie_register']/li[3]/div/div[1]/input[2]").click()
        with MASTER_HELPER.step('Click Cricket'):
            self.driver.find_element_by_xpath("//ul[@id='pie_register']/li[3]/div/div[1]/input[3]").click()
        with MASTER_HELPER.step('Choose country '):
            Select(self.driver.find_element_by_id("dropdown_7")).select_by_value("Belarus")
        with MASTER_HELPER.step('Choose month'):
            Select((self.driver.find_element_by_id("mm_date_8"))).select_by_value(str(8))
        with MASTER_HELPER.step('Choose date'):
            Select((self.driver.find_element_by_id("dd_date_8"))).select_by_value(str(12))
        with MASTER_HELPER.step('Choose year'):
            Select((self.driver.find_element_by_id("yy_date_8"))).select_by_value(str(1991))
        with MASTER_HELPER.step('Send text to Phone Number'):
            self.driver.find_element_by_id("phone_9").send_keys("375293506647")
        with MASTER_HELPER.step('Send text to Username'):
            self.driver.find_element_by_id("username").send_keys("Ivan")
        with MASTER_HELPER.step('Send text to Email'):
            self.driver.find_element_by_id("email_1").send_keys("[email protected]")
        with MASTER_HELPER.step('Choose image'):
            self.driver.find_element_by_id("profile_pic_10").send_keys(
                os.path.abspath(os.path.dirname(__file__) + "\..\\" + "\\Pages\\1.png"))
        with MASTER_HELPER.step('Send text About Yourself'):
            self.driver.find_element_by_id("description").send_keys("Cool")
        with MASTER_HELPER.step('Send text password'):
            self.driver.find_element_by_id("password_2").send_keys("ivanivanov")
        with MASTER_HELPER.step('Send text confirm password'):
            self.driver.find_element_by_id("confirm_password_password_2").send_keys("ivanivanov")
        with MASTER_HELPER.step('Click buttom Submit'):
            self.driver.find_element_by_xpath("//ul[@id='pie_register']/li[14]/div/input").click()
        with MASTER_HELPER.step('Show Strength Indicator'):
            WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located((By.CLASS_NAME, "piereg_login_error")))
        return self.driver.find_element_by_class_name("piereg_login_error").is_displayed()
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:45,代码来源:DemoqaComRegistration.py

示例11: test_valid_confirm_password_element

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
 def test_valid_confirm_password_element(self):
     with MASTER_HELPER.step('Find and valid Confirm Password'):
         assert ("Confirm Password" in get_element_text(self, By.XPATH, "//ul[@id='pie_register']/li[12]/div/label"))
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:5,代码来源:test_decoqa_com_registration.py

示例12: test_valid_about_yourself_element

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
 def test_valid_about_yourself_element(self):
     with MASTER_HELPER.step('Find and valid About Yourself'):
         assert ("About Yourself" in get_element_text(self, By.XPATH, "//ul[@id='pie_register']/li[10]/div/label"))
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:5,代码来源:test_decoqa_com_registration.py

示例13: test_valid_your_profile_picture_element

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
 def test_valid_your_profile_picture_element(self):
     with MASTER_HELPER.step('Find and valid Your Profile Picture'):
         assert (
             "Your Profile Picture" in get_element_text(self, By.XPATH, "//ul[@id='pie_register']/li[9]/div/label"))
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:6,代码来源:test_decoqa_com_registration.py

示例14: test_valid_email_element

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
 def test_valid_email_element(self):
     with MASTER_HELPER.step('Find and valid Email'):
         assert ("E-mail" in get_element_text(self, By.XPATH, "//ul[@id='pie_register']/li[8]/div/label"))
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:5,代码来源:test_decoqa_com_registration.py

示例15: test_valid_username_element

# 需要导入模块: from allure.pytest_plugin import MASTER_HELPER [as 别名]
# 或者: from allure.pytest_plugin.MASTER_HELPER import step [as 别名]
 def test_valid_username_element(self):
     with MASTER_HELPER.step('Find and valid Username'):
         assert ("Username" in get_element_text(self, By.XPATH, "//ul[@id='pie_register']/li[7]/div/label"))
开发者ID:slav1k,项目名称:demoqa_com_python,代码行数:5,代码来源:test_decoqa_com_registration.py


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