Skip to content
Browse files

All tests now create (and delete) their own environment profiles.

  • Loading branch information...
1 parent 41f60db commit f3966f689f9e780addc896ef5fd43b056eea1f3c @jgerigmeyer jgerigmeyer committed
Showing with 15 additions and 8 deletions.
  1. +7 −3 base_test.py
  2. +5 −5 home_page.py
  3. +3 −0 test_run_tests_page.py
View
10 base_test.py
@@ -161,17 +161,21 @@ def delete_profile(self, mozwebqa, profile):
create_profile_pg.go_to_create_profile_page()
create_profile_pg.delete_environment_category(category_name=profile['category'])
- def create_and_run_test(self, mozwebqa):
+ def create_and_run_test(self, mozwebqa, profile=None):
home_pg = MozTrapHomePage(mozwebqa)
manage_suites_pg = MozTrapManageSuitesPage(mozwebqa)
run_tests_pg = MozTrapRunTestsPage(mozwebqa)
- product = self.create_product(mozwebqa, profile='Website Testing Environments')
+ if profile is None:
+ profile = self.create_profile(mozwebqa)
+
+ product = self.create_product(mozwebqa, profile=profile['name'])
suite = self.create_suite(mozwebqa, product=product)
case = self.create_case(mozwebqa, product=product, version=product['version'], suite_name=suite['name'])
+ case['profile'] = profile
run = self.create_run(mozwebqa, activate=True, product=product, version=product['version'], suite_name_list=[suite['name']])
home_pg.go_to_homepage_page()
- home_pg.go_to_run_test(product_name=product['name'], version_name=product['version']['name'], run_name=run['name'])
+ home_pg.go_to_run_test(product_name=product['name'], version_name=product['version']['name'], run_name=run['name'], env_category=profile['category'], env_element=profile['element'])
return case
View
10 home_page.py
@@ -12,7 +12,7 @@ class MozTrapHomePage(MozTrapBasePage):
_page_title = 'MozTrap'
_select_locator = u'css=.runsdrill .runsfinder .carousel .colcontent .title[title="%(item_name)s"]'
- _browser_locator = 'css=#runtests-environment-form .browser-field select'
+ _env_select_locator = 'css=#runtests-environment-form .formfield[data-title="%(env_category)s"] select'
_language_locator = 'css=#runtests-environment-form .language-field select'
_os_locator = 'css=#runtests-environment-form .operating-system-field select'
_submit_locator = 'css=#runtests-environment-form .form-actions button[type="submit"]'
@@ -27,11 +27,11 @@ def select_item(self, name):
self.click(_select_locator)
self.wait_for_ajax()
- def go_to_run_test(self, product_name, version_name, run_name, browser='Firefox', language='English', os='OS X'):
+ def go_to_run_test(self, product_name, version_name, run_name, env_category, env_element):
+ _env_select_locator = self._env_select_locator % {'env_category': env_category}
+
self.select_item(product_name)
self.select_item(version_name)
self.select_item(run_name)
- self.select(self._browser_locator, browser)
- self.select(self._language_locator, language)
- self.select(self._os_locator, os)
+ self.select(_env_select_locator, env_element)
self.click(self._submit_locator, wait_flag=True)
View
3 test_run_tests_page.py
@@ -23,6 +23,7 @@ def test_that_user_can_pass_test(self, mozwebqa_logged_in):
Assert.true(run_tests_pg.is_test_passed(case_name=case['name']))
self.delete_product(mozwebqa_logged_in, product=case['product'])
+ self.delete_profile(mozwebqa_logged_in, profile=case['profile'])
def test_that_user_can_fail_test(self, mozwebqa_logged_in):
run_tests_pg = MozTrapRunTestsPage(mozwebqa_logged_in)
@@ -36,6 +37,7 @@ def test_that_user_can_fail_test(self, mozwebqa_logged_in):
Assert.true(run_tests_pg.is_test_failed(case_name=case['name']))
self.delete_product(mozwebqa_logged_in, product=case['product'])
+ self.delete_profile(mozwebqa_logged_in, profile=case['profile'])
def test_that_user_can_mark_test_invalid(self, mozwebqa_logged_in):
run_tests_pg = MozTrapRunTestsPage(mozwebqa_logged_in)
@@ -49,3 +51,4 @@ def test_that_user_can_mark_test_invalid(self, mozwebqa_logged_in):
Assert.true(run_tests_pg.is_test_invalid(case_name=case['name']))
self.delete_product(mozwebqa_logged_in, product=case['product'])
+ self.delete_profile(mozwebqa_logged_in, profile=case['profile'])

0 comments on commit f3966f6

Please sign in to comment.
Something went wrong with that request. Please try again.