Changes in pyenvjasmine/tests/test_runner.py [36:4c964b691922:33:d466f464c871] in pyenvjasmine
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pyenvjasmine/tests/test_runner.py
r36 r33 5 5 6 6 7 class TestsRunnerRhino(object): 8 9 """ 10 Run the full tests using the old rhino+jasmine1 env 11 """ 7 class TestsRunner(object): 12 8 13 9 def test_runner_defaults(self): … … 15 11 Test the runner, using default values (which wil run the demo specs) 16 12 """ 17 jstests = Runner( testing_enviroment='rhino')13 jstests = Runner() 18 14 success, stdout = jstests.run() 19 15 assert success … … 30 26 envjasmine_dir = os.path.join(os.path.dirname(here), 'envjasmine') 31 27 jstests = Runner( 32 testing_enviroment='rhino',33 28 rootdir=envjasmine_dir, 34 29 testdir=sample, … … 52 47 envjasmine_dir = os.path.join(os.path.dirname(here), 'envjasmine') 53 48 jstests = Runner( 54 testing_enviroment='rhino',55 49 rootdir=envjasmine_dir, 56 50 testdir=sample, … … 74 68 envjasmine_dir = os.path.join(os.path.dirname(here), 'envjasmine') 75 69 jstests = Runner( 76 testing_enviroment='rhino',77 70 rootdir=envjasmine_dir, 78 71 testdir=sample, … … 104 97 # but we want to test also the case when a test failed 105 98 # and it does not appear in the "Failed:" report 106 jstests = Runner( testing_enviroment='rhino')99 jstests = Runner() 107 100 success = jstests.did_test_pass('') 108 101 assert not success … … 127 120 success = jstests.did_test_pass('Failed: something-not-a-number') 128 121 assert not success 129 130 class TestsRunnerPhantomjs(object):131 132 """133 Run the full tests using the phantom+jasmine3 env134 """135 136 def test_write_browser_htmlfile_markup_is_correct(self):137 """138 Test the created markup139 The config file doesn't contain the mock files so jasmine tests140 are expected to fail141 """142 here = os.path.dirname(__file__)143 sample = os.path.join(here, 'sample')144 browser_conf_file = os.path.join(sample, 'browser.configfile_no_mocks.js')145 envjasmine_dir = os.path.join(os.path.dirname(here), 'envjasmine')146 jstests = Runner(147 testing_enviroment='phantomjs',148 rootdir=envjasmine_dir,149 testdir=sample,150 browser_configfile=browser_conf_file151 )152 expected = jstests.create_testRunnerHtml()153 jstests.write_browser_htmlfile()154 success, stdout = jstests.run()155 assert not success156 assert '2 test(s) FAILED:' in stdout157 with open("browser.runner.html",'r') as file:158 actual = file.read()159 assert expected == actual160 161 def test_runner_with_browser_configfile(self):162 """163 Test the runner, giving it some parameters incl the browser config file164 The config file contains the mock files so jasmine tests are expected165 to pass166 """167 here = os.path.dirname(__file__)168 sample = os.path.join(here, 'sample')169 browser_conf_file = os.path.join(sample, 'browser.configfile.js')170 envjasmine_dir = os.path.join(os.path.dirname(here), 'envjasmine')171 jstests = Runner(172 testing_enviroment='phantomjs',173 rootdir=envjasmine_dir,174 testdir=sample,175 browser_configfile=browser_conf_file176 )177 success, stdout = jstests.run()178 assert success179 assert '0 failures' in stdout180 181 def test_did_test_pass(self):182 # there is some coverage done with the previous tests,183 # but we want to test also the case when a test failed184 # and it does not appear in the "Failed:" report185 here = os.path.dirname(__file__)186 sample = os.path.join(here, 'sample')187 browser_conf_file = os.path.join(sample, 'browser.configfile.js')188 189 jstests = Runner(190 testing_enviroment='phantomjs',191 browser_configfile=browser_conf_file192 )193 success = jstests.did_test_pass('')194 assert not success195 success = jstests.did_test_pass('some random data '*50)196 assert not success197 success = jstests.did_test_pass('some data FAILED some more data')198 assert not success199 success = jstests.did_test_pass('some data FAILEDsome more data')200 assert not success201 success = jstests.did_test_pass('0 failures')202 assert success203 success = jstests.did_test_pass('0 failures FAILED')204 assert not success205 success = jstests.did_test_pass('0Failed: failures')206 assert not success207 success = jstests.did_test_pass('1 test(s) FAILED:')208 assert not success209 success = jstests.did_test_pass('-11 test(s) FAILED:')210 assert not success211 success = jstests.did_test_pass('something-not-a-number test(s) FAILED:')212 assert not success
Note:
See TracChangeset
for help on using the changeset viewer.