本文整理匯總了Python中pages.manage_suites_page.MozTrapManageSuitesPage.edit_suite方法的典型用法代碼示例。如果您正苦於以下問題:Python MozTrapManageSuitesPage.edit_suite方法的具體用法?Python MozTrapManageSuitesPage.edit_suite怎麽用?Python MozTrapManageSuitesPage.edit_suite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pages.manage_suites_page.MozTrapManageSuitesPage
的用法示例。
在下文中一共展示了MozTrapManageSuitesPage.edit_suite方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_editing_of_existing_suite_that_has_no_included_cases
# 需要導入模塊: from pages.manage_suites_page import MozTrapManageSuitesPage [as 別名]
# 或者: from pages.manage_suites_page.MozTrapManageSuitesPage import edit_suite [as 別名]
def test_editing_of_existing_suite_that_has_no_included_cases(self, mozwebqa_logged_in, product):
#create suite and cases
suite = self.create_suite(mozwebqa_logged_in, product, use_API=True)
cases = self.create_bulk_cases(mozwebqa_logged_in, product, use_API=True, cases_amount=3)
# simulate random order of cases
case_list = [cases[i]['name'] for i in (2, 0, 1)]
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
manage_suites_pg.go_to_manage_suites_page()
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])
# product field should not be read-only.
Assert.false(
edit_suite_pg.is_product_field_readonly,
u'product version field should be editable')
edit_suite_pg.include_cases_to_suite(case_list)
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])
Assert.true(
edit_suite_pg.is_product_field_readonly,
u'product version field should be read-only')
Assert.equal(
[item.name for item in edit_suite_pg.included_cases], case_list,
u'items are listed in wrong order')
示例2: test_editing_of_existing_suite_that_includes_cases
# 需要導入模塊: from pages.manage_suites_page import MozTrapManageSuitesPage [as 別名]
# 或者: from pages.manage_suites_page.MozTrapManageSuitesPage import edit_suite [as 別名]
def test_editing_of_existing_suite_that_includes_cases(self, mozwebqa_logged_in, product):
# create suite and cases (both included and not included into suite)
included_cases = self.create_bulk_cases(mozwebqa_logged_in, product, use_API=True, cases_amount=2)
not_included_cases = self.create_bulk_cases(mozwebqa_logged_in, product, use_API=True, cases_amount=3)
suite = self.create_suite(mozwebqa_logged_in, product, use_API=True, case_list=[case for case in included_cases])
# filter by suite name and go to edit suite page
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
manage_suites_pg.go_to_manage_suites_page()
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])
Assert.true(
edit_suite_pg.is_product_field_readonly,
u'product version field should be read only')
# check list of available cases
actual_available_cases = [item.name for item in edit_suite_pg.available_cases]
expected_available_cases = [item['name'] for item in not_included_cases]
Assert.equal(actual_available_cases, expected_available_cases)
# check list of included cases
actual_included_cases = [item.name for item in edit_suite_pg.included_cases]
expected_included_cases = [item['name'] for item in included_cases]
Assert.equal(actual_included_cases, expected_included_cases)
# get all cases names and make random order via random.shuffle
all_cases = expected_available_cases + expected_included_cases
random.shuffle(all_cases)
# include cases to suite in the expected order
edit_suite_pg.remove_all_included_cases()
edit_suite_pg.include_cases_to_suite(all_cases)
# re-edit the same suite
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])
# and ensure that included cases are listed in right order
Assert.equal(
[item.name for item in edit_suite_pg.included_cases], all_cases,
u'items are listed in wrong order')
示例3: test_editing_of_existing_suite_that_has_no_included_cases
# 需要導入模塊: from pages.manage_suites_page import MozTrapManageSuitesPage [as 別名]
# 或者: from pages.manage_suites_page.MozTrapManageSuitesPage import edit_suite [as 別名]
def test_editing_of_existing_suite_that_has_no_included_cases(self, api, base_url, selenium, login, product):
# create suite and cases
suite = self.create_suite(base_url, selenium, product, api=api)
cases = self.create_bulk_cases(base_url, selenium, product, api=api, cases_amount=3)
# simulate random order of cases
case_list = [cases[i]['name'] for i in (2, 0, 1)]
manage_suites_pg = MozTrapManageSuitesPage(base_url, selenium)
manage_suites_pg.go_to_manage_suites_page()
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])
# product field should not be read-only.
assert not edit_suite_pg.is_product_field_readonly
edit_suite_pg.include_cases_to_suite(case_list)
edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])
assert edit_suite_pg.is_product_field_readonly
assert case_list == [item.name for item in edit_suite_pg.included_cases]
示例4: test_editing_of_existing_suite_that_includes_cases
# 需要導入模塊: from pages.manage_suites_page import MozTrapManageSuitesPage [as 別名]
# 或者: from pages.manage_suites_page.MozTrapManageSuitesPage import edit_suite [as 別名]
def test_editing_of_existing_suite_that_includes_cases(self, api, base_url, selenium, login, product):
# create suite and cases (both included and not included into suite)
included_cases = self.create_bulk_cases(base_url, selenium, product, api=api, cases_amount=2)
not_included_cases = self.create_bulk_cases(base_url, selenium, product, api=api, cases_amount=3)
suite = self.create_suite(base_url, selenium, product, api=api, case_list=[case for case in included_cases])
# filter by suite name and go to edit suite page
manage_suites_pg = MozTrapManageSuitesPage(base_url, selenium)
manage_suites_pg.go_to_manage_suites_page()
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])
assert edit_suite_pg.is_product_field_readonly
# check list of available cases
actual_available_cases = [item.name for item in edit_suite_pg.available_cases]
expected_available_cases = [item['name'] for item in not_included_cases]
assert expected_available_cases == actual_available_cases
# check list of included cases
actual_included_cases = [item.name for item in edit_suite_pg.included_cases]
expected_included_cases = [item['name'] for item in included_cases]
assert expected_included_cases == actual_included_cases
# get all cases names and make random order via random.shuffle
all_cases = expected_available_cases + expected_included_cases
random.shuffle(all_cases)
# include cases to suite in the expected order
edit_suite_pg.remove_all_included_cases()
edit_suite_pg.include_cases_to_suite(all_cases)
# re-edit the same suite
edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])
# and ensure that included cases are listed in right order
assert all_cases == [item.name for item in edit_suite_pg.included_cases]