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):
69
69
ROBOT_LIBRARY_VERSION = __version__
70
70
ROBOT_LISTENER_API_VERSION = 3
71
71
72
- loop = asyncio . get_event_loop ()
72
+ loop = None
73
73
is_load_async_keywords = False
74
74
async_libraries = []
75
75
@@ -79,6 +79,11 @@ class PuppeteerLibrary(DynamicCore):
79
79
current_page = None
80
80
81
81
def __init__ (self ):
82
+ try :
83
+ self .loop = asyncio .get_event_loop ()
84
+ except :
85
+ print ('Warning: Asyncio not supported' )
86
+
82
87
self .run_on_failure_keyword = 'Capture Page Screenshot'
83
88
84
89
libraries = [
Original file line number Diff line number Diff line change 2
2
3
3
class ContextAware (object ):
4
4
5
- loop = asyncio . get_event_loop ()
5
+ loop = None
6
6
7
7
def __init__ (self , ctx ):
8
8
"""Base class exposing attributes from the common context.
9
9
:param ctx: The library itself as a context object.
10
10
:type ctx: PuppeteerLibrary.PuppeteerLibrary
11
11
"""
12
+ try :
13
+ self .loop = asyncio .get_event_loop ()
14
+ except :
15
+ print ('Warning: Asyncio not supported' )
12
16
self .ctx = ctx
13
17
self .ctx .timeout = 30
Original file line number Diff line number Diff line change 6
6
class AlertKeywords (LibraryComponent ):
7
7
8
8
def __init__ (self , ctx ):
9
- self . ctx = ctx
9
+ super (). __init__ ( ctx )
10
10
self .async_func = AlertKeywordsAsync (self .ctx )
11
11
12
12
@keyword
Original file line number Diff line number Diff line change 1
- import time
1
+ import asyncio
2
2
import sys
3
3
from robot .utils import timestr_to_secs
4
4
from pyppeteer import launch
10
10
class BrowserManagementKeywords (LibraryComponent ):
11
11
12
12
def __init__ (self , ctx ):
13
- self . ctx = ctx
13
+ super (). __init__ ( ctx )
14
14
self .async_func = BrowserManagementKeywordsAsync (self .ctx )
15
15
16
16
@keyword
Original file line number Diff line number Diff line change 6
6
class ElementKeywords (LibraryComponent ):
7
7
8
8
def __init__ (self , ctx ):
9
- self . ctx = ctx
9
+ super (). __init__ ( ctx )
10
10
self .async_func = ElementKeywordsAsync (self .ctx )
11
11
12
12
@keyword
Original file line number Diff line number Diff line change 6
6
class FormElementKeywords (LibraryComponent ):
7
7
8
8
def __init__ (self , ctx ):
9
- self . ctx = ctx
9
+ super (). __init__ ( ctx )
10
10
self .async_func = FormElementKeywordsAsync (self .ctx )
11
11
12
12
@keyword
Original file line number Diff line number Diff line change 6
6
class JavascriptKeywords (LibraryComponent ):
7
7
8
8
def __init__ (self , ctx ):
9
- self . ctx = ctx
9
+ super (). __init__ ( ctx )
10
10
self .async_func = JavascriptKeywordsAsync (self .ctx )
11
11
12
12
@keyword
Original file line number Diff line number Diff line change 6
6
class ScreenshotKeywords (LibraryComponent ):
7
7
8
8
def __init__ (self , ctx ):
9
- self . ctx = ctx
9
+ super (). __init__ ( ctx )
10
10
self .async_func = ScreenshotKeywordsAsync (self .ctx )
11
11
12
12
@keyword
Original file line number Diff line number Diff line change 6
6
class WaitingKeywords (LibraryComponent ):
7
7
8
8
def __init__ (self , ctx ):
9
- self . ctx = ctx
9
+ super (). __init__ ( ctx )
10
10
self .async_func = WaitingKeywordsAsync (self .ctx )
11
11
12
12
@keyword
You can’t perform that action at this time.
0 commit comments