This commit is contained in:
sashakruglov 2013-01-15 02:40:44 +04:00
Родитель fa51c0c5ff
Коммит 692694b65f
6 изменённых файлов: 6 добавлений и 22 удалений

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

@ -64,7 +64,7 @@ class MozTrapCreateRunPage(MozTrapBasePage):
self.selenium.find_element(*self._end_date_locator).send_keys(end_date)
if suite_list:
for suite in suite_list:
for suite in reversed(suite_list):
suite_input_element = self.selenium.find_element(By.XPATH, "//article[@data-title='%s']//label" % suite)
suite_input_element.click()
self.selenium.find_element(*self._include_selected_suites_locator).click()

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

@ -46,7 +46,7 @@ class MozTrapCreateSuitePage(MozTrapBasePage):
status_select.select_by_visible_text(status)
if case_list:
for case in case_list:
for case in reversed(case_list):
case_element = self.selenium.find_element(By.XPATH, "//article[@data-title='%s']/div/label" % case)
case_element.click()
self.selenium.find_element(*self._include_selected_cases_locator).click()

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

@ -4,7 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from datetime import datetime
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

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

@ -64,7 +64,7 @@ class MozTrapManageRunsPage(MozTrapBasePage):
self.wait_for_ajax()
def go_to_edit_run_page(self, name='Test Run'):
_edit_run_locator= (self._edit_run_locator[0], self._edit_run_locator[1] % {'run_name' : name})
_edit_run_locator = (self._edit_run_locator[0], self._edit_run_locator[1] % {'run_name': name})
self.selenium.find_element(*_edit_run_locator).click()
from pages.edit_run_page import MozTrapEditRunPage

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

@ -109,4 +109,3 @@ class MozTrapRunTestsPage(MozTrapBasePage):
@property
def position_number(self):
return self.selenium.find_element(*self._case_position_number_locator).text

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

@ -66,26 +66,21 @@ class TestRunTestsPage(BaseTest):
profile = self.create_profile(mozwebqa_logged_in)
product = self.create_product(mozwebqa_logged_in, profile['name'])
version = product['version']
#create several test case via bulk create
cases = self.create_bulk_cases(mozwebqa_logged_in, cases_amount=5, product=product, name='is')
#create first test suite
suite_a_cases = (cases[3]['name'], cases[1]['name'])
suite_a = self.create_suite(
mozwebqa_logged_in, product=product, name='suite A', case_name_list=reversed(suite_a_cases))
mozwebqa_logged_in, product=product, name='suite A', case_name_list=suite_a_cases)
#create second test suite
suite_b_cases = (cases[2]['name'], cases[0]['name'], cases[4]['name'])
suite_b = self.create_suite(
mozwebqa_logged_in, product=product, name='suite B', case_name_list=reversed(suite_b_cases))
mozwebqa_logged_in, product=product, name='suite B', case_name_list=suite_b_cases)
#create first test run (suite a, suite b)
first_suite_order = (suite_a['name'], suite_b['name'])
first_run = self.create_run(
mozwebqa_logged_in, activate=True, product=product,
version=version, suite_name_list=reversed(first_suite_order))
version=version, suite_name_list=first_suite_order)
#execute first test run
home_page = MozTrapHomePage(mozwebqa_logged_in)
home_page.go_to_home_page()
@ -98,38 +93,29 @@ class TestRunTestsPage(BaseTest):
expected_order = [(case, suite) for case in suite_a_cases for suite in (suite_a['name'],)] + \
[(case, suite) for case in suite_b_cases for suite in (suite_b['name'],)]
#assert that right order saved
Assert.equal(actual_order, expected_order)
#edit run to reorder suites
manage_runs_pg = MozTrapManageRunsPage(mozwebqa_logged_in)
manage_runs_pg.go_to_manage_runs_page()
#push run into draft mode
manage_runs_pg.filter_runs_by_name(first_run['name'])
manage_runs_pg.make_run_draft(first_run['name'])
#go to edit run page and reorder suites by name (suite b, suite a)
edit_run_pg = manage_runs_pg.go_to_edit_run_page(first_run['name'])
second_run = edit_run_pg.edit_run(first_run, reorder_suites=True)
#make run active again
manage_runs_pg.filter_runs_by_name(first_run['name'])
manage_runs_pg.activate_run(first_run['name'])
#execute run again
home_page.go_to_home_page()
home_page.go_to_run_test(
product_name=product['name'], version_name=version['name'], run_name=first_run['name'],
env_category=profile['category'], env_element=profile['element'])
#check actual order of items on run tests page
actual_order = [(item.name, item.suite_name) for item in run_tests_pg.test_items]
expected_order = [(case, suite) for case in suite_b_cases for suite in (suite_b['name'],)] + \
[(case, suite) for case in suite_a_cases for suite in (suite_a['name'],)]
#assert that right order saved
Assert.equal(actual_order, expected_order)