moztrap-tests/tests/test_run_tests_page.py

56 строки
2.0 KiB
Python
Исходник Обычный вид История

#!/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/.
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
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)
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'])
self.delete_profile(mozwebqa_logged_in, profile=case['profile'])
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)
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'])
self.delete_profile(mozwebqa_logged_in, profile=case['profile'])
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)
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']))
self.delete_product(mozwebqa_logged_in, product=case['product'])
self.delete_profile(mozwebqa_logged_in, profile=case['profile'])