Change conftest.py to auto-create and delete products via a 'product' method

Remove page object reference and locators from mock product
Change API to accept just credentials and base_url
Do not return product from create_product
Remove create_product_via_API method and test that just tests the creation via API
Update tests that require a product to use API for both creation and deletion
Eliminate all code the deletes products at the end of tests
This commit is contained in:
Bob Silverberg 2013-04-07 21:11:22 -04:00
Родитель 9ce6ce66fd
Коммит b7f66801c9
14 изменённых файлов: 81 добавлений и 149 удалений

Просмотреть файл

@ -6,6 +6,7 @@
import pytest
from mocks.mock_product import MockProduct
from mocks.moztrap_api import MoztrapAPI
@ -20,14 +21,19 @@ def mozwebqa_logged_in(request):
return mozwebqa
@pytest.fixture(scope='function', autouse=True)
def cleanup_product(request):
@pytest.fixture(scope='function')
def product(request):
"""Return a product created via the Moztrap API, and automatically delete the product after the test."""
mozwebqa = request.getfuncargvalue('mozwebqa')
request.product = MockProduct()
api = MoztrapAPI(mozwebqa.credentials, mozwebqa.base_url)
api.create_product(request.product)
# This acts like a tearDown, running after each test function
def fin():
# If a product was created via the API it will be stored in mozwebqa
if hasattr(mozwebqa, 'product'):
api = MoztrapAPI(mozwebqa)
api.delete_product(mozwebqa.product)
if hasattr(request, 'product'):
api = MoztrapAPI(mozwebqa.credentials, mozwebqa.base_url)
api.delete_product(request.product)
request.addfinalizer(fin)
return request.product

Просмотреть файл

@ -6,25 +6,17 @@
from datetime import datetime
from pages.create_product_page import MozTrapCreateProductPage
class MockProduct(dict):
def __init__(self, mozwebqa, name='Test Product', version='Test Version', description='This is a test product', profile=None):
# we need the MozTrapCreateProductPage in order to get the locators
create_product_page = MozTrapCreateProductPage(mozwebqa)
def __init__(self, name='Test Product', version='Test Version', description='This is a test product', profile=None):
dt_string = datetime.utcnow().isoformat()
self['id'] = None
self['name'] = u'%(name)s %(dt_string)s' % {'name': name, 'dt_string': dt_string}
self['description'] = u'%(desc)s created on %(dt_string)s' % {'desc': description, 'dt_string': dt_string}
self['locator'] = (create_product_page._product_locator[0], create_product_page._product_locator[1] % {'product_name': self['name']})
self['version'] = {}
self['version']['name'] = u'%(version)s %(dt_string)s' % {'version': version, 'dt_string': dt_string}
self['version']['manage_locator'] = (create_product_page._version_manage_locator[0], create_product_page._version_manage_locator[1] % {'product_name': self['name'], 'version_name': self['version']['name']})
self['version']['homepage_locator'] = (create_product_page._version_homepage_locator[0], create_product_page._version_homepage_locator[1] % {'product_name': self['name'], 'version_name': self['version']['name']})
self['profile'] = profile
# allow getting items as if they were attributes

Просмотреть файл

@ -12,14 +12,14 @@ import requests
class MoztrapAPI:
def __init__(self, mozwebqa):
user = mozwebqa.credentials['default']
def __init__(self, credentials, base_url):
user = credentials['default']
self.params = {
u'username': unicode(user['username']),
u'api_key': unicode(user['api_key']),
u'format': u'json',
}
self.base_url = mozwebqa.base_url
self.base_url = base_url
self.headers = {"content-type": "application/json"}
def _do_post(self, uri, post_data):
@ -64,7 +64,6 @@ class MoztrapAPI:
product['id'] = self._do_post(uri, post_data)
Assert.greater(product['id'], 0, 'No product was created.')
return product
def delete_product(self, product):

Просмотреть файл

@ -7,8 +7,6 @@
import requests
import json
from mocks.mock_product import MockProduct
from mocks.moztrap_api import MoztrapAPI
from pages.home_page import MozTrapHomePage
from pages.run_tests_page import MozTrapRunTestsPage
from pages.create_case_page import MozTrapCreateCasePage
@ -31,14 +29,6 @@ class BaseTest(object):
Base class for all Tests
'''
def create_product_via_API(self, mozwebqa, profile=None):
api = MoztrapAPI(mozwebqa)
product = MockProduct(mozwebqa)
product = api.create_product(product)
mozwebqa.product = product
return product
def create_product(self, mozwebqa, profile=None):
create_product_pg = MozTrapCreateProductPage(mozwebqa)
@ -54,39 +44,28 @@ class BaseTest(object):
manage_products_pg.filter_form.filter_by(lookup='name', value=product['name'])
manage_products_pg.delete_product(name=product['name'])
def create_version(self, mozwebqa, product=None):
def create_version(self, mozwebqa, product):
create_version_pg = MozTrapCreateVersionPage(mozwebqa)
if product is None:
product = self.create_product(mozwebqa)
version = product['version']
manage_versions_pg = MozTrapManageVersionsPage(mozwebqa)
manage_versions_pg.go_to_manage_versions_page()
else:
create_version_pg.go_to_create_version_page()
version = create_version_pg.create_version(product_name=product['name'])
create_version_pg.go_to_create_version_page()
version = create_version_pg.create_version(product_name=product['name'])
version['product'] = product
return version
def delete_version(self, mozwebqa, version, delete_product=False):
def delete_version(self, mozwebqa, version):
manage_versions_pg = MozTrapManageVersionsPage(mozwebqa)
manage_versions_pg.go_to_manage_versions_page()
manage_versions_pg.filter_form.filter_by(lookup='version', value=version['name'])
manage_versions_pg.delete_version(name=version['name'], product_name=version['product']['name'])
if delete_product:
self.delete_product(mozwebqa, product=version['product'])
def create_run(self, mozwebqa, activate=False, product=None, version=None, suite_name_list=None):
def create_run(self, mozwebqa, product, activate=False, version=None, suite_name_list=None):
create_run_pg = MozTrapCreateRunPage(mozwebqa)
if version is None:
version = self.create_version(mozwebqa, product=product)
if product is None:
product = version['product']
create_run_pg.go_to_create_run_page()
product_version = u'%(product_name)s %(version_name)s' % {'product_name': product['name'], 'version_name': version['name']}
@ -100,7 +79,7 @@ class BaseTest(object):
return run
def delete_run(self, mozwebqa, run, delete_version=False, delete_product=False):
def delete_run(self, mozwebqa, run, delete_version=False):
manage_runs_pg = MozTrapManageRunsPage(mozwebqa)
manage_runs_pg.go_to_manage_runs_page()
@ -108,37 +87,28 @@ class BaseTest(object):
manage_runs_pg.delete_run(name=run['name'])
if delete_version:
self.delete_version(mozwebqa, version=run['version'], delete_product=delete_product)
self.delete_version(mozwebqa, version=run['version'])
def create_suite(self, mozwebqa, status='active', product=None, case_name_list=None, **kwargs):
def create_suite(self, mozwebqa, product, status='active', case_name_list=None, **kwargs):
create_suite_pg = MozTrapCreateSuitePage(mozwebqa)
if product is None:
product = self.create_product(mozwebqa)
create_suite_pg.go_to_create_suite_page()
suite = create_suite_pg.create_suite(product=product['name'], status=status, case_list=case_name_list, **kwargs)
suite['product'] = product
return suite
def delete_suite(self, mozwebqa, suite, delete_product=False):
def delete_suite(self, mozwebqa, suite):
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'])
def create_case(self, mozwebqa, status='active', product=None, version=None, suite_name=None):
def create_case(self, mozwebqa, product, status='active', version=None, suite_name=None):
create_case_pg = MozTrapCreateCasePage(mozwebqa)
if product is None:
product = self.create_product(mozwebqa)
version = product['version']
elif version is None:
if version is None:
version = product['version']
create_case_pg.go_to_create_case_page()
@ -147,16 +117,13 @@ class BaseTest(object):
return case
def delete_case(self, mozwebqa, case, delete_product=False):
def delete_case(self, mozwebqa, case):
manage_cases_pg = MozTrapManageCasesPage(mozwebqa)
manage_cases_pg.go_to_manage_cases_page()
manage_cases_pg.filter_form.filter_by(lookup='name', value=case['name'])
manage_cases_pg.delete_case(name=case['name'])
if delete_product:
self.delete_product(mozwebqa, product=case['product'])
def create_profile(self, mozwebqa):
create_profile_pg = MozTrapCreateProfilePage(mozwebqa)
@ -194,13 +161,10 @@ class BaseTest(object):
return case
def create_bulk_cases(self, mozwebqa, cases_amount=2, status='active', product=None, version=None, suite_name=None, **kwargs):
def create_bulk_cases(self, mozwebqa, product, cases_amount=2, status='active', version=None, suite_name=None, **kwargs):
create_bulk_cases_pg = MozTrapCreateBulkCasesPage(mozwebqa)
if product is None:
product = self.create_product(mozwebqa)
version = product['version']
elif version is None:
if version is None:
version = product['version']
create_bulk_cases_pg.go_to_create_bulk_cases_page()

Просмотреть файл

@ -19,6 +19,7 @@ class MozTrapHomePage(MozTrapBasePage):
_language_locator = (By.CSS_SELECTOR, '#runtests-environment-form .language-field select')
_os_locator = (By.CSS_SELECTOR, '#runtests-environment-form .operating-system-field select')
_submit_locator = (By.CSS_SELECTOR, '#runtests-environment-form .form-actions button[type="submit"]')
_version_homepage_locator = (By.CSS_SELECTOR, '.runsdrill .runsfinder .productversions .colcontent .title[title="%(version_name)s"][data-product="%(product_name)s"]')
def go_to_home_page(self):
self.selenium.get(self.base_url + '/')
@ -45,3 +46,11 @@ class MozTrapHomePage(MozTrapBasePage):
env_select = Select(self.find_element(*_env_select_locator))
env_select.select_by_visible_text(env_element)
self.find_element(*self._submit_locator).click()
def is_product_version_visible(self, product):
_product_version_locator = (
self._version_homepage_locator[0],
self._version_homepage_locator[1] %
{'product_name': product['name'], 'version_name': product['version']['name']}
)
return self.is_element_visible(*_product_version_locator)

Просмотреть файл

@ -15,6 +15,7 @@ class MozTrapManageProductsPage(MozTrapBasePage):
_page_title = 'Manage-Products'
_delete_product_locator = (By.CSS_SELECTOR, '#manageproducts .listitem .controls .action-delete[title="delete %(product_name)s"]')
_product_locator = (By.CSS_SELECTOR, '#manageproducts .listitem .title[title="%(product_name)s"]')
@property
def filter_form(self):
@ -29,3 +30,7 @@ class MozTrapManageProductsPage(MozTrapBasePage):
self.selenium.find_element(*_delete_locator).click()
self.wait_for_ajax()
def is_product_present(self, product):
_product_locator = (self._product_locator[0], self._product_locator[1] % {'product_name': product['name']})
return self.is_element_present(*_product_locator)

Просмотреть файл

@ -14,12 +14,6 @@ from pages.base_test import BaseTest
class TestHomepage(BaseTest):
@pytest.mark.skip_selenium
def test_create_product_via_API(self, mozwebqa):
product = self.create_product_via_API(mozwebqa)
Assert.true(product['id'] > 0)
@pytest.mark.moztrap([3385, 3386])
@pytest.mark.nondestructive
def test_that_user_can_login_and_logout(self, mozwebqa):
@ -46,26 +40,22 @@ class TestHomepage(BaseTest):
Assert.false(home_pg.header.is_user_logged_in)
@pytest.mark.moztrap(3387)
def test_that_user_can_select_product(self, mozwebqa_logged_in):
def test_that_user_can_select_product(self, mozwebqa_logged_in, product):
home_pg = MozTrapHomePage(mozwebqa_logged_in)
product = self.create_product(mozwebqa_logged_in)
home_pg.go_to_home_page()
Assert.false(home_pg.is_element_visible(*product['version']['homepage_locator']))
Assert.false(home_pg.is_product_version_visible(product))
home_pg.select_item(product['name'])
Assert.true(home_pg.is_element_visible(*product['version']['homepage_locator']))
self.delete_product(mozwebqa_logged_in, product=product)
Assert.true(home_pg.is_product_version_visible(product))
@pytest.mark.moztrap(3388)
def test_that_user_can_select_version(self, mozwebqa_logged_in):
def test_that_user_can_select_version(self, mozwebqa_logged_in, product):
home_pg = MozTrapHomePage(mozwebqa_logged_in)
run = self.create_run(mozwebqa_logged_in, activate=True)
run = self.create_run(mozwebqa_logged_in, activate=True, product=product)
home_pg.go_to_home_page()
home_pg.select_item(run['version']['product']['name'])
@ -76,13 +66,11 @@ class TestHomepage(BaseTest):
Assert.true(home_pg.is_element_visible(*run['homepage_locator']))
self.delete_product(mozwebqa_logged_in, product=run['version']['product'])
@pytest.mark.moztrap(3414)
def test_that_user_can_select_run(self, mozwebqa_logged_in):
def test_that_user_can_select_run(self, mozwebqa_logged_in, product):
home_pg = MozTrapHomePage(mozwebqa_logged_in)
run = self.create_run(mozwebqa_logged_in, activate=True)
run = self.create_run(mozwebqa_logged_in, activate=True, product=product)
home_pg.go_to_home_page()
home_pg.select_item(run['version']['product']['name'])
@ -93,5 +81,3 @@ class TestHomepage(BaseTest):
home_pg.select_item(run['name'])
Assert.true(home_pg.is_element_visible(*run['run_tests_locator']))
self.delete_product(mozwebqa_logged_in, product=run['version']['product'])

Просмотреть файл

@ -14,10 +14,10 @@ from pages.manage_cases_page import MozTrapManageCasesPage
class TestManageCasesPage(BaseTest):
@pytest.mark.moztrap([142, 137])
def test_that_user_can_create_and_delete_case(self, mozwebqa_logged_in):
def test_that_user_can_create_and_delete_case(self, mozwebqa_logged_in, product):
manage_cases_pg = MozTrapManageCasesPage(mozwebqa_logged_in)
case = self.create_case(mozwebqa_logged_in)
case = self.create_case(mozwebqa_logged_in, product)
manage_cases_pg.filter_form.filter_by(lookup='name', value=case['name'])
@ -27,13 +27,10 @@ class TestManageCasesPage(BaseTest):
Assert.false(manage_cases_pg.is_element_present(*case['locator']))
self.delete_product(mozwebqa_logged_in, product=case['product'])
def test_that_deleting_single_version_of_case_does_not_delete_all_versions(self, mozwebqa_logged_in):
def test_that_deleting_single_version_of_case_does_not_delete_all_versions(self, mozwebqa_logged_in, product):
"""test for https://www.pivotaltracker.com/projects/280483#!/stories/40857085"""
#prerequisites
product = self.create_product(mozwebqa_logged_in)
first_version = product['version']
test_case = self.create_case(mozwebqa_logged_in, product=product, version=first_version)
second_version = self.create_version(mozwebqa_logged_in, product=product)
@ -58,11 +55,10 @@ class TestManageCasesPage(BaseTest):
Assert.equal(test_cases[0].name, test_case['name'], u'that\'s wrong test case')
Assert.equal(test_cases[0].product_version, product_versions[0], u'that\'s wrong product version')
def test_that_manage_cases_list_shows_all_case_versions_individually(self, mozwebqa_logged_in):
def test_that_manage_cases_list_shows_all_case_versions_individually(self, mozwebqa_logged_in, product):
"""https://www.pivotaltracker.com/projects/280483#!/stories/40857159"""
#prerequisites
product = self.create_product(mozwebqa_logged_in)
first_version = product['version']
test_case = self.create_case(mozwebqa_logged_in, product=product, version=first_version)
second_version = self.create_version(mozwebqa_logged_in, product=product)

Просмотреть файл

@ -28,35 +28,29 @@ class TestManageProductsPage(BaseTest):
Assert.false(manage_products_pg.is_element_present(*product['locator']))
@pytest.mark.moztrap(151)
def test_that_user_can_filter_product_by_name(self, mozwebqa_logged_in):
def test_that_user_can_filter_product_by_name(self, mozwebqa_logged_in, product):
manage_products_pg = MozTrapManageProductsPage(mozwebqa_logged_in)
product = self.create_product(mozwebqa_logged_in)
manage_products_pg.go_to_manage_products_page()
filter_item = manage_products_pg.filter_form.filter_by(lookup='name', value='Another Product')
Assert.false(manage_products_pg.is_element_present(*product['locator']))
Assert.false(manage_products_pg.is_product_present(product))
filter_item.remove_filter()
manage_products_pg.filter_form.filter_by(lookup='name', value=product['name'])
Assert.true(manage_products_pg.is_element_present(*product['locator']))
manage_products_pg.delete_product(name=product['name'])
Assert.true(manage_products_pg.is_product_present(product))
@pytest.mark.moztrap(3415)
def test_that_user_can_filter_product_by_name_without_mouse(self, mozwebqa_logged_in):
def test_that_user_can_filter_product_by_name_without_mouse(self, mozwebqa_logged_in, product):
manage_products_pg = MozTrapManageProductsPage(mozwebqa_logged_in)
product = self.create_product(mozwebqa_logged_in)
manage_products_pg.go_to_manage_products_page()
filter_item = manage_products_pg.filter_form.filter_without_mouse_by(lookup='name', value='Another Product')
Assert.false(manage_products_pg.is_element_present(*product['locator']))
Assert.false(manage_products_pg.is_product_present(product))
filter_item.remove_filter()
manage_products_pg.filter_form.filter_without_mouse_by(lookup='name', value=product['name'])
Assert.true(manage_products_pg.is_element_present(*product['locator']))
manage_products_pg.delete_product(name=product['name'])
Assert.true(manage_products_pg.is_product_present(product))

Просмотреть файл

@ -14,10 +14,10 @@ from pages.manage_runs_page import MozTrapManageRunsPage
class TestManageRunsPage(BaseTest):
@pytest.mark.moztrap([113, 112])
def test_that_user_can_create_and_delete_run(self, mozwebqa_logged_in):
def test_that_user_can_create_and_delete_run(self, mozwebqa_logged_in, product):
manage_runs_pg = MozTrapManageRunsPage(mozwebqa_logged_in)
run = self.create_run(mozwebqa_logged_in)
run = self.create_run(mozwebqa_logged_in, product=product)
manage_runs_pg.filter_form.filter_by(lookup='name', value=run['name'])
@ -26,5 +26,3 @@ class TestManageRunsPage(BaseTest):
manage_runs_pg.delete_run(name=run['name'])
Assert.false(manage_runs_pg.is_element_present(*run['manage_locator']))
self.delete_version(mozwebqa_logged_in, version=run['version'], delete_product=True)

Просмотреть файл

@ -14,10 +14,10 @@ from pages.manage_suites_page import MozTrapManageSuitesPage
class TestManageSuitesPage(BaseTest):
@pytest.mark.moztrap([98, 99])
def test_that_user_can_create_and_delete_suite(self, mozwebqa_logged_in):
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)
suite = self.create_suite(mozwebqa_logged_in, product)
manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
@ -27,12 +27,9 @@ class TestManageSuitesPage(BaseTest):
Assert.false(manage_suites_pg.is_element_present(*suite['locator']))
self.delete_product(mozwebqa_logged_in, product=suite['product'])
def test_that_user_can_create_suite_and_add_some_cases_to_it(self, mozwebqa_logged_in):
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)
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])
@ -46,9 +43,8 @@ class TestManageSuitesPage(BaseTest):
Assert.true(manage_test_cases_pg.is_element_present(*case['locator']))
@pytest.mark.moztrap(2743)
def test_editing_of_existing_suite_that_has_no_included_cases(self, mozwebqa_logged_in):
#create product, suite and cases
product = self.create_product(mozwebqa_logged_in)
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=product)
cases = self.create_bulk_cases(mozwebqa_logged_in, cases_amount=3, product=product)

Просмотреть файл

@ -15,10 +15,10 @@ from pages.manage_versions_page import MozTrapManageVersionsPage
class TestManageVersionsPage(BaseTest):
@pytest.mark.moztrap([3389, 3390])
def test_that_user_can_create_and_delete_version(self, mozwebqa_logged_in):
def test_that_user_can_create_and_delete_version(self, mozwebqa_logged_in, product):
manage_versions_pg = MozTrapManageVersionsPage(mozwebqa_logged_in)
version = self.create_version(mozwebqa_logged_in)
version = self.create_version(mozwebqa_logged_in, product)
manage_versions_pg.filter_form.filter_by(lookup='version', value=version['name'])
@ -28,13 +28,11 @@ class TestManageVersionsPage(BaseTest):
Assert.false(manage_versions_pg.is_element_present(*version['manage_locator']))
self.delete_product(mozwebqa_logged_in, version['product'])
@pytest.mark.moztrap(3391)
def test_that_user_can_filter_version_by_name(self, mozwebqa_logged_in):
def test_that_user_can_filter_version_by_name(self, mozwebqa_logged_in, product):
manage_versions_pg = MozTrapManageVersionsPage(mozwebqa_logged_in)
version = self.create_version(mozwebqa_logged_in)
version = self.create_version(mozwebqa_logged_in, product)
filter_item = manage_versions_pg.filter_form.filter_by(lookup='version', value='Another Version')
@ -45,13 +43,11 @@ class TestManageVersionsPage(BaseTest):
Assert.true(manage_versions_pg.is_element_present(*version['manage_locator']))
self.delete_version(mozwebqa_logged_in, version, delete_product=True)
@pytest.mark.moztrap(3392)
def test_that_user_can_clone_version(self, mozwebqa_logged_in):
def test_that_user_can_clone_version(self, mozwebqa_logged_in, product):
manage_versions_pg = MozTrapManageVersionsPage(mozwebqa_logged_in)
version = self.create_version(mozwebqa_logged_in)
version = self.create_version(mozwebqa_logged_in, product)
manage_versions_pg.filter_form.filter_by(lookup='version', value=version['name'])
@ -62,5 +58,3 @@ class TestManageVersionsPage(BaseTest):
manage_versions_pg.delete_version(name=cloned_version['name'], product_name=cloned_version['product_name'])
Assert.false(manage_versions_pg.is_element_present(*cloned_version['manage_locator']))
self.delete_version(mozwebqa_logged_in, version, delete_product=True)

Просмотреть файл

@ -17,8 +17,7 @@ class TestPinningFilters(BaseTest):
@pytest.mark.moztrap(5935)
@pytest.mark.nondestructive
def test_that_pinning_filter_on_product_version_set_defaults_in_new_run(self, mozwebqa_logged_in):
product = self.create_product(mozwebqa_logged_in)
def test_that_pinning_filter_on_product_version_set_defaults_in_new_run(self, mozwebqa_logged_in, product):
product_version_name = u'%s %s' % (product['name'], product['version']['name'])
from pages.manage_runs_page import MozTrapManageRunsPage
@ -49,9 +48,7 @@ class TestPinningFilters(BaseTest):
@pytest.mark.moztrap(5933)
@pytest.mark.nondestructive
def test_that_pinning_filters_on_product_sets_defaults_in_new_suite(self, mozwebqa_logged_in):
product = self.create_product(mozwebqa_logged_in)
def test_that_pinning_filters_on_product_sets_defaults_in_new_suite(self, mozwebqa_logged_in, product):
from pages.manage_suites_page import MozTrapManageSuitesPage
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
manage_suites_pg.go_to_manage_suites_page()
@ -80,8 +77,7 @@ class TestPinningFilters(BaseTest):
@pytest.mark.moztrap(5932)
@pytest.mark.nondestructive
def test_that_pinning_filters_on_product_and_version_and_suite_set_defaults_in_new_case(self, mozwebqa_logged_in):
product = self.create_product(mozwebqa_logged_in)
def test_that_pinning_filters_on_product_and_version_and_suite_set_defaults_in_new_case(self, mozwebqa_logged_in, product):
version = product['version']
product_version_name = u'%s %s' % (product['name'], version['name'])
suite = self.create_suite(mozwebqa_logged_in, product=product)
@ -115,9 +111,7 @@ class TestPinningFilters(BaseTest):
@pytest.mark.moztrap(5936)
@pytest.mark.nondestructive
def test_that_pinning_filter_on_product_sets_defaults_in_new_product_version(self, mozwebqa_logged_in):
product = self.create_product(mozwebqa_logged_in)
def test_that_pinning_filter_on_product_sets_defaults_in_new_product_version(self, mozwebqa_logged_in, product):
from pages.manage_versions_page import MozTrapManageVersionsPage
manage_versions_pg = MozTrapManageVersionsPage(mozwebqa_logged_in)
manage_versions_pg.go_to_manage_versions_page()

Просмотреть файл

@ -121,9 +121,8 @@ class TestRunTestsPage(BaseTest):
Assert.equal(actual_order, expected_order)
@pytest.mark.moztrap(3302)
def test_for_edit_active_run_that_includes_suites_to_be_sure_they_are_listed(self, mozwebqa_logged_in):
#create product and version
product = self.create_product(mozwebqa_logged_in)
def test_for_edit_active_run_that_includes_suites_to_be_sure_they_are_listed(self, mozwebqa_logged_in, product):
#create version
version = product['version']
#create two test suites
suite_a = self.create_suite(mozwebqa_logged_in, product=product, name='suite A')