Skip to content

Loading…

add series_run option to create_run #84

Merged
merged 1 commit into from

2 participants

@bebef1987
Mozilla member

fix issue #83

@AlinT

Lgtm

@AlinT AlinT merged commit f32d279 into mozilla:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 4, 2012
  1. @bebef1987
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 1 deletion.
  1. +14 −1 pages/create_run_page.py
View
15 pages/create_run_page.py
@@ -27,23 +27,36 @@ class MozTrapCreateRunPage(MozTrapBasePage):
_run_manage_locator = (By.CSS_SELECTOR, '#manageruns .itemlist .listitem .title[title="%(run_name)s"]')
_run_homepage_locator = (By.CSS_SELECTOR, '.runsdrill .runsfinder .runs .colcontent .title[title="%(run_name)s"]')
_run_tests_button_locator = (By.CSS_SELECTOR, 'div.form-actions > button')
+ _series_run_locator = (By.ID, 'id_is_series')
def go_to_create_run_page(self):
self.selenium.get(self.base_url + '/manage/run/add/')
self.is_the_current_page
- def create_run(self, name='Test Run', product_version='Test Product Test Version', desc='This is a test run', start_date='2011-01-01', end_date='2012-12-31', suite_list=None):
+ def create_run(self, name='Test Run', product_version='Test Product Test Version', desc='This is a test run', start_date='2011-01-01', end_date='2012-12-31', suite_list=None, series_run=False):
dt_string = datetime.utcnow().isoformat()
run = {}
run['name'] = u'%(name)s %(dt_string)s' % {'name': name, 'dt_string': dt_string}
run['desc'] = u'%(desc)s created on %(dt_string)s' % {'desc': desc, 'dt_string': dt_string}
+ run['series'] = series_run
run['manage_locator'] = (self._run_manage_locator[0], self._run_manage_locator[1] % {'run_name': run['name']})
run['homepage_locator'] = (self._run_homepage_locator[0], self._run_homepage_locator[1] % {'run_name': run['name']})
run['run_tests_locator'] = self._run_tests_button_locator
+
name_field = self.selenium.find_element(*self._name_locator)
name_field.send_keys(run['name'])
+ series_element = self.selenium.find_element(*self._series_run_locator)
+
+ if series_element.is_selected():
+ if not series_run:
+ series_element.click()
+ else:
+ if series_run:
+ series_element.click()
+
+
product_version_select = Select(self.selenium.find_element(*self._product_version_select_locator))
product_version_select.select_by_visible_text(product_version)
Something went wrong with that request. Please try again.