@@ -75,6 +75,9 @@ def _move_file_to_dropzone_script(dropzone_selector):
75
75
VERIFICATION_SUCCESSFUL_MESSAGE = "Verification Successful"
76
76
VERIFICATION_FAILED_MESSAGE = "Verification failed."
77
77
78
+ VERIFICATION_SUCCESSFUL_MESSAGE_EDITOR = 'Verification successful!'
79
+ VERIFICATION_FAILED_MESSAGE_EDITOR = 'Verification failed!'
80
+
78
81
# Max test runtime into saucelabs
79
82
# 2.5 hours (3 hours max)
80
83
SAUCELABS_TIMEOUT_SECONDS = 10800 - 1800
@@ -460,7 +463,7 @@ def open_all_libraries_and_examples(self, url, logfile):
460
463
461
464
report_creator ('fetch' , log_entry , log_file )
462
465
463
- def compile_sketch (self , url , boards , iframe = False ):
466
+ def compile_sketch (self , url , boards , iframe = False , project_view = False ):
464
467
"""Compiles the sketch located at `url`, or an iframe within the page
465
468
referred to by `url`. Raises an exception if it does not compile.
466
469
"""
@@ -481,6 +484,11 @@ def compile_sketch(self, url, boards, iframe=False):
481
484
result = {
482
485
'board' : board
483
486
}
487
+ verification_success_message = VERIFICATION_SUCCESSFUL_MESSAGE_EDITOR
488
+ verification_failed_message = VERIFICATION_FAILED_MESSAGE_EDITOR
489
+ if project_view or iframe :
490
+ verification_success_message = VERIFICATION_SUCCESSFUL_MESSAGE
491
+ verification_failed_message = VERIFICATION_FAILED_MESSAGE
484
492
try :
485
493
self .execute_script (SELECT_BOARD_SCRIPT (board ), '$' , 'compilerflasher.pluginHandler.plugin_found' )
486
494
self .execute_script (_VERIFY_SCRIPT , 'compilerflasher' )
@@ -490,15 +498,14 @@ def compile_sketch(self, url, boards, iframe=False):
490
498
compile_result = WebDriverWait (self .driver , VERIFY_TIMEOUT ).until (
491
499
any_text_to_be_present_in_element (
492
500
(By .CSS_SELECTOR , "[id$=operation_output]" ),
493
- VERIFICATION_SUCCESSFUL_MESSAGE , VERIFICATION_FAILED_MESSAGE
501
+ verification_success_message , verification_failed_message
494
502
)
495
503
)
496
504
except WebDriverException as error :
497
505
compile_result = "%s; %s" % (type (error ).__name__ , str (error ))
498
506
result ['status' ] = 'error'
499
507
result ['message' ] = compile_result
500
-
501
- if compile_result == VERIFICATION_SUCCESSFUL_MESSAGE :
508
+ if compile_result == verification_success_message :
502
509
result ['status' ] = 'success'
503
510
else :
504
511
result ['status' ] = 'fail'
@@ -521,7 +528,7 @@ def compile_all_sketches(self, url, selector, **kwargs):
521
528
assert len (sketches ) > 0
522
529
self .compile_sketches (sketches , ** kwargs )
523
530
524
- def compile_sketches (self , sketches , iframe = False , logfile = None , compile_type = 'sketch' , create_report = False , comment = False ):
531
+ def compile_sketches (self , sketches , iframe = False , project_view = False , logfile = None , compile_type = 'sketch' , create_report = False , comment = False ):
525
532
"""Compiles the sketches with URLs given by the `sketches` list.
526
533
`logfile` specifies a path to a file to which test results will be
527
534
logged. If it is not `None`, compile errors will not cause the test
@@ -577,7 +584,7 @@ def compile_sketches(self, sketches, iframe=False, logfile=None, compile_type='s
577
584
578
585
if len (boards ) > 0 :
579
586
# Run Verify
580
- results = self .compile_sketch (sketch , boards , iframe = iframe )
587
+ results = self .compile_sketch (sketch , boards , iframe = iframe , project_view = project_view )
581
588
else :
582
589
results = [
583
590
{
0 commit comments