Skip to content

Commit b7d0db1

Browse files
committed
Add integration test case for auto hover, lint
1 parent 50b1a61 commit b7d0db1

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

atest/05_Features/Hover.robot

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ ${HOVER_SIGNAL} css:.cm-lsp-hover-available
1515

1616

1717
*** Test Cases ***
18+
Hover Does Not Trigger Automatically
19+
Enter Cell Editor 1
20+
${sel} = Last Occurrence python_add
21+
Configure JupyterLab Plugin {"autoActivate": false}
22+
... plugin id=${HOVER PLUGIN ID}
23+
Trigger Automatically By Hover ${sel}
24+
Sleep 1s
25+
Element Text Should Be ${HOVER_SIGNAL} python_add
26+
Page Should Not Contain Element ${HOVER_BOX}
27+
28+
Hover Triggers Automatically
29+
Enter Cell Editor 1
30+
${sel} = Last Occurrence python_add
31+
Configure JupyterLab Plugin {"delay": 100, "autoActivate": true}
32+
... plugin id=${HOVER PLUGIN ID}
33+
Trigger Automatically By Hover ${sel}
34+
Wait Until Keyword Succeeds 4x 0.1s Page Should Contain Element ${HOVER_BOX}
35+
1836
Hover works in notebooks
1937
Enter Cell Editor 1
2038
Trigger Tooltip python_add
@@ -56,6 +74,14 @@ Last Occurrence
5674
... xpath:(//span[@role="presentation"][contains(., "${symbol}")])[last()]
5775
RETURN ${sel}
5876

77+
Trigger Automatically By Hover
78+
[Arguments] ${sel}
79+
# bring the cursor to the element
80+
Wokraround Visibility Problem ${sel}
81+
Mouse Over ${sel}
82+
Wait Until Page Contains Element ${HOVER_SIGNAL} timeout=10s
83+
Mouse Over And Wiggle ${sel} 5
84+
5985
Trigger Via Hover With Modifier
6086
[Arguments] ${sel}
6187
# bring the cursor to the element

atest/Variables.resource

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ ${COMPLETION PLUGIN ID} @jupyter-lsp/jupyterlab-lsp:completion
5757
${HIGHLIGHTS PLUGIN ID} @jupyter-lsp/jupyterlab-lsp:highlights
5858
${JUMP PLUGIN ID} @jupyter-lsp/jupyterlab-lsp:jump_to
5959
${DIAGNOSTICS PLUGIN ID} @jupyter-lsp/jupyterlab-lsp:diagnostics
60+
${HOVER PLUGIN ID} @jupyter-lsp/jupyterlab-lsp:hover
6061
${CSS USER SETTINGS} .jp-SettingsRawEditor-user
6162
${JLAB XP CLOSE SETTINGS}
6263
... ${JLAB XP DOCK TAB}\[contains(., 'Settings')]/*[contains(@class, 'm-TabBar-tabCloseIcon')]

python_packages/jupyterlab_lsp/setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
LABEXTENSIONS_DIR = Path("jupyterlab_lsp/labextensions")
88
LABEXTENSIONS_INSTALL_DIR = Path("share") / "jupyter" / "labextensions"
9-
LAB_PACKAGE_PATH = LABEXTENSIONS_DIR / "@jupyter-lsp" / "jupyterlab-lsp" / "package.json"
9+
LAB_PACKAGE_PATH = (
10+
LABEXTENSIONS_DIR / "@jupyter-lsp" / "jupyterlab-lsp" / "package.json"
11+
)
1012

1113

1214
def get_data_files():

0 commit comments

Comments
 (0)