Changeset 42:a67c2fe2b2aa in pyenvjasmine
- Timestamp:
- Apr 3, 2018, 1:57:36 PM (7 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- pyenvjasmine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pyenvjasmine/runner.py
r39 r42 103 103 104 104 def __init__(self, rootdir=None, testdir=None, configfile=None, 105 browser_configfile=None, testing_enviro ment='phantomjs'):105 browser_configfile=None, testing_environment='phantomjs'): 106 106 """ 107 107 Set up paths, by default everything is … … 126 126 self.browser_configfile = browser_configfile 127 127 self.runner_js = os.path.join(here, 'run-jasmine3.js') 128 self.testing_enviro ment = testing_enviroment128 self.testing_environment = testing_environment 129 129 environment = get_environment() 130 130 rhino_path = os.path.join(self.rootdir, 'lib', 'rhino', 'js.jar') … … 166 166 } 167 167 self.runner_html = os.path.join(here, 168 self.envs[self.testing_enviro ment]['runner_html'])168 self.envs[self.testing_environment]['runner_html']) 169 169 170 170 def command_params_rhino(self, command): … … 191 191 if self.browser_configfile and os.path.exists(self.browser_configfile): 192 192 self.write_browser_htmlfile() 193 command = self.envs[self.testing_enviro ment]['command']193 command = self.envs[self.testing_environment]['command'] 194 194 # Add eventual other parameters to the command by calling a 195 195 # function specific for the selected engine (rhino, phantomjs, etc.) 196 if 'command_params_func' in self.envs[self.testing_enviro ment]:197 command = self.envs[self.testing_enviro ment]['command_params_func'](command)196 if 'command_params_func' in self.envs[self.testing_environment]: 197 command = self.envs[self.testing_environment]['command_params_func'](command) 198 198 # if we were asked to test only some of the spec files, 199 199 # addd them to the command line: … … 219 219 220 220 def did_test_pass(self, stdout): 221 if self.envs[self.testing_enviro ment]['failed_mark'] in stdout:221 if self.envs[self.testing_environment]['failed_mark'] in stdout: 222 222 # it can happen that a test fails because of some timing issues 223 223 # (timer error). In such case it may happen that the test does … … 231 231 # tests passing ok 232 232 for line in stdout.splitlines(): 233 if self.envs[self.testing_enviro ment]['success_mark'] in line:233 if self.envs[self.testing_environment]['success_mark'] in line: 234 234 return True 235 235 return False -
pyenvjasmine/tests/test_runner.py
r39 r42 14 14 Test the runner, using default values (which wil run the demo specs) 15 15 """ 16 jstests = Runner(testing_enviro ment='rhino')16 jstests = Runner(testing_environment='rhino') 17 17 success, stdout = jstests.run() 18 18 assert success … … 29 29 envjasmine_dir = os.path.join(os.path.dirname(here), 'envjasmine') 30 30 jstests = Runner( 31 testing_enviro ment='rhino',31 testing_environment='rhino', 32 32 rootdir=envjasmine_dir, 33 33 testdir=sample, … … 51 51 envjasmine_dir = os.path.join(os.path.dirname(here), 'envjasmine') 52 52 jstests = Runner( 53 testing_enviro ment='rhino',53 testing_environment='rhino', 54 54 rootdir=envjasmine_dir, 55 55 testdir=sample, … … 73 73 envjasmine_dir = os.path.join(os.path.dirname(here), 'envjasmine') 74 74 jstests = Runner( 75 testing_enviro ment='rhino',75 testing_environment='rhino', 76 76 rootdir=envjasmine_dir, 77 77 testdir=sample, … … 103 103 # but we want to test also the case when a test failed 104 104 # and it does not appear in the "Failed:" report 105 jstests = Runner(testing_enviro ment='rhino')105 jstests = Runner(testing_environment='rhino') 106 106 success = jstests.did_test_pass('') 107 107 assert not success … … 144 144 envjasmine_dir = os.path.join(os.path.dirname(here), 'envjasmine') 145 145 jstests = Runner( 146 testing_enviro ment='phantomjs',146 testing_environment='phantomjs', 147 147 rootdir=envjasmine_dir, 148 148 testdir=sample, … … 169 169 envjasmine_dir = os.path.join(os.path.dirname(here), 'envjasmine') 170 170 jstests = Runner( 171 testing_enviro ment='phantomjs',171 testing_environment='phantomjs', 172 172 rootdir=envjasmine_dir, 173 173 testdir=sample, … … 187 187 188 188 jstests = Runner( 189 testing_enviro ment='phantomjs',189 testing_environment='phantomjs', 190 190 browser_configfile=browser_conf_file 191 191 )
Note:
See TracChangeset
for help on using the changeset viewer.