本文整理匯總了Python中pages.manage_suites_page.MozTrapManageSuitesPage類的典型用法代碼示例。如果您正苦於以下問題:Python MozTrapManageSuitesPage類的具體用法?Python MozTrapManageSuitesPage怎麽用?Python MozTrapManageSuitesPage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了MozTrapManageSuitesPage類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_editing_of_existing_suite_that_has_no_included_cases
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_that_pinning_filters_on_product_sets_defaults_in_new_suite
def test_that_pinning_filters_on_product_sets_defaults_in_new_suite(self, mozwebqa_logged_in):
product = self.create_product(mozwebqa_logged_in)
from pages.manage_suites_page import MozTrapManageSuitesPage
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
manage_suites_pg.go_to_manage_suites_page()
filter_item = manage_suites_pg.filter_form.filter_by(lookup='product', value=product['name'])
#check that filter is not orange before it's pinned
Assert.not_equal(
filter_item.get_filter_color(),
PINNED_FILTER_COLOR,
u'filter is orange before it was pinned')
filter_item.pin_filter()
#check that filter is orange after it's been pinned
Assert.equal(
filter_item.get_filter_color(),
PINNED_FILTER_COLOR,
u'pinned filter\'s color is not orange')
create_suite_pg = manage_suites_pg.click_create_suite_button()
Assert.equal(
create_suite_pg.product_name_value,
product['name'],
u'default product is incorrect')
示例3: test_that_pinning_filter_persists_for_session
def test_that_pinning_filter_persists_for_session(self, api, mozwebqa, existing_user, login, product, element):
# create suite, cases and test run
product_version_name = u'%s %s' % (product['name'], product['version']['name'])
case, suite, run = self.create_and_run_test(api, mozwebqa, product, element)
# go to manage cases page
manage_cases_pg = MozTrapManageCasesPage(mozwebqa)
manage_cases_pg.go_to_manage_cases_page()
# filter on product
filter_item = manage_cases_pg.filter_form.filter_by(lookup='product', value=product['name'])
self.check_pinned_filter(filter_item, is_pinned=False)
# see only cases for specified product
displayed_cases = manage_cases_pg.test_cases
assert 1 == len(displayed_cases)
assert case.name.lower() == displayed_cases[0].name.lower()
# pin product filter
filter_item.pin_filter()
self.check_pinned_filter(filter_item, is_pinned=True)
# go to manage suites page
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa)
manage_suites_pg.go_to_manage_suites_page()
# see only suites for specified product
displayed_suites = manage_suites_pg.test_suites
assert 1 == len(displayed_suites)
assert suite.name.lower() == displayed_suites[0].name.lower()
# go to results page
view_results_pg = MozTrapViewRunResultsPage(mozwebqa)
view_results_pg.go_to_view_run_results_page()
# see only results for specified product
# because we are going to check the same thing several times
# let's define a function and call it each time we need this check
def check_test_run_results(results):
assert 1 == len(results)
assert run['name'].lower() == results[0].name.lower()
assert product_version_name == results[0].product_version
check_test_run_results(view_results_pg.test_run_results)
# refresh page and see that filter persists
view_results_pg.refresh()
check_test_run_results(view_results_pg.test_run_results)
# log out and back in and see that filter persists
view_results_pg.header.click_logout()
view_results_pg.header.login(existing_user['email'], existing_user['password'])
check_test_run_results(view_results_pg.test_run_results)
# check that filter is still pinned
filters = view_results_pg.filter_form.filter_items
assert 1 == len(filters)
self.check_pinned_filter(filters[0], is_pinned=True)
示例4: delete_suite
def delete_suite(self, mozwebqa, suite, delete_product=False):
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa)
manage_suites_pg.go_to_manage_suites_page()
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
manage_suites_pg.delete_suite(name=suite['name'])
if delete_product:
self.delete_product(mozwebqa, product=suite['product'])
示例5: test_that_user_can_create_and_delete_suite
def test_that_user_can_create_and_delete_suite(self, mozwebqa_logged_in, product):
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
suite = self.create_suite(mozwebqa_logged_in, product, use_API=False)
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
Assert.true(manage_suites_pg.is_element_present(*suite['locator']))
manage_suites_pg.delete_suite(name=suite['name'])
Assert.false(manage_suites_pg.is_element_present(*suite['locator']))
示例6: test_that_user_can_create_and_delete_suite
def test_that_user_can_create_and_delete_suite(self, base_url, selenium, login, product):
manage_suites_pg = MozTrapManageSuitesPage(base_url, selenium)
suite = self.create_suite(base_url, selenium, product)
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
assert manage_suites_pg.is_element_present(*suite['locator'])
manage_suites_pg.delete_suite(name=suite['name'])
assert not manage_suites_pg.is_element_present(*suite['locator'])
示例7: test_that_user_can_create_suite_and_add_some_cases_to_it
def test_that_user_can_create_suite_and_add_some_cases_to_it(self, api, base_url, selenium, login, product):
manage_suites_pg = MozTrapManageSuitesPage(base_url, selenium)
cases = [self.create_case(base_url, selenium, product=product, api=api) for i in range(3)]
suite = self.create_suite(base_url, selenium, product=product, api=api, case_list=[case for case in cases])
manage_suites_pg.go_to_manage_suites_page()
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
assert manage_suites_pg.is_suite_present(suite)
manage_test_cases_pg = manage_suites_pg.view_cases(name=suite['name'])
for case in cases:
assert manage_test_cases_pg.is_case_present(case)
示例8: test_that_user_can_create_suite_and_add_some_cases_to_it
def test_that_user_can_create_suite_and_add_some_cases_to_it(self, mozwebqa_logged_in, product):
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
cases = [self.create_case(mozwebqa=mozwebqa_logged_in, product=product, use_API=True) for i in range(3)]
suite = self.create_suite(mozwebqa=mozwebqa_logged_in, product=product, use_API=True, case_list=[case for case in cases])
manage_suites_pg.go_to_manage_suites_page()
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
Assert.true(manage_suites_pg.is_suite_present(suite))
manage_test_cases_pg = manage_suites_pg.view_cases(name=suite['name'])
for case in cases:
Assert.true(manage_test_cases_pg.is_case_present(case))
示例9: test_that_user_can_create_suite_and_add_some_cases_to_it
def test_that_user_can_create_suite_and_add_some_cases_to_it(self, mozwebqa_logged_in):
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
product = self.create_product(mozwebqa_logged_in)
cases = [self.create_case(mozwebqa=mozwebqa_logged_in, product=product) for i in range(3)]
suite = self.create_suite(mozwebqa=mozwebqa_logged_in, product=product, case_name_list=[case['name'] for case in cases])
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
Assert.true(manage_suites_pg.is_element_present(*suite['locator']))
manage_test_cases_pg = manage_suites_pg.view_cases(name=suite['name'])
for case in cases:
Assert.true(manage_test_cases_pg.is_element_present(*case['locator']))
示例10: test_that_pinning_filters_on_product_sets_defaults_in_new_suite
def test_that_pinning_filters_on_product_sets_defaults_in_new_suite(self, mozwebqa, login, product):
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa)
manage_suites_pg.go_to_manage_suites_page()
filter_item = manage_suites_pg.filter_form.filter_by(lookup='product', value=product['name'])
# check that filter is not orange before it's pinned
self.check_pinned_filter(filter_item, is_pinned=False)
filter_item.pin_filter()
# check that filter is orange after it's been pinned
self.check_pinned_filter(filter_item, is_pinned=True)
create_suite_pg = manage_suites_pg.click_create_suite_button()
assert product['name'] == create_suite_pg.product_name_value
示例11: test_editing_of_existing_suite_that_includes_cases
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')
示例12: test_editing_of_existing_suite_that_has_no_included_cases
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]
示例13: test_editing_of_existing_suite_that_includes_cases
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]
示例14: test_that_user_can_create_and_delete_suite
def test_that_user_can_create_and_delete_suite(self, mozwebqa_logged_in):
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
suite = self.create_suite(mozwebqa_logged_in)
manage_suites_pg.filter_suites_by_name(name=suite['name'])
Assert.true(manage_suites_pg.is_element_present(*suite['locator']))
manage_suites_pg.delete_suite(name=suite['name'])
Assert.false(manage_suites_pg.is_element_present(*suite['locator']))
self.delete_product(mozwebqa_logged_in, product=suite['product'])
示例15: test_that_pinning_filter_persists_for_session
def test_that_pinning_filter_persists_for_session(self, mozwebqa_logged_in, product, element):
# create suite, cases and test run
product_version_name = u'%s %s' % (product['name'], product['version']['name'])
case, suite, run = self.create_and_run_test(mozwebqa_logged_in, product, element)
# go to manage cases page
manage_cases_pg = MozTrapManageCasesPage(mozwebqa_logged_in)
manage_cases_pg.go_to_manage_cases_page()
# filter on product
filter_item = manage_cases_pg.filter_form.filter_by(lookup='product', value=product['name'])
self.check_pinned_filter(filter_item, is_pinned=False)
# see only cases for specified product
displayed_cases = manage_cases_pg.test_cases
Assert.equal(len(displayed_cases), 1, 'there should be only one case displayed')
Assert.equal(case.name.lower(), displayed_cases[0].name.lower(),
'displayed case name differs from expected value')
# pin product filter
filter_item.pin_filter()
self.check_pinned_filter(filter_item, is_pinned=True)
# go to manage suites page
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
manage_suites_pg.go_to_manage_suites_page()
# see only suites for specified product
displayed_suites = manage_suites_pg.test_suites
Assert.equal(len(displayed_suites), 1, 'there should be only one suite displayed')
Assert.equal(suite.name.lower(), displayed_suites[0].name.lower(),
'displayed suite name differs from expected value')
# go to results page
view_results_pg = MozTrapViewRunResultsPage(mozwebqa_logged_in)
view_results_pg.go_to_view_run_results_page()
# see only results for specified product
# because we are going to check the same thing several times
# let's define a function and call it each time we need this check
def check_test_run_results(results):
Assert.equal(len(results), 1, 'there should be only one test run result')
Assert.equal(run['name'].lower(), results[0].name.lower(),
'displayed run name differs from expected value')
Assert.equal(product_version_name, results[0].product_version,
'displayed test run productversion differs from expected value')
check_test_run_results(view_results_pg.test_run_results)
# refresh page and see that filter persists
view_results_pg.refresh()
check_test_run_results(view_results_pg.test_run_results)
# log out and back in and see that filter persists
view_results_pg.header.click_logout()
view_results_pg.header.click_login()
check_test_run_results(view_results_pg.test_run_results)
# check that filter is still pinned
filters = view_results_pg.filter_form.filter_items
Assert.equal(len(filters), 1)
self.check_pinned_filter(filters[0], is_pinned=True)