本文整理汇总了Python中pages.manage_runs_page.MozTrapManageRunsPage.make_run_draft方法的典型用法代码示例。如果您正苦于以下问题:Python MozTrapManageRunsPage.make_run_draft方法的具体用法?Python MozTrapManageRunsPage.make_run_draft怎么用?Python MozTrapManageRunsPage.make_run_draft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pages.manage_runs_page.MozTrapManageRunsPage
的用法示例。
在下文中一共展示了MozTrapManageRunsPage.make_run_draft方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_that_test_run_saves_right_order_of_test_cases
# 需要导入模块: from pages.manage_runs_page import MozTrapManageRunsPage [as 别名]
# 或者: from pages.manage_runs_page.MozTrapManageRunsPage import make_run_draft [as 别名]
def test_that_test_run_saves_right_order_of_test_cases(self, mozwebqa_logged_in):
#get profile, product and version
profile = self.create_profile(mozwebqa_logged_in)
product = self.create_product(mozwebqa_logged_in, profile['name'])
version = product['version']
#create several test case via bulk create
cases = self.create_bulk_cases(mozwebqa_logged_in, cases_amount=5, product=product, name='is')
#create first test suite
suite_a_cases = (cases[3]['name'], cases[1]['name'])
suite_a = self.create_suite(
mozwebqa_logged_in, product=product, name='suite A', case_name_list=suite_a_cases)
#create second test suite
suite_b_cases = (cases[2]['name'], cases[0]['name'], cases[4]['name'])
suite_b = self.create_suite(
mozwebqa_logged_in, product=product, name='suite B', case_name_list=suite_b_cases)
#create first test run (suite a, suite b)
first_suite_order = (suite_a['name'], suite_b['name'])
first_run = self.create_run(
mozwebqa_logged_in, activate=True, product=product,
version=version, suite_name_list=first_suite_order)
#execute first test run
home_page = MozTrapHomePage(mozwebqa_logged_in)
home_page.go_to_home_page()
home_page.go_to_run_test(
product_name=product['name'], version_name=version['name'], run_name=first_run['name'],
env_category=profile['category'], env_element=profile['element'])
run_tests_pg = MozTrapRunTestsPage(mozwebqa_logged_in)
actual_order = [(item.name, item.suite_name) for item in run_tests_pg.test_items]
expected_order = [(case, suite) for case in suite_a_cases for suite in (suite_a['name'],)] + \
[(case, suite) for case in suite_b_cases for suite in (suite_b['name'],)]
#assert that right order saved
Assert.equal(actual_order, expected_order)
#edit run to reorder suites
manage_runs_pg = MozTrapManageRunsPage(mozwebqa_logged_in)
manage_runs_pg.go_to_manage_runs_page()
#push run into draft mode
manage_runs_pg.filter_form.filter_by(lookup='name', value=first_run['name'])
manage_runs_pg.make_run_draft(first_run['name'])
#go to edit run page and reorder suites by name (suite b, suite a)
edit_run_pg = manage_runs_pg.go_to_edit_run_page(first_run['name'])
second_run = edit_run_pg.edit_run(first_run, reorder_suites=True)
#make run active again
manage_runs_pg.filter_form.filter_by(lookup='name', value=first_run['name'])
manage_runs_pg.activate_run(first_run['name'])
#execute run again
home_page.go_to_home_page()
home_page.go_to_run_test(
product_name=product['name'], version_name=version['name'], run_name=first_run['name'],
env_category=profile['category'], env_element=profile['element'])
#check actual order of items on run tests page
actual_order = [(item.name, item.suite_name) for item in run_tests_pg.test_items]
expected_order = [(case, suite) for case in suite_b_cases for suite in (suite_b['name'],)] + \
[(case, suite) for case in suite_a_cases for suite in (suite_a['name'],)]
#assert that right order saved
Assert.equal(actual_order, expected_order)
示例2: test_that_test_run_saves_right_order_of_test_cases
# 需要导入模块: from pages.manage_runs_page import MozTrapManageRunsPage [as 别名]
# 或者: from pages.manage_runs_page.MozTrapManageRunsPage import make_run_draft [as 别名]
def test_that_test_run_saves_right_order_of_test_cases(self, api, mozwebqa, login, product, element):
self.connect_product_to_element(mozwebqa, product, element)
version = product['version']
# create several test case via bulk create
cases = self.create_bulk_cases(mozwebqa, product, api=api, cases_amount=5)
# create first test suite
suite_a_cases = (cases[3], cases[1])
suite_a = self.create_suite(
mozwebqa, product=product, api=api, name='suite A', case_list=suite_a_cases)
# create second test suite
suite_b_cases = (cases[2], cases[0], cases[4])
suite_b = self.create_suite(
mozwebqa, product=product, api=api, name='suite B', case_list=suite_b_cases)
# create first test run (suite a, suite b)
first_suite_order = (suite_a['name'], suite_b['name'])
first_run = self.create_run(
mozwebqa, product=product, activate=True,
version=version, suite_name_list=first_suite_order)
# execute first test run
home_page = MozTrapHomePage(mozwebqa)
home_page.go_to_home_page()
home_page.go_to_run_test(
product_name=product['name'], version_name=version['name'], run_name=first_run['name'],
env_category_name=element['category']['name'], env_element_name=element['name'])
run_tests_pg = MozTrapRunTestsPage(mozwebqa)
actual_order = [(item.case_name, item.suite_name) for item in run_tests_pg.test_results]
expected_order = [(case['name'], suite) for case in suite_a_cases for suite in (suite_a['name'],)] + \
[(case['name'], suite) for case in suite_b_cases for suite in (suite_b['name'],)]
# assert that right order saved
assert expected_order == actual_order
# edit run to reorder suites
manage_runs_pg = MozTrapManageRunsPage(mozwebqa)
manage_runs_pg.go_to_manage_runs_page()
# push run into draft mode
manage_runs_pg.filter_form.filter_by(lookup='name', value=first_run['name'])
manage_runs_pg.make_run_draft(first_run['name'])
# go to edit run page and reorder suites by name (suite b, suite a)
edit_run_pg = manage_runs_pg.go_to_edit_run_page(first_run['name'])
edit_run_pg.edit_run(first_run, reorder_suites=True)
# make run active again
manage_runs_pg.activate_run(first_run['name'])
# execute run again
home_page.go_to_home_page()
home_page.go_to_run_test(
product_name=product['name'], version_name=version['name'], run_name=first_run['name'],
env_category_name=element['category']['name'], env_element_name=element['name'])
# check actual order of items on run tests page
actual_order = [(item.case_name, item.suite_name) for item in run_tests_pg.test_results]
expected_order = [(case['name'], suite) for case in suite_b_cases for suite in (suite_b['name'],)] + \
[(case['name'], suite) for case in suite_a_cases for suite in (suite_a['name'],)]
# assert that right order saved
assert expected_order == actual_order