@jupyterlab/galata 5.0.0-alpha.2 → 5.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +192 -31
- package/lib/benchmarkReporter.d.ts +1 -0
- package/lib/benchmarkReporter.js +34 -39
- package/lib/benchmarkReporter.js.map +1 -1
- package/lib/benchmarkVLTpl.js +19 -5
- package/lib/benchmarkVLTpl.js.map +1 -1
- package/lib/contents.d.ts +5 -5
- package/lib/contents.js +32 -36
- package/lib/contents.js.map +1 -1
- package/lib/extension/global.d.ts +197 -0
- package/lib/extension/global.js +601 -0
- package/lib/extension/global.js.map +1 -0
- package/lib/extension/index.d.ts +6 -0
- package/lib/extension/index.js +27 -0
- package/lib/extension/index.js.map +1 -0
- package/lib/extension/tokens.d.ts +232 -0
- package/lib/extension/tokens.js +13 -0
- package/lib/extension/tokens.js.map +1 -0
- package/lib/extension.d.ts +223 -0
- package/lib/{global.js → extension.js} +1 -2
- package/lib/extension.js.map +1 -0
- package/lib/fixtures.d.ts +32 -10
- package/lib/fixtures.js +64 -17
- package/lib/fixtures.js.map +1 -1
- package/lib/galata.d.ts +140 -19
- package/lib/galata.js +272 -87
- package/lib/galata.js.map +1 -1
- package/lib/helpers/activity.d.ts +6 -0
- package/lib/helpers/activity.js +19 -5
- package/lib/helpers/activity.js.map +1 -1
- package/lib/helpers/debuggerpanel.d.ts +4 -0
- package/lib/helpers/debuggerpanel.js +16 -0
- package/lib/helpers/debuggerpanel.js.map +1 -1
- package/lib/helpers/filebrowser.js +8 -2
- package/lib/helpers/filebrowser.js.map +1 -1
- package/lib/helpers/index.d.ts +1 -0
- package/lib/helpers/index.js +6 -1
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/kernel.js +7 -7
- package/lib/helpers/kernel.js.map +1 -1
- package/lib/helpers/menu.d.ts +7 -0
- package/lib/helpers/menu.js +17 -1
- package/lib/helpers/menu.js.map +1 -1
- package/lib/helpers/notebook.d.ts +6 -4
- package/lib/helpers/notebook.js +127 -31
- package/lib/helpers/notebook.js.map +1 -1
- package/lib/helpers/sidebar.d.ts +8 -1
- package/lib/helpers/sidebar.js +33 -15
- package/lib/helpers/sidebar.js.map +1 -1
- package/lib/helpers/statusbar.js +1 -1
- package/lib/helpers/statusbar.js.map +1 -1
- package/lib/helpers/style.d.ts +42 -0
- package/lib/helpers/style.js +50 -0
- package/lib/helpers/style.js.map +1 -0
- package/lib/helpers/theme.js +1 -1
- package/lib/helpers/theme.js.map +1 -1
- package/lib/index.d.ts +5 -2
- package/lib/index.js +12 -3
- package/lib/index.js.map +1 -1
- package/lib/jupyterlabpage.d.ts +29 -4
- package/lib/jupyterlabpage.js +38 -22
- package/lib/jupyterlabpage.js.map +1 -1
- package/lib/playwright-config.js +5 -1
- package/lib/playwright-config.js.map +1 -1
- package/lib/utils.js +5 -1
- package/lib/utils.js.map +1 -1
- package/package.json +31 -47
- package/src/benchmarkReporter.ts +756 -0
- package/src/benchmarkVLTpl.ts +91 -0
- package/src/contents.ts +472 -0
- package/src/extension.ts +281 -0
- package/src/fixtures.ts +387 -0
- package/src/galata.ts +1035 -0
- package/src/helpers/activity.ts +115 -0
- package/src/helpers/debuggerpanel.ts +159 -0
- package/src/helpers/filebrowser.ts +228 -0
- package/src/helpers/index.ts +15 -0
- package/src/helpers/kernel.ts +39 -0
- package/src/helpers/logconsole.ts +32 -0
- package/src/helpers/menu.ts +228 -0
- package/src/helpers/notebook.ts +1217 -0
- package/src/helpers/performance.ts +57 -0
- package/src/helpers/sidebar.ts +289 -0
- package/src/helpers/statusbar.ts +56 -0
- package/src/helpers/style.ts +100 -0
- package/src/helpers/theme.ts +50 -0
- package/src/index.ts +19 -0
- package/src/jupyterlabpage.ts +704 -0
- package/src/playwright-config.ts +26 -0
- package/src/utils.ts +264 -0
- package/src/vega-statistics.d.ts +15 -0
- package/lib/global.d.ts +0 -23
- package/lib/global.js.map +0 -1
- package/lib/inpage/tokens.d.ts +0 -135
- package/lib/inpage/tokens.js +0 -9
- package/lib/inpage/tokens.js.map +0 -1
- package/lib/lib-inpage/inpage.js +0 -3957
- package/lib/lib-inpage/inpage.js.map +0 -1
- package/style/index.css +0 -10
- package/style/index.js +0 -10
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import type { JupyterFrontEnd } from '@jupyterlab/application';
|
|
2
|
+
import type { IRouter } from '@jupyterlab/application';
|
|
3
|
+
import type { Dialog, Notification, NotificationManager, WidgetTracker } from '@jupyterlab/apputils';
|
|
4
|
+
import type { IDocumentManager } from '@jupyterlab/docmanager';
|
|
5
|
+
import type { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
6
|
+
import { Token } from '@lumino/coreutils';
|
|
7
|
+
declare global {
|
|
8
|
+
interface Window {
|
|
9
|
+
/**
|
|
10
|
+
* Access Jupyter Application object
|
|
11
|
+
*/
|
|
12
|
+
jupyterapp: JupyterFrontEnd;
|
|
13
|
+
/**
|
|
14
|
+
* Access to Galata In-Page helpers
|
|
15
|
+
*
|
|
16
|
+
* Those helpers are injected through a JupyterLab extension
|
|
17
|
+
*/
|
|
18
|
+
galata: IGalataInpage;
|
|
19
|
+
/**
|
|
20
|
+
* Access to Galata In-Page helpers
|
|
21
|
+
*
|
|
22
|
+
* @deprecated since v4
|
|
23
|
+
* Those helpers are injected through a JupyterLab extension
|
|
24
|
+
*/
|
|
25
|
+
galataip: IGalataInpage;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Galata in-page extension helpers.
|
|
30
|
+
*/
|
|
31
|
+
export declare const PLUGIN_ID_GALATA_HELPERS = "@jupyterlab/galata-extension:helpers";
|
|
32
|
+
/**
|
|
33
|
+
* Static objects exposed.
|
|
34
|
+
*/
|
|
35
|
+
export interface IGalataHelpers {
|
|
36
|
+
/**
|
|
37
|
+
* JupyterLab dialogs tracker.
|
|
38
|
+
*/
|
|
39
|
+
readonly dialogs: WidgetTracker<Dialog<any>>;
|
|
40
|
+
/**
|
|
41
|
+
* JupyterLab notifications manager.
|
|
42
|
+
*/
|
|
43
|
+
readonly notifications: NotificationManager;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Test token exposing some static JupyterLab objects.
|
|
47
|
+
*/
|
|
48
|
+
export declare const IGalataHelpers: Token<IGalataHelpers>;
|
|
49
|
+
/**
|
|
50
|
+
* Cell execution callbacks interface
|
|
51
|
+
*/
|
|
52
|
+
export interface INotebookRunCallback {
|
|
53
|
+
/**
|
|
54
|
+
* Callback before scrolling to the cell
|
|
55
|
+
*/
|
|
56
|
+
onBeforeScroll?: () => Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Callback after scrolling to the cell
|
|
59
|
+
*/
|
|
60
|
+
onAfterScroll?: () => Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Callback after cell execution
|
|
63
|
+
*/
|
|
64
|
+
onAfterCellRun?: (cellIndex: number) => Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* waitForSelector options
|
|
68
|
+
*/
|
|
69
|
+
export interface IWaitForSelectorOptions {
|
|
70
|
+
/**
|
|
71
|
+
* Test for the element to be hidden.
|
|
72
|
+
*/
|
|
73
|
+
hidden?: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface IPluginNameToInterfaceMap {
|
|
76
|
+
[PLUGIN_ID_GALATA_HELPERS]: IGalataHelpers;
|
|
77
|
+
'@jupyterlab/application-extension:router': IRouter;
|
|
78
|
+
'@jupyterlab/docmanager-extension:manager': IDocumentManager;
|
|
79
|
+
'@jupyterlab/apputils-extension:settings': ISettingRegistry;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Galata In-Page interface
|
|
83
|
+
*/
|
|
84
|
+
export interface IGalataInpage {
|
|
85
|
+
/**
|
|
86
|
+
* Delete all cells of the active notebook
|
|
87
|
+
*/
|
|
88
|
+
deleteNotebookCells(): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Get the index of a toolbar item
|
|
91
|
+
*
|
|
92
|
+
* @param itemName Item name
|
|
93
|
+
* @returns Index
|
|
94
|
+
*/
|
|
95
|
+
getNotebookToolbarItemIndex(itemName: string): number;
|
|
96
|
+
/**
|
|
97
|
+
* Get an application plugin
|
|
98
|
+
*
|
|
99
|
+
* @param pluginId Plugin ID
|
|
100
|
+
* @returns Application plugin
|
|
101
|
+
*/
|
|
102
|
+
getPlugin<K extends keyof IPluginNameToInterfaceMap>(pluginId: K): Promise<IPluginNameToInterfaceMap[K] | undefined>;
|
|
103
|
+
/**
|
|
104
|
+
* Get the Jupyter notifications.
|
|
105
|
+
*
|
|
106
|
+
* @returns Jupyter Notifications
|
|
107
|
+
*/
|
|
108
|
+
getNotifications(): Promise<Notification.INotification[]>;
|
|
109
|
+
/**
|
|
110
|
+
* Test if one or all cells have an execution number.
|
|
111
|
+
*
|
|
112
|
+
* @param cellIndex Cell index
|
|
113
|
+
* @returns Whether the cell was executed or not
|
|
114
|
+
*
|
|
115
|
+
* ### Notes
|
|
116
|
+
* It checks that no cells have a `null` execution count.
|
|
117
|
+
*/
|
|
118
|
+
haveBeenExecuted(cellIndex?: number): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Test if a cell is selected in the active notebook
|
|
121
|
+
*
|
|
122
|
+
* @param cellIndex Cell index
|
|
123
|
+
* @returns Whether the cell is selected or not
|
|
124
|
+
*/
|
|
125
|
+
isNotebookCellSelected(cellIndex: number): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Test if a element is visible or not
|
|
128
|
+
*
|
|
129
|
+
* @param el Element
|
|
130
|
+
* @returns Test result
|
|
131
|
+
*/
|
|
132
|
+
isElementVisible(el: HTMLElement): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Disconnect a listener to new Jupyter dialog events.
|
|
135
|
+
*
|
|
136
|
+
* @param event Event type
|
|
137
|
+
* @param listener Event listener
|
|
138
|
+
*/
|
|
139
|
+
off(event: 'dialog', listener: (dialog: Dialog<any> | null) => void): void;
|
|
140
|
+
/**
|
|
141
|
+
* Disconnect a listener to new or updated Jupyter notification events.
|
|
142
|
+
*
|
|
143
|
+
* @param event Event type
|
|
144
|
+
* @param listener Event listener
|
|
145
|
+
*/
|
|
146
|
+
off(event: 'notification', listener: (notification: Notification.INotification) => void): void;
|
|
147
|
+
/**
|
|
148
|
+
* Connect a listener to new Jupyter dialog events.
|
|
149
|
+
*
|
|
150
|
+
* @param event Event type
|
|
151
|
+
* @param listener Event listener
|
|
152
|
+
*/
|
|
153
|
+
on(event: 'dialog', listener: (dialog: Dialog<any> | null) => void): void;
|
|
154
|
+
/**
|
|
155
|
+
* Connect a listener to new or updated Jupyter notification events.
|
|
156
|
+
*
|
|
157
|
+
* @param event Event type
|
|
158
|
+
* @param listener Event listener
|
|
159
|
+
*/
|
|
160
|
+
on(event: 'notification', listener: (notification: Notification.INotification) => void): void;
|
|
161
|
+
/**
|
|
162
|
+
* Connect a listener to the next new Jupyter dialog event.
|
|
163
|
+
*
|
|
164
|
+
* @param event Event type
|
|
165
|
+
* @param listener Event listener
|
|
166
|
+
*/
|
|
167
|
+
once(event: 'dialog', listener: (dialog: Dialog<any> | null) => void): void;
|
|
168
|
+
/**
|
|
169
|
+
* Connect a listener to the next new or updated Jupyter notification event.
|
|
170
|
+
*
|
|
171
|
+
* @param event Event type
|
|
172
|
+
* @param listener Event listener
|
|
173
|
+
*/
|
|
174
|
+
once(event: 'notification', listener: (notification: Notification.INotification) => void): void;
|
|
175
|
+
/**
|
|
176
|
+
* Save the active notebook
|
|
177
|
+
*/
|
|
178
|
+
saveActiveNotebook(): Promise<void>;
|
|
179
|
+
/**
|
|
180
|
+
* Set the application theme
|
|
181
|
+
*
|
|
182
|
+
* @param themeName Theme name
|
|
183
|
+
*/
|
|
184
|
+
setTheme(themeName: string): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* Reset execution count of one or all cells.
|
|
187
|
+
*
|
|
188
|
+
* @param cellIndex Cell index
|
|
189
|
+
*/
|
|
190
|
+
resetExecutionCount(cellIndex?: number): void;
|
|
191
|
+
/**
|
|
192
|
+
* Run the active notebook cell by cell
|
|
193
|
+
* and execute the callback after each cell execution
|
|
194
|
+
*
|
|
195
|
+
* @param callback Callback
|
|
196
|
+
*/
|
|
197
|
+
runActiveNotebookCellByCell(callback?: INotebookRunCallback): Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* Wait for the route to be on path and close all documents
|
|
200
|
+
*
|
|
201
|
+
* @param path Path to monitor
|
|
202
|
+
*/
|
|
203
|
+
waitForLaunch(path?: string): Promise<void>;
|
|
204
|
+
/**
|
|
205
|
+
* Wait for an element to be found from a CSS selector
|
|
206
|
+
*
|
|
207
|
+
* @param selector CSS selector
|
|
208
|
+
* @param node Element
|
|
209
|
+
* @param options Options
|
|
210
|
+
* @returns Selected element
|
|
211
|
+
*/
|
|
212
|
+
waitForSelector(selector: string, node?: Element, options?: IWaitForSelectorOptions): Promise<Node | null>;
|
|
213
|
+
/**
|
|
214
|
+
* Waits for the given `timeout` in milliseconds.
|
|
215
|
+
*
|
|
216
|
+
* @param timeout A timeout to wait for
|
|
217
|
+
*/
|
|
218
|
+
waitForTimeout(duration: number): Promise<void>;
|
|
219
|
+
/**
|
|
220
|
+
* Wait for an element to be found from a XPath
|
|
221
|
+
*
|
|
222
|
+
* @param selector CSS selector
|
|
223
|
+
* @param node Element
|
|
224
|
+
* @param options Options
|
|
225
|
+
* @returns Selected element
|
|
226
|
+
*/
|
|
227
|
+
waitForXPath(selector: string, node?: Element, options?: IWaitForSelectorOptions): Promise<Node | null>;
|
|
228
|
+
/**
|
|
229
|
+
* Application object
|
|
230
|
+
*/
|
|
231
|
+
readonly app: JupyterFrontEnd;
|
|
232
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Copyright (c) Bloomberg Finance LP.
|
|
3
|
+
// Distributed under the terms of the Modified BSD License.
|
|
4
|
+
import { Token } from '@lumino/coreutils';
|
|
5
|
+
/**
|
|
6
|
+
* Galata in-page extension helpers.
|
|
7
|
+
*/
|
|
8
|
+
export const PLUGIN_ID_GALATA_HELPERS = '@jupyterlab/galata-extension:helpers';
|
|
9
|
+
/**
|
|
10
|
+
* Test token exposing some static JupyterLab objects.
|
|
11
|
+
*/
|
|
12
|
+
export const IGalataHelpers = new Token('@jupyterlab/galata-extension:IGalataHelpers');
|
|
13
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../extension/src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,sCAAsC;AACtC,2DAA2D;AAY3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAyB1C;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,sCAAsC,CAAC;AAgB/E;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,KAAK,CACrC,6CAA6C,CAC9C,CAAC"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import type { JupyterFrontEnd } from '@jupyterlab/application';
|
|
2
|
+
import type { IRouter } from '@jupyterlab/application';
|
|
3
|
+
import type { Dialog, Notification, NotificationManager, WidgetTracker } from '@jupyterlab/apputils';
|
|
4
|
+
import type { IDocumentManager } from '@jupyterlab/docmanager';
|
|
5
|
+
import type { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
/**
|
|
9
|
+
* Access Jupyter Application object
|
|
10
|
+
*/
|
|
11
|
+
jupyterapp: JupyterFrontEnd;
|
|
12
|
+
/**
|
|
13
|
+
* Access to Galata In-Page helpers
|
|
14
|
+
*
|
|
15
|
+
* Those helpers are injected through a JupyterLab extension
|
|
16
|
+
*/
|
|
17
|
+
galata: IGalataInpage;
|
|
18
|
+
/**
|
|
19
|
+
* Access to Galata In-Page helpers
|
|
20
|
+
*
|
|
21
|
+
* @deprecated since v4
|
|
22
|
+
* Those helpers are injected through a JupyterLab extension
|
|
23
|
+
*/
|
|
24
|
+
galataip: IGalataInpage;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Static objects exposed.
|
|
29
|
+
*/
|
|
30
|
+
export interface IGalataHelpers {
|
|
31
|
+
/**
|
|
32
|
+
* JupyterLab dialogs tracker.
|
|
33
|
+
*/
|
|
34
|
+
readonly dialogs: WidgetTracker<Dialog<any>>;
|
|
35
|
+
/**
|
|
36
|
+
* JupyterLab notifications manager.
|
|
37
|
+
*/
|
|
38
|
+
readonly notifications: NotificationManager;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Cell execution callbacks interface
|
|
42
|
+
*/
|
|
43
|
+
export interface INotebookRunCallback {
|
|
44
|
+
/**
|
|
45
|
+
* Callback before scrolling to the cell
|
|
46
|
+
*/
|
|
47
|
+
onBeforeScroll?: () => Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Callback after scrolling to the cell
|
|
50
|
+
*/
|
|
51
|
+
onAfterScroll?: () => Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Callback after cell execution
|
|
54
|
+
*/
|
|
55
|
+
onAfterCellRun?: (cellIndex: number) => Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* waitForSelector options
|
|
59
|
+
*/
|
|
60
|
+
export interface IWaitForSelectorOptions {
|
|
61
|
+
/**
|
|
62
|
+
* Test for the element to be hidden.
|
|
63
|
+
*/
|
|
64
|
+
hidden?: boolean;
|
|
65
|
+
}
|
|
66
|
+
export interface IPluginNameToInterfaceMap {
|
|
67
|
+
'@jupyterlab/galata-extension:helpers': IGalataHelpers;
|
|
68
|
+
'@jupyterlab/application-extension:router': IRouter;
|
|
69
|
+
'@jupyterlab/docmanager-extension:manager': IDocumentManager;
|
|
70
|
+
'@jupyterlab/apputils-extension:settings': ISettingRegistry;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Galata In-Page interface
|
|
74
|
+
*/
|
|
75
|
+
export interface IGalataInpage {
|
|
76
|
+
/**
|
|
77
|
+
* Delete all cells of the active notebook
|
|
78
|
+
*/
|
|
79
|
+
deleteNotebookCells(): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Get the index of a toolbar item
|
|
82
|
+
*
|
|
83
|
+
* @param itemName Item name
|
|
84
|
+
* @returns Index
|
|
85
|
+
*/
|
|
86
|
+
getNotebookToolbarItemIndex(itemName: string): number;
|
|
87
|
+
/**
|
|
88
|
+
* Get an application plugin
|
|
89
|
+
*
|
|
90
|
+
* @param pluginId Plugin ID
|
|
91
|
+
* @returns Application plugin
|
|
92
|
+
*/
|
|
93
|
+
getPlugin<K extends keyof IPluginNameToInterfaceMap>(pluginId: K): Promise<IPluginNameToInterfaceMap[K] | undefined>;
|
|
94
|
+
/**
|
|
95
|
+
* Get the Jupyter notifications.
|
|
96
|
+
*
|
|
97
|
+
* @returns Jupyter Notifications
|
|
98
|
+
*/
|
|
99
|
+
getNotifications(): Promise<Notification.INotification[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Test if one or all cells have an execution number.
|
|
102
|
+
*
|
|
103
|
+
* @param cellIndex Cell index
|
|
104
|
+
* @returns Whether the cell was executed or not
|
|
105
|
+
*
|
|
106
|
+
* ### Notes
|
|
107
|
+
* It checks that no cells have a `null` execution count.
|
|
108
|
+
*/
|
|
109
|
+
haveBeenExecuted(cellIndex?: number): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Test if a cell is selected in the active notebook
|
|
112
|
+
*
|
|
113
|
+
* @param cellIndex Cell index
|
|
114
|
+
* @returns Whether the cell is selected or not
|
|
115
|
+
*/
|
|
116
|
+
isNotebookCellSelected(cellIndex: number): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Test if a element is visible or not
|
|
119
|
+
*
|
|
120
|
+
* @param el Element
|
|
121
|
+
* @returns Test result
|
|
122
|
+
*/
|
|
123
|
+
isElementVisible(el: HTMLElement): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Disconnect a listener to new Jupyter dialog events.
|
|
126
|
+
*
|
|
127
|
+
* @param event Event type
|
|
128
|
+
* @param listener Event listener
|
|
129
|
+
*/
|
|
130
|
+
off(event: 'dialog', listener: (dialog: Dialog<any> | null) => void): void;
|
|
131
|
+
/**
|
|
132
|
+
* Disconnect a listener to new or updated Jupyter notification events.
|
|
133
|
+
*
|
|
134
|
+
* @param event Event type
|
|
135
|
+
* @param listener Event listener
|
|
136
|
+
*/
|
|
137
|
+
off(event: 'notification', listener: (notification: Notification.INotification) => void): void;
|
|
138
|
+
/**
|
|
139
|
+
* Connect a listener to new Jupyter dialog events.
|
|
140
|
+
*
|
|
141
|
+
* @param event Event type
|
|
142
|
+
* @param listener Event listener
|
|
143
|
+
*/
|
|
144
|
+
on(event: 'dialog', listener: (dialog: Dialog<any> | null) => void): void;
|
|
145
|
+
/**
|
|
146
|
+
* Connect a listener to new or updated Jupyter notification events.
|
|
147
|
+
*
|
|
148
|
+
* @param event Event type
|
|
149
|
+
* @param listener Event listener
|
|
150
|
+
*/
|
|
151
|
+
on(event: 'notification', listener: (notification: Notification.INotification) => void): void;
|
|
152
|
+
/**
|
|
153
|
+
* Connect a listener to the next new Jupyter dialog event.
|
|
154
|
+
*
|
|
155
|
+
* @param event Event type
|
|
156
|
+
* @param listener Event listener
|
|
157
|
+
*/
|
|
158
|
+
once(event: 'dialog', listener: (dialog: Dialog<any> | null) => void): void;
|
|
159
|
+
/**
|
|
160
|
+
* Connect a listener to the next new or updated Jupyter notification event.
|
|
161
|
+
*
|
|
162
|
+
* @param event Event type
|
|
163
|
+
* @param listener Event listener
|
|
164
|
+
*/
|
|
165
|
+
once(event: 'notification', listener: (notification: Notification.INotification) => void): void;
|
|
166
|
+
/**
|
|
167
|
+
* Save the active notebook
|
|
168
|
+
*/
|
|
169
|
+
saveActiveNotebook(): Promise<void>;
|
|
170
|
+
/**
|
|
171
|
+
* Set the application theme
|
|
172
|
+
*
|
|
173
|
+
* @param themeName Theme name
|
|
174
|
+
*/
|
|
175
|
+
setTheme(themeName: string): Promise<void>;
|
|
176
|
+
/**
|
|
177
|
+
* Reset execution count of one or all cells.
|
|
178
|
+
*
|
|
179
|
+
* @param cellIndex Cell index
|
|
180
|
+
*/
|
|
181
|
+
resetExecutionCount(cellIndex?: number): void;
|
|
182
|
+
/**
|
|
183
|
+
* Run the active notebook cell by cell
|
|
184
|
+
* and execute the callback after each cell execution
|
|
185
|
+
*
|
|
186
|
+
* @param callback Callback
|
|
187
|
+
*/
|
|
188
|
+
runActiveNotebookCellByCell(callback?: INotebookRunCallback): Promise<void>;
|
|
189
|
+
/**
|
|
190
|
+
* Wait for the route to be on path and close all documents
|
|
191
|
+
*
|
|
192
|
+
* @param path Path to monitor
|
|
193
|
+
*/
|
|
194
|
+
waitForLaunch(path?: string): Promise<void>;
|
|
195
|
+
/**
|
|
196
|
+
* Wait for an element to be found from a CSS selector
|
|
197
|
+
*
|
|
198
|
+
* @param selector CSS selector
|
|
199
|
+
* @param node Element
|
|
200
|
+
* @param options Options
|
|
201
|
+
* @returns Selected element
|
|
202
|
+
*/
|
|
203
|
+
waitForSelector(selector: string, node?: Element, options?: IWaitForSelectorOptions): Promise<Node | null>;
|
|
204
|
+
/**
|
|
205
|
+
* Waits for the given `timeout` in milliseconds.
|
|
206
|
+
*
|
|
207
|
+
* @param timeout A timeout to wait for
|
|
208
|
+
*/
|
|
209
|
+
waitForTimeout(duration: number): Promise<void>;
|
|
210
|
+
/**
|
|
211
|
+
* Wait for an element to be found from a XPath
|
|
212
|
+
*
|
|
213
|
+
* @param selector CSS selector
|
|
214
|
+
* @param node Element
|
|
215
|
+
* @param options Options
|
|
216
|
+
* @returns Selected element
|
|
217
|
+
*/
|
|
218
|
+
waitForXPath(selector: string, node?: Element, options?: IWaitForSelectorOptions): Promise<Node | null>;
|
|
219
|
+
/**
|
|
220
|
+
* Application object
|
|
221
|
+
*/
|
|
222
|
+
readonly app: JupyterFrontEnd;
|
|
223
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
2
|
// Copyright (c) Jupyter Development Team.
|
|
4
3
|
// Copyright (c) Bloomberg Finance LP.
|
|
5
4
|
// Distributed under the terms of the Modified BSD License.
|
|
6
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
//# sourceMappingURL=
|
|
6
|
+
//# sourceMappingURL=extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,sCAAsC;AACtC,2DAA2D"}
|
package/lib/fixtures.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Session, TerminalAPI } from '@jupyterlab/services';
|
|
1
|
+
import type { Session, TerminalAPI, User } from '@jupyterlab/services';
|
|
2
2
|
import { Page, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, TestType } from '@playwright/test';
|
|
3
3
|
import { IJupyterLabPage, IJupyterLabPageFixture } from './jupyterlabpage';
|
|
4
4
|
/**
|
|
@@ -26,7 +26,7 @@ export interface IGalataTestArgs extends PlaywrightTestArgs {
|
|
|
26
26
|
/**
|
|
27
27
|
* Galata test configuration
|
|
28
28
|
*/
|
|
29
|
-
export
|
|
29
|
+
export type GalataOptions = {
|
|
30
30
|
/**
|
|
31
31
|
* Application URL path fragment.
|
|
32
32
|
*
|
|
@@ -40,15 +40,16 @@ export declare type GalataOptions = {
|
|
|
40
40
|
*/
|
|
41
41
|
autoGoto: boolean;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
* the server root for debugging purpose. By default the files are
|
|
45
|
-
* always deleted
|
|
43
|
+
* Mock JupyterLab config in-memory or not.
|
|
46
44
|
*
|
|
47
|
-
*
|
|
48
|
-
* -
|
|
49
|
-
* - '
|
|
45
|
+
* Possible values are:
|
|
46
|
+
* - true (default): JupyterLab config will be mocked on a per test basis
|
|
47
|
+
* - false: JupyterLab config won't be mocked (Be careful it will write config in local files)
|
|
48
|
+
* - Record<string, JSONObject>: Initial JupyterLab data config - Mapping (config section, value).
|
|
49
|
+
*
|
|
50
|
+
* By default the config is stored in-memory.
|
|
50
51
|
*/
|
|
51
|
-
|
|
52
|
+
mockConfig: boolean | Record<string, unknown>;
|
|
52
53
|
/**
|
|
53
54
|
* Mock JupyterLab state in-memory or not.
|
|
54
55
|
*
|
|
@@ -74,6 +75,27 @@ export declare type GalataOptions = {
|
|
|
74
75
|
* they are still initialized with the hard drive values.
|
|
75
76
|
*/
|
|
76
77
|
mockSettings: boolean | Record<string, unknown>;
|
|
78
|
+
/**
|
|
79
|
+
* Mock JupyterLab user in-memory or not.
|
|
80
|
+
*
|
|
81
|
+
* Possible values are:
|
|
82
|
+
* - true (default): JupyterLab user will be mocked on a per test basis
|
|
83
|
+
* - false: JupyterLab user won't be mocked (It will be a random user so snapshots won't match)
|
|
84
|
+
* - Record<string, unknown>: Initial JupyterLab user - Mapping (user attribute, value).
|
|
85
|
+
*
|
|
86
|
+
* By default the user is stored in-memory.
|
|
87
|
+
*/
|
|
88
|
+
mockUser: boolean | Partial<User.IUser>;
|
|
89
|
+
/**
|
|
90
|
+
* Galata can keep the uploaded and created files in ``tmpPath`` on
|
|
91
|
+
* the server root for debugging purpose. By default the files are
|
|
92
|
+
* always deleted
|
|
93
|
+
*
|
|
94
|
+
* - 'off' - ``tmpPath`` is deleted after each tests
|
|
95
|
+
* - 'on' - ``tmpPath`` is never deleted
|
|
96
|
+
* - 'only-on-failure' - ``tmpPath`` is deleted except if a test failed or timed out.
|
|
97
|
+
*/
|
|
98
|
+
serverFiles: 'on' | 'off' | 'only-on-failure';
|
|
77
99
|
/**
|
|
78
100
|
* Sessions created during the test.
|
|
79
101
|
*
|
|
@@ -102,7 +124,7 @@ export declare type GalataOptions = {
|
|
|
102
124
|
*/
|
|
103
125
|
tmpPath: string;
|
|
104
126
|
/**
|
|
105
|
-
* Wait for the application page to be ready
|
|
127
|
+
* Wait for the application page to be ready.
|
|
106
128
|
*
|
|
107
129
|
* @param page Playwright Page model
|
|
108
130
|
* @param helpers JupyterLab helpers
|