2011-12-13 02:43:00 +04:00
|
|
|
#!/usr/bin/env python
|
2012-02-20 19:10:25 +04:00
|
|
|
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# 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/.
|
2011-12-13 02:43:00 +04:00
|
|
|
|
|
|
|
from unittestzero import Assert
|
|
|
|
|
2012-07-19 16:37:00 +04:00
|
|
|
from pages.base_test import BaseTest
|
|
|
|
from pages.run_tests_page import MozTrapRunTestsPage
|
|
|
|
|
2011-12-13 02:43:00 +04:00
|
|
|
|
|
|
|
class TestRunTestsPage(BaseTest):
|
|
|
|
|
|
|
|
def test_that_user_can_pass_test(self, mozwebqa_logged_in):
|
2012-03-30 23:40:49 +04:00
|
|
|
run_tests_pg = MozTrapRunTestsPage(mozwebqa_logged_in)
|
2011-12-13 02:43:00 +04:00
|
|
|
|
|
|
|
case = self.create_and_run_test(mozwebqa_logged_in)
|
|
|
|
|
|
|
|
Assert.false(run_tests_pg.is_test_passed(case_name=case['name']))
|
|
|
|
|
|
|
|
run_tests_pg.pass_test(case_name=case['name'])
|
|
|
|
|
|
|
|
Assert.true(run_tests_pg.is_test_passed(case_name=case['name']))
|
|
|
|
|
2012-03-17 01:17:41 +04:00
|
|
|
self.delete_product(mozwebqa_logged_in, product=case['product'])
|
2012-03-31 01:40:51 +04:00
|
|
|
self.delete_profile(mozwebqa_logged_in, profile=case['profile'])
|
2011-12-14 21:07:43 +04:00
|
|
|
|
|
|
|
def test_that_user_can_fail_test(self, mozwebqa_logged_in):
|
2012-03-30 23:40:49 +04:00
|
|
|
run_tests_pg = MozTrapRunTestsPage(mozwebqa_logged_in)
|
2011-12-14 21:07:43 +04:00
|
|
|
|
|
|
|
case = self.create_and_run_test(mozwebqa_logged_in)
|
|
|
|
|
|
|
|
Assert.false(run_tests_pg.is_test_failed(case_name=case['name']))
|
|
|
|
|
|
|
|
run_tests_pg.fail_test(case_name=case['name'])
|
|
|
|
|
|
|
|
Assert.true(run_tests_pg.is_test_failed(case_name=case['name']))
|
|
|
|
|
2012-03-17 01:25:23 +04:00
|
|
|
self.delete_product(mozwebqa_logged_in, product=case['product'])
|
2012-03-31 01:40:51 +04:00
|
|
|
self.delete_profile(mozwebqa_logged_in, profile=case['profile'])
|
2011-12-14 21:49:37 +04:00
|
|
|
|
|
|
|
def test_that_user_can_mark_test_invalid(self, mozwebqa_logged_in):
|
2012-03-30 23:40:49 +04:00
|
|
|
run_tests_pg = MozTrapRunTestsPage(mozwebqa_logged_in)
|
2011-12-14 21:49:37 +04:00
|
|
|
|
|
|
|
case = self.create_and_run_test(mozwebqa_logged_in)
|
|
|
|
|
|
|
|
Assert.false(run_tests_pg.is_test_invalid(case_name=case['name']))
|
|
|
|
|
|
|
|
run_tests_pg.mark_test_invalid(case_name=case['name'])
|
|
|
|
|
|
|
|
Assert.true(run_tests_pg.is_test_invalid(case_name=case['name']))
|
|
|
|
|
2012-03-17 01:30:13 +04:00
|
|
|
self.delete_product(mozwebqa_logged_in, product=case['product'])
|
2012-03-31 01:40:51 +04:00
|
|
|
self.delete_profile(mozwebqa_logged_in, profile=case['profile'])
|