File tree Expand file tree Collapse file tree 9 files changed +19
-10
lines changed Expand file tree Collapse file tree 9 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ class PuppeteerLibrary(DynamicCore):
6969 ROBOT_LIBRARY_VERSION = __version__
7070 ROBOT_LISTENER_API_VERSION = 3
7171
72- loop = asyncio . get_event_loop ()
72+ loop = None
7373 is_load_async_keywords = False
7474 async_libraries = []
7575
@@ -79,6 +79,11 @@ class PuppeteerLibrary(DynamicCore):
7979 current_page = None
8080
8181 def __init__ (self ):
82+ try :
83+ self .loop = asyncio .get_event_loop ()
84+ except :
85+ print ('Warning: Asyncio not supported' )
86+
8287 self .run_on_failure_keyword = 'Capture Page Screenshot'
8388
8489 libraries = [
Original file line number Diff line number Diff line change 22
33class ContextAware (object ):
44
5- loop = asyncio . get_event_loop ()
5+ loop = None
66
77 def __init__ (self , ctx ):
88 """Base class exposing attributes from the common context.
99 :param ctx: The library itself as a context object.
1010 :type ctx: PuppeteerLibrary.PuppeteerLibrary
1111 """
12+ try :
13+ self .loop = asyncio .get_event_loop ()
14+ except :
15+ print ('Warning: Asyncio not supported' )
1216 self .ctx = ctx
1317 self .ctx .timeout = 30
Original file line number Diff line number Diff line change 66class AlertKeywords (LibraryComponent ):
77
88 def __init__ (self , ctx ):
9- self . ctx = ctx
9+ super (). __init__ ( ctx )
1010 self .async_func = AlertKeywordsAsync (self .ctx )
1111
1212 @keyword
Original file line number Diff line number Diff line change 1- import time
1+ import asyncio
22import sys
33from robot .utils import timestr_to_secs
44from pyppeteer import launch
1010class BrowserManagementKeywords (LibraryComponent ):
1111
1212 def __init__ (self , ctx ):
13- self . ctx = ctx
13+ super (). __init__ ( ctx )
1414 self .async_func = BrowserManagementKeywordsAsync (self .ctx )
1515
1616 @keyword
Original file line number Diff line number Diff line change 66class ElementKeywords (LibraryComponent ):
77
88 def __init__ (self , ctx ):
9- self . ctx = ctx
9+ super (). __init__ ( ctx )
1010 self .async_func = ElementKeywordsAsync (self .ctx )
1111
1212 @keyword
Original file line number Diff line number Diff line change 66class FormElementKeywords (LibraryComponent ):
77
88 def __init__ (self , ctx ):
9- self . ctx = ctx
9+ super (). __init__ ( ctx )
1010 self .async_func = FormElementKeywordsAsync (self .ctx )
1111
1212 @keyword
Original file line number Diff line number Diff line change 66class JavascriptKeywords (LibraryComponent ):
77
88 def __init__ (self , ctx ):
9- self . ctx = ctx
9+ super (). __init__ ( ctx )
1010 self .async_func = JavascriptKeywordsAsync (self .ctx )
1111
1212 @keyword
Original file line number Diff line number Diff line change 66class ScreenshotKeywords (LibraryComponent ):
77
88 def __init__ (self , ctx ):
9- self . ctx = ctx
9+ super (). __init__ ( ctx )
1010 self .async_func = ScreenshotKeywordsAsync (self .ctx )
1111
1212 @keyword
Original file line number Diff line number Diff line change 66class WaitingKeywords (LibraryComponent ):
77
88 def __init__ (self , ctx ):
9- self . ctx = ctx
9+ super (). __init__ ( ctx )
1010 self .async_func = WaitingKeywordsAsync (self .ctx )
1111
1212 @keyword
You can’t perform that action at this time.
0 commit comments