File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 11__pycache__ /
22_artifacts /
3+ .ipynb_checkpoints /
34* .egg-info
45build /
56envs /
67lib /
8+ Untitled * . *
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ Suite Setup Wait for New Jupyter Server to be Ready
33Test Teardown Close All Browsers
44Library JupyterLibrary
55Library Process
6- Resource JupyterLibrary/resources/jupyterlab/Shell.robot
76
87*** Test Cases ***
98Open JupyterLab
Original file line number Diff line number Diff line change 11from glob import glob
22from os .path import basename , dirname , join
33
4+ from robot .api import ResourceFile
45from robot .libraries .BuiltIn import BuiltIn
6+ from robot .utils import find_file
57from SeleniumLibrary import SeleniumLibrary
8+ from SeleniumLibrary .utils .librarylistener import LibraryListener
69
710from .keywords import server
811
@@ -38,6 +41,17 @@ def __init__(
3841 screenshot_root_directory = None ,
3942 )
4043 self .add_library_components ([server .ServerKeywords (self )])
44+ self .ROBOT_LIBRARY_LISTENER = JupyterLibraryListener ()
45+
46+
47+ class JupyterLibraryListener (LibraryListener ):
48+ """ Custom listener to do per-suite imports of resource files
49+ """
50+
51+ ROBOT_LISTENER_API_VERSION = 2
52+
53+ def start_suite (self , name , attrs ):
54+ super (JupyterLibraryListener , self ).start_suite (name , attrs )
4155 for path in glob (join (RESOURCES , "jupyterlab" , "*.robot" )):
42- resource = "JupyterLibrary/resources/jupyterlab/" + basename (path )
56+ resource = "JupyterLibrary/resources/jupyterlab/{}" . format ( basename (path ) )
4357 BuiltIn ().import_resource (resource )
You can’t perform that action at this time.
0 commit comments