7474SRC_DIR = os .path .normpath (os .path .join (ROOT_DIR , os .pardir , "src" ))
7575TEST_LIBS_DIR = os .path .join (RESOURCES_DIR , "testlibs" )
7676HTTP_SERVER_FILE = os .path .join (RESOURCES_DIR , "testserver" , "testserver.py" )
77+ EVENT_FIRING_LISTENER = os .path .join (RESOURCES_DIR , "testlibs" , "MyListener.py" )
7778
7879ROBOT_OPTIONS = [
7980 "--doc" ,
101102]
102103
103104
104- def acceptance_tests (interpreter , browser , rf_options = None , grid = None ):
105+ def acceptance_tests (interpreter , browser , rf_options = None , grid = None , event_firing = None ):
105106 if os .path .exists (RESULTS_DIR ):
106107 shutil .rmtree (RESULTS_DIR )
107108 os .mkdir (RESULTS_DIR )
108109 if grid :
109110 hub , node = start_grid ()
110111 with http_server ():
111- execute_tests (interpreter , browser , rf_options , grid )
112+ execute_tests (interpreter , browser , rf_options , grid , event_firing )
112113 failures = process_output (browser )
113114 if failures :
114115 print (
@@ -191,7 +192,7 @@ def http_server():
191192 serverlog .close ()
192193
193194
194- def execute_tests (interpreter , browser , rf_options , grid ):
195+ def execute_tests (interpreter , browser , rf_options , grid , event_firing ):
195196 options = []
196197 if grid :
197198 runner = interpreter .split () + [
@@ -215,6 +216,11 @@ def execute_tests(interpreter, browser, rf_options, grid):
215216 ]
216217 else :
217218 command += ["--exclude" , "OnlyGrid" ]
219+ if event_firing :
220+ command += [
221+ "--variable" ,
222+ f"event_firing_or_none:{ EVENT_FIRING_LISTENER } " ,
223+ ]
218224 command += options + [ACCEPTANCE_TEST_DIR ]
219225 log_start (command )
220226 syslog = os .path .join (RESULTS_DIR , "syslog.txt" )
@@ -296,18 +302,25 @@ def create_zip():
296302 default = False ,
297303 action = "store_true" ,
298304 )
305+ parser .add_argument (
306+ "--event-firing-webdriver" ,
307+ help = "Run tests using event firing webdriver." ,
308+ default = False ,
309+ action = "store_true" ,
310+ )
299311 args , rf_options = parser .parse_known_args ()
300312 browser = args .browser .lower ().strip ()
301313 selenium_grid = is_truthy (args .grid )
302314 interpreter = args .interpreter
315+ event_firing_webdriver = args .event_firing_webdriver
303316 if args .nounit :
304317 print ("Not running unit tests." )
305318 else :
306319 rc = subprocess .call ([interpreter , UNIT_TEST_RUNNER ])
307320 if rc != 0 :
308321 print ("Not running acceptance test, because unit tests failed." )
309322 sys .exit (rc )
310- failures = acceptance_tests (interpreter , browser , rf_options , selenium_grid )
323+ failures = acceptance_tests (interpreter , browser , rf_options , selenium_grid , event_firing_webdriver )
311324 if args .zip :
312325 create_zip ()
313326 sys .exit (failures )
0 commit comments