@theia/playwright 1.67.0-next.56 → 1.67.0-next.59

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.
Files changed (213) hide show
  1. package/lib/index.d.ts +37 -0
  2. package/lib/index.d.ts.map +1 -0
  3. package/lib/index.js +55 -0
  4. package/lib/index.js.map +1 -0
  5. package/lib/tests/theia-app.test.d.ts +2 -0
  6. package/lib/tests/theia-app.test.d.ts.map +1 -0
  7. package/lib/tests/theia-app.test.js +30 -0
  8. package/lib/tests/theia-app.test.js.map +1 -0
  9. package/lib/tests/theia-application-shell.test.d.ts +2 -0
  10. package/lib/tests/theia-application-shell.test.d.ts.map +1 -0
  11. package/lib/tests/theia-application-shell.test.js +59 -0
  12. package/lib/tests/theia-application-shell.test.js.map +1 -0
  13. package/lib/tests/theia-explorer-view.test.d.ts +2 -0
  14. package/lib/tests/theia-explorer-view.test.d.ts.map +1 -0
  15. package/lib/tests/theia-explorer-view.test.js +186 -0
  16. package/lib/tests/theia-explorer-view.test.js.map +1 -0
  17. package/lib/tests/theia-getting-started.test.d.ts +2 -0
  18. package/lib/tests/theia-getting-started.test.d.ts.map +1 -0
  19. package/lib/tests/theia-getting-started.test.js +46 -0
  20. package/lib/tests/theia-getting-started.test.js.map +1 -0
  21. package/lib/tests/theia-main-menu.test.d.ts +2 -0
  22. package/lib/tests/theia-main-menu.test.d.ts.map +1 -0
  23. package/lib/tests/theia-main-menu.test.js +111 -0
  24. package/lib/tests/theia-main-menu.test.js.map +1 -0
  25. package/lib/tests/theia-notebook-editor.test.d.ts +2 -0
  26. package/lib/tests/theia-notebook-editor.test.d.ts.map +1 -0
  27. package/lib/tests/theia-notebook-editor.test.js +301 -0
  28. package/lib/tests/theia-notebook-editor.test.js.map +1 -0
  29. package/lib/tests/theia-output-view.test.d.ts +2 -0
  30. package/lib/tests/theia-output-view.test.d.ts.map +1 -0
  31. package/lib/tests/theia-output-view.test.js +79 -0
  32. package/lib/tests/theia-output-view.test.js.map +1 -0
  33. package/lib/tests/theia-preference-view.test.d.ts +2 -0
  34. package/lib/tests/theia-preference-view.test.d.ts.map +1 -0
  35. package/lib/tests/theia-preference-view.test.js +102 -0
  36. package/lib/tests/theia-preference-view.test.js.map +1 -0
  37. package/lib/tests/theia-problems-view.test.d.ts +2 -0
  38. package/lib/tests/theia-problems-view.test.d.ts.map +1 -0
  39. package/lib/tests/theia-problems-view.test.js +55 -0
  40. package/lib/tests/theia-problems-view.test.js.map +1 -0
  41. package/lib/tests/theia-quick-command.test.d.ts +2 -0
  42. package/lib/tests/theia-quick-command.test.d.ts.map +1 -0
  43. package/lib/tests/theia-quick-command.test.js +75 -0
  44. package/lib/tests/theia-quick-command.test.js.map +1 -0
  45. package/lib/tests/theia-sample-app.test.d.ts +2 -0
  46. package/lib/tests/theia-sample-app.test.d.ts.map +1 -0
  47. package/lib/tests/theia-sample-app.test.js +58 -0
  48. package/lib/tests/theia-sample-app.test.js.map +1 -0
  49. package/lib/tests/theia-status-bar.test.d.ts +2 -0
  50. package/lib/tests/theia-status-bar.test.d.ts.map +1 -0
  51. package/lib/tests/theia-status-bar.test.js +45 -0
  52. package/lib/tests/theia-status-bar.test.js.map +1 -0
  53. package/lib/tests/theia-terminal-view.test.d.ts +2 -0
  54. package/lib/tests/theia-terminal-view.test.d.ts.map +1 -0
  55. package/lib/tests/theia-terminal-view.test.js +80 -0
  56. package/lib/tests/theia-terminal-view.test.js.map +1 -0
  57. package/lib/tests/theia-text-editor.test.d.ts +2 -0
  58. package/lib/tests/theia-text-editor.test.d.ts.map +1 -0
  59. package/lib/tests/theia-text-editor.test.js +159 -0
  60. package/lib/tests/theia-text-editor.test.js.map +1 -0
  61. package/lib/tests/theia-toolbar.test.d.ts +2 -0
  62. package/lib/tests/theia-toolbar.test.d.ts.map +1 -0
  63. package/lib/tests/theia-toolbar.test.js +62 -0
  64. package/lib/tests/theia-toolbar.test.js.map +1 -0
  65. package/lib/tests/theia-workspace.test.d.ts +2 -0
  66. package/lib/tests/theia-workspace.test.d.ts.map +1 -0
  67. package/lib/tests/theia-workspace.test.js +77 -0
  68. package/lib/tests/theia-workspace.test.js.map +1 -0
  69. package/lib/theia-about-dialog.d.ts +5 -0
  70. package/lib/theia-about-dialog.d.ts.map +1 -0
  71. package/lib/theia-about-dialog.js +27 -0
  72. package/lib/theia-about-dialog.js.map +1 -0
  73. package/lib/theia-app-loader.d.ts +20 -0
  74. package/lib/theia-app-loader.d.ts.map +1 -0
  75. package/lib/theia-app-loader.js +124 -0
  76. package/lib/theia-app-loader.js.map +1 -0
  77. package/lib/theia-app.d.ts +51 -0
  78. package/lib/theia-app.d.ts.map +1 -0
  79. package/lib/theia-app.js +154 -0
  80. package/lib/theia-app.js.map +1 -0
  81. package/lib/theia-context-menu.d.ts +9 -0
  82. package/lib/theia-context-menu.d.ts.map +1 -0
  83. package/lib/theia-context-menu.js +38 -0
  84. package/lib/theia-context-menu.js.map +1 -0
  85. package/lib/theia-dialog.d.ts +29 -0
  86. package/lib/theia-dialog.d.ts.map +1 -0
  87. package/lib/theia-dialog.js +100 -0
  88. package/lib/theia-dialog.js.map +1 -0
  89. package/lib/theia-editor.d.ts +10 -0
  90. package/lib/theia-editor.d.ts.map +1 -0
  91. package/lib/theia-editor.js +69 -0
  92. package/lib/theia-editor.js.map +1 -0
  93. package/lib/theia-explorer-view.d.ts +48 -0
  94. package/lib/theia-explorer-view.d.ts.map +1 -0
  95. package/lib/theia-explorer-view.js +274 -0
  96. package/lib/theia-explorer-view.js.map +1 -0
  97. package/lib/theia-main-menu.d.ts +17 -0
  98. package/lib/theia-main-menu.d.ts.map +1 -0
  99. package/lib/theia-main-menu.js +73 -0
  100. package/lib/theia-main-menu.js.map +1 -0
  101. package/lib/theia-menu-item.d.ts +15 -0
  102. package/lib/theia-menu-item.d.ts.map +1 -0
  103. package/lib/theia-menu-item.js +67 -0
  104. package/lib/theia-menu-item.js.map +1 -0
  105. package/lib/theia-menu.d.ts +17 -0
  106. package/lib/theia-menu.d.ts.map +1 -0
  107. package/lib/theia-menu.js +106 -0
  108. package/lib/theia-menu.js.map +1 -0
  109. package/lib/theia-monaco-editor.d.ts +63 -0
  110. package/lib/theia-monaco-editor.d.ts.map +1 -0
  111. package/lib/theia-monaco-editor.js +155 -0
  112. package/lib/theia-monaco-editor.js.map +1 -0
  113. package/lib/theia-notebook-cell.d.ts +104 -0
  114. package/lib/theia-notebook-cell.d.ts.map +1 -0
  115. package/lib/theia-notebook-cell.js +228 -0
  116. package/lib/theia-notebook-cell.js.map +1 -0
  117. package/lib/theia-notebook-editor.d.ts +50 -0
  118. package/lib/theia-notebook-editor.d.ts.map +1 -0
  119. package/lib/theia-notebook-editor.js +153 -0
  120. package/lib/theia-notebook-editor.js.map +1 -0
  121. package/lib/theia-notebook-toolbar.d.ts +13 -0
  122. package/lib/theia-notebook-toolbar.d.ts.map +1 -0
  123. package/lib/theia-notebook-toolbar.js +47 -0
  124. package/lib/theia-notebook-toolbar.js.map +1 -0
  125. package/lib/theia-notification-indicator.d.ts +8 -0
  126. package/lib/theia-notification-indicator.d.ts.map +1 -0
  127. package/lib/theia-notification-indicator.js +45 -0
  128. package/lib/theia-notification-indicator.js.map +1 -0
  129. package/lib/theia-notification-overlay.d.ts +23 -0
  130. package/lib/theia-notification-overlay.d.ts.map +1 -0
  131. package/lib/theia-notification-overlay.js +80 -0
  132. package/lib/theia-notification-overlay.js.map +1 -0
  133. package/lib/theia-output-channel.d.ts +25 -0
  134. package/lib/theia-output-channel.d.ts.map +1 -0
  135. package/lib/theia-output-channel.js +72 -0
  136. package/lib/theia-output-channel.js.map +1 -0
  137. package/lib/theia-output-view.d.ts +10 -0
  138. package/lib/theia-output-view.d.ts.map +1 -0
  139. package/lib/theia-output-view.js +82 -0
  140. package/lib/theia-output-view.js.map +1 -0
  141. package/lib/theia-page-object.d.ts +8 -0
  142. package/lib/theia-page-object.d.ts.map +1 -0
  143. package/lib/theia-page-object.js +28 -0
  144. package/lib/theia-page-object.js.map +1 -0
  145. package/lib/theia-preference-view.d.ts +91 -0
  146. package/lib/theia-preference-view.d.ts.map +1 -0
  147. package/lib/theia-preference-view.js +224 -0
  148. package/lib/theia-preference-view.js.map +1 -0
  149. package/lib/theia-problem-indicator.d.ts +9 -0
  150. package/lib/theia-problem-indicator.d.ts.map +1 -0
  151. package/lib/theia-problem-indicator.js +39 -0
  152. package/lib/theia-problem-indicator.js.map +1 -0
  153. package/lib/theia-problem-view.d.ts +6 -0
  154. package/lib/theia-problem-view.d.ts.map +1 -0
  155. package/lib/theia-problem-view.js +31 -0
  156. package/lib/theia-problem-view.js.map +1 -0
  157. package/lib/theia-quick-command-palette.d.ts +14 -0
  158. package/lib/theia-quick-command-palette.d.ts.map +1 -0
  159. package/lib/theia-quick-command-palette.js +87 -0
  160. package/lib/theia-quick-command-palette.js.map +1 -0
  161. package/lib/theia-rename-dialog.d.ts +6 -0
  162. package/lib/theia-rename-dialog.d.ts.map +1 -0
  163. package/lib/theia-rename-dialog.js +35 -0
  164. package/lib/theia-rename-dialog.js.map +1 -0
  165. package/lib/theia-status-bar.d.ts +14 -0
  166. package/lib/theia-status-bar.d.ts.map +1 -0
  167. package/lib/theia-status-bar.js +40 -0
  168. package/lib/theia-status-bar.js.map +1 -0
  169. package/lib/theia-status-indicator.d.ts +11 -0
  170. package/lib/theia-status-indicator.d.ts.map +1 -0
  171. package/lib/theia-status-indicator.js +49 -0
  172. package/lib/theia-status-indicator.js.map +1 -0
  173. package/lib/theia-terminal.d.ts +14 -0
  174. package/lib/theia-terminal.d.ts.map +1 -0
  175. package/lib/theia-terminal.js +60 -0
  176. package/lib/theia-terminal.js.map +1 -0
  177. package/lib/theia-text-editor.d.ts +27 -0
  178. package/lib/theia-text-editor.d.ts.map +1 -0
  179. package/lib/theia-text-editor.js +124 -0
  180. package/lib/theia-text-editor.js.map +1 -0
  181. package/lib/theia-toggle-bottom-indicator.d.ts +5 -0
  182. package/lib/theia-toggle-bottom-indicator.d.ts.map +1 -0
  183. package/lib/theia-toggle-bottom-indicator.js +27 -0
  184. package/lib/theia-toggle-bottom-indicator.js.map +1 -0
  185. package/lib/theia-toolbar-item.d.ts +11 -0
  186. package/lib/theia-toolbar-item.d.ts.map +1 -0
  187. package/lib/theia-toolbar-item.js +41 -0
  188. package/lib/theia-toolbar-item.js.map +1 -0
  189. package/lib/theia-toolbar.d.ts +20 -0
  190. package/lib/theia-toolbar.d.ts.map +1 -0
  191. package/lib/theia-toolbar.js +91 -0
  192. package/lib/theia-toolbar.js.map +1 -0
  193. package/lib/theia-tree-node.d.ts +20 -0
  194. package/lib/theia-tree-node.d.ts.map +1 -0
  195. package/lib/theia-tree-node.js +73 -0
  196. package/lib/theia-tree-node.js.map +1 -0
  197. package/lib/theia-view.d.ts +33 -0
  198. package/lib/theia-view.d.ts.map +1 -0
  199. package/lib/theia-view.js +150 -0
  200. package/lib/theia-view.js.map +1 -0
  201. package/lib/theia-welcome-view.d.ts +6 -0
  202. package/lib/theia-welcome-view.d.ts.map +1 -0
  203. package/lib/theia-welcome-view.js +31 -0
  204. package/lib/theia-welcome-view.js.map +1 -0
  205. package/lib/theia-workspace.d.ts +27 -0
  206. package/lib/theia-workspace.d.ts.map +1 -0
  207. package/lib/theia-workspace.js +84 -0
  208. package/lib/theia-workspace.js.map +1 -0
  209. package/lib/util.d.ts +18 -0
  210. package/lib/util.d.ts.map +1 -0
  211. package/lib/util.js +86 -0
  212. package/lib/util.js.map +1 -0
  213. package/package.json +3 -3
@@ -0,0 +1,104 @@
1
+ import { FrameLocator, Locator } from '@playwright/test';
2
+ import { TheiaApp } from './theia-app';
3
+ import { TheiaMonacoEditor } from './theia-monaco-editor';
4
+ import { TheiaPageObject } from './theia-page-object';
5
+ export type CellStatus = 'success' | 'error' | 'waiting';
6
+ /**
7
+ * Page object for a Theia notebook cell.
8
+ */
9
+ export declare class TheiaNotebookCell extends TheiaPageObject {
10
+ readonly locator: Locator;
11
+ protected readonly notebookEditorLocator: Locator;
12
+ protected cellEditor: TheiaNotebookCellEditor;
13
+ constructor(locator: Locator, notebookEditorLocator: Locator, app: TheiaApp);
14
+ /**
15
+ * @returns The cell editor page object.
16
+ */
17
+ get editor(): TheiaNotebookCellEditor;
18
+ /**
19
+ * @returns Locator for the sidebar (left) of the cell.
20
+ */
21
+ sidebar(): Locator;
22
+ /**
23
+ * @returns Locator for the toolbar (top) of the cell.
24
+ */
25
+ toolbar(): Locator;
26
+ /**
27
+ * @returns Locator for the statusbar (bottom) of the cell.
28
+ */
29
+ statusbar(): Locator;
30
+ /**
31
+ * @returns Locator for the status icon inside the statusbar of the cell.
32
+ */
33
+ statusIcon(): Locator;
34
+ /**
35
+ * @returns `true` id the cell is a code cell, `false` otherwise.
36
+ */
37
+ isCodeCell(): Promise<boolean>;
38
+ /**
39
+ * @returns The mode of the cell, e.g. 'python', 'markdown', etc.
40
+ */
41
+ mode(): Promise<string>;
42
+ /**
43
+ * @returns The text content of the cell editor.
44
+ */
45
+ editorText(): Promise<string | undefined>;
46
+ /**
47
+ * Adds text to the editor of the cell.
48
+ * @param text The text to add to the editor.
49
+ * @param lineNumber The line number where to add the text. Default is 1.
50
+ */
51
+ addEditorText(text: string, lineNumber?: number): Promise<void>;
52
+ /**
53
+ * @param wait If `true` waits for the cell to finish execution, otherwise returns immediately.
54
+ */
55
+ execute(wait?: boolean): Promise<void>;
56
+ /**
57
+ * Splits the cell into two cells by dividing the cell text on current cursor position.
58
+ */
59
+ splitCell(): Promise<void>;
60
+ /**
61
+ * Deletes the cell.
62
+ */
63
+ deleteCell(): Promise<void>;
64
+ /**
65
+ * Waits for the cell to reach success or error status.
66
+ */
67
+ waitForCellToFinish(): Promise<void>;
68
+ /**
69
+ * @returns The status of the cell. Possible values are 'success', 'error', 'waiting'.
70
+ */
71
+ status(): Promise<CellStatus>;
72
+ protected toCellStatus(classes: string): CellStatus;
73
+ /**
74
+ * @param acceptEmpty If `true`, accepts empty execution count. Otherwise waits for the execution count to be set.
75
+ * @returns The execution count of the cell.
76
+ */
77
+ executionCount(acceptEmpty?: boolean): Promise<string | undefined>;
78
+ /**
79
+ * @returns `true` if the cell is selected (blue vertical line), `false` otherwise.
80
+ */
81
+ isSelected(): Promise<boolean>;
82
+ /**
83
+ * @returns The output text of the cell.
84
+ */
85
+ outputText(): Promise<string>;
86
+ /**
87
+ * Selects the cell itself not it's editor. Important for shortcut usage like copy-, cut-, paste-cell.
88
+ */
89
+ selectCell(): Promise<void>;
90
+ outputContainer(): Promise<Locator>;
91
+ protected cellHandle(): Promise<string | null>;
92
+ protected outputFrame(): Promise<FrameLocator>;
93
+ }
94
+ /**
95
+ * Wrapper around the monaco editor inside a notebook cell.
96
+ */
97
+ export declare class TheiaNotebookCellEditor extends TheiaPageObject {
98
+ readonly locator: Locator;
99
+ readonly monacoEditor: TheiaMonacoEditor;
100
+ constructor(locator: Locator, app: TheiaApp);
101
+ waitForVisible(): Promise<void>;
102
+ isVisible(): Promise<boolean>;
103
+ }
104
+ //# sourceMappingURL=theia-notebook-cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-notebook-cell.d.ts","sourceRoot":"","sources":["../src/theia-notebook-cell.ts"],"names":[],"mappings":"AAeA,OAAO,EAAU,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAEzD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;IAItC,QAAQ,CAAC,OAAO,EAAE,OAAO;IAAE,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,OAAO;IAFxF,SAAS,CAAC,UAAU,EAAE,uBAAuB,CAAC;gBAEzB,OAAO,EAAE,OAAO,EAAqB,qBAAqB,EAAE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;cAQpC,WAAW,IAAI,OAAO,CAAC,YAAY,CAAC;CAOvD;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,eAAe;IAI5C,QAAQ,CAAC,OAAO,EAAE,OAAO;IAFrC,SAAgB,YAAY,EAAE,iBAAiB,CAAC;gBAE3B,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IAK9C,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;CAGtC"}
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TheiaNotebookCellEditor = exports.TheiaNotebookCell = void 0;
4
+ // *****************************************************************************
5
+ // Copyright (C) 2024 TypeFox GmbH and others.
6
+ //
7
+ // This program and the accompanying materials are made available under the
8
+ // terms of the Eclipse Public License v. 2.0 which is available at
9
+ // http://www.eclipse.org/legal/epl-2.0.
10
+ //
11
+ // This Source Code may also be made available under the following Secondary
12
+ // Licenses when the conditions for such availability set forth in the Eclipse
13
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
+ // with the GNU Classpath Exception which is available at
15
+ // https://www.gnu.org/software/classpath/license.html.
16
+ //
17
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
18
+ // *****************************************************************************
19
+ const test_1 = require("@playwright/test");
20
+ const theia_monaco_editor_1 = require("./theia-monaco-editor");
21
+ const theia_page_object_1 = require("./theia-page-object");
22
+ /**
23
+ * Page object for a Theia notebook cell.
24
+ */
25
+ class TheiaNotebookCell extends theia_page_object_1.TheiaPageObject {
26
+ constructor(locator, notebookEditorLocator, app) {
27
+ super(app);
28
+ this.locator = locator;
29
+ this.notebookEditorLocator = notebookEditorLocator;
30
+ const editorLocator = locator.locator('div.theia-notebook-cell-editor');
31
+ this.cellEditor = new TheiaNotebookCellEditor(editorLocator, app);
32
+ }
33
+ /**
34
+ * @returns The cell editor page object.
35
+ */
36
+ get editor() {
37
+ return this.cellEditor;
38
+ }
39
+ /**
40
+ * @returns Locator for the sidebar (left) of the cell.
41
+ */
42
+ sidebar() {
43
+ return this.locator.locator('div.theia-notebook-cell-sidebar');
44
+ }
45
+ /**
46
+ * @returns Locator for the toolbar (top) of the cell.
47
+ */
48
+ toolbar() {
49
+ return this.locator.locator('div.theia-notebook-cell-toolbar');
50
+ }
51
+ /**
52
+ * @returns Locator for the statusbar (bottom) of the cell.
53
+ */
54
+ statusbar() {
55
+ return this.locator.locator('div.notebook-cell-status');
56
+ }
57
+ /**
58
+ * @returns Locator for the status icon inside the statusbar of the cell.
59
+ */
60
+ statusIcon() {
61
+ return this.statusbar().locator('span.notebook-cell-status-item');
62
+ }
63
+ /**
64
+ * @returns `true` id the cell is a code cell, `false` otherwise.
65
+ */
66
+ async isCodeCell() {
67
+ const classAttribute = await this.mode();
68
+ return classAttribute !== 'markdown';
69
+ }
70
+ /**
71
+ * @returns The mode of the cell, e.g. 'python', 'markdown', etc.
72
+ */
73
+ async mode() {
74
+ await this.locator.waitFor({ state: 'visible' });
75
+ const editorElement = await this.editor.locator.elementHandle();
76
+ if (editorElement === null) {
77
+ throw new Error('Could not find editor element for the notebook cell.');
78
+ }
79
+ const classAttribute = await editorElement.getAttribute('data-mode-id');
80
+ if (classAttribute === null) {
81
+ throw new Error('Could not find mode attribute for the notebook cell.');
82
+ }
83
+ return classAttribute;
84
+ }
85
+ /**
86
+ * @returns The text content of the cell editor.
87
+ */
88
+ async editorText() {
89
+ return this.editor.monacoEditor.editorText();
90
+ }
91
+ /**
92
+ * Adds text to the editor of the cell.
93
+ * @param text The text to add to the editor.
94
+ * @param lineNumber The line number where to add the text. Default is 1.
95
+ */
96
+ async addEditorText(text, lineNumber = 1) {
97
+ await this.editor.monacoEditor.addEditorText(text, lineNumber);
98
+ }
99
+ /**
100
+ * @param wait If `true` waits for the cell to finish execution, otherwise returns immediately.
101
+ */
102
+ async execute(wait = true) {
103
+ const execButton = this.sidebar().locator('[id="notebook.cell.execute-cell"]');
104
+ await execButton.waitFor({ state: 'visible' });
105
+ await execButton.click();
106
+ if (wait) {
107
+ // wait for the cell to finish execution
108
+ await this.waitForCellToFinish();
109
+ }
110
+ }
111
+ /**
112
+ * Splits the cell into two cells by dividing the cell text on current cursor position.
113
+ */
114
+ async splitCell() {
115
+ const execButton = this.toolbar().locator('[id="notebook.cell.split"]');
116
+ await execButton.waitFor({ state: 'visible' });
117
+ await execButton.click();
118
+ }
119
+ /**
120
+ * Deletes the cell.
121
+ */
122
+ async deleteCell() {
123
+ const button = this.toolbar().locator('[id="notebook.cell.delete"]');
124
+ await button.waitFor({ state: 'visible' });
125
+ await button.click();
126
+ }
127
+ /**
128
+ * Waits for the cell to reach success or error status.
129
+ */
130
+ async waitForCellToFinish() {
131
+ await (0, test_1.expect)(this.statusIcon()).toHaveClass(/(.*codicon-check.*|.*codicon-error.*)/);
132
+ }
133
+ /**
134
+ * @returns The status of the cell. Possible values are 'success', 'error', 'waiting'.
135
+ */
136
+ async status() {
137
+ var _a, _b;
138
+ const statusLocator = this.statusIcon();
139
+ const status = this.toCellStatus((_b = await ((_a = (await statusLocator.elementHandle())) === null || _a === void 0 ? void 0 : _a.getAttribute('class'))) !== null && _b !== void 0 ? _b : '');
140
+ return status;
141
+ }
142
+ toCellStatus(classes) {
143
+ return classes.includes('codicon-check') ? 'success'
144
+ : classes.includes('codicon-error') ? 'error'
145
+ : 'waiting';
146
+ }
147
+ /**
148
+ * @param acceptEmpty If `true`, accepts empty execution count. Otherwise waits for the execution count to be set.
149
+ * @returns The execution count of the cell.
150
+ */
151
+ async executionCount(acceptEmpty = false) {
152
+ const countNode = this.sidebar().locator('span.theia-notebook-code-cell-execution-order');
153
+ await countNode.waitFor({ state: 'visible' });
154
+ await this.waitForCellToFinish();
155
+ // Wait for the execution count to be set.
156
+ await countNode.page().waitForFunction(arg => {
157
+ var _a;
158
+ const text = (_a = arg.ele) === null || _a === void 0 ? void 0 : _a.textContent;
159
+ return text && (arg.acceptEmpty || text !== '[ ]');
160
+ }, { ele: await countNode.elementHandle(), acceptEmpty });
161
+ const counterText = await countNode.textContent();
162
+ return counterText === null || counterText === void 0 ? void 0 : counterText.substring(1, counterText.length - 1); // remove square brackets
163
+ }
164
+ /**
165
+ * @returns `true` if the cell is selected (blue vertical line), `false` otherwise.
166
+ */
167
+ async isSelected() {
168
+ var _a;
169
+ const markerClass = await this.locator.locator('div.theia-notebook-cell-marker').getAttribute('class');
170
+ return (_a = markerClass === null || markerClass === void 0 ? void 0 : markerClass.includes('theia-notebook-cell-marker-selected')) !== null && _a !== void 0 ? _a : false;
171
+ }
172
+ /**
173
+ * @returns The output text of the cell.
174
+ */
175
+ async outputText() {
176
+ const outputContainer = await this.outputContainer();
177
+ await outputContainer.waitFor({ state: 'visible' });
178
+ // By default just collect all spans text.
179
+ const spansLocator = outputContainer.locator('span:not(:has(*))'); // ignore nested spans
180
+ const spanTexts = await spansLocator.evaluateAll(spans => spans.map(span => { var _a; return (_a = span.textContent) === null || _a === void 0 ? void 0 : _a.trim(); })
181
+ .filter(text => text !== undefined && text.length > 0));
182
+ return spanTexts.join('');
183
+ }
184
+ /**
185
+ * Selects the cell itself not it's editor. Important for shortcut usage like copy-, cut-, paste-cell.
186
+ */
187
+ async selectCell() {
188
+ await this.sidebar().click();
189
+ }
190
+ async outputContainer() {
191
+ const outFrame = await this.outputFrame();
192
+ // each cell has it's own output div with a unique id = cellHandle<handle>
193
+ const cellOutput = outFrame.locator(`div#cellHandle${await this.cellHandle()}`);
194
+ return cellOutput.locator('div.output-container');
195
+ }
196
+ async cellHandle() {
197
+ const handle = await this.locator.getAttribute('data-cell-handle');
198
+ if (handle === null) {
199
+ throw new Error('Could not find cell handle attribute `data-cell-handle` for the notebook cell.');
200
+ }
201
+ return handle;
202
+ }
203
+ async outputFrame() {
204
+ const containerDiv = this.notebookEditorLocator.locator('div.theia-notebook-cell-output-webview');
205
+ const webViewFrame = containerDiv.frameLocator('iframe.webview');
206
+ await webViewFrame.locator('iframe').waitFor({ state: 'attached' });
207
+ return webViewFrame.frameLocator('iframe');
208
+ }
209
+ }
210
+ exports.TheiaNotebookCell = TheiaNotebookCell;
211
+ /**
212
+ * Wrapper around the monaco editor inside a notebook cell.
213
+ */
214
+ class TheiaNotebookCellEditor extends theia_page_object_1.TheiaPageObject {
215
+ constructor(locator, app) {
216
+ super(app);
217
+ this.locator = locator;
218
+ this.monacoEditor = new theia_monaco_editor_1.TheiaMonacoEditor(locator.locator('.monaco-editor'), app);
219
+ }
220
+ async waitForVisible() {
221
+ await this.locator.waitFor({ state: 'visible' });
222
+ }
223
+ async isVisible() {
224
+ return this.locator.isVisible();
225
+ }
226
+ }
227
+ exports.TheiaNotebookCellEditor = TheiaNotebookCellEditor;
228
+ //# sourceMappingURL=theia-notebook-cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-notebook-cell.js","sourceRoot":"","sources":["../src/theia-notebook-cell.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,8CAA8C;AAC9C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,2CAAiE;AAEjE,+DAA0D;AAC1D,2DAAsD;AAItD;;GAEG;AACH,MAAa,iBAAkB,SAAQ,mCAAe;IAIlD,YAAqB,OAAgB,EAAqB,qBAA8B,EAAE,GAAa;QACnG,KAAK,CAAC,GAAG,CAAC,CAAC;QADM,YAAO,GAAP,OAAO,CAAS;QAAqB,0BAAqB,GAArB,qBAAqB,CAAS;QAEpF,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;QACxE,IAAI,CAAC,UAAU,GAAG,IAAI,uBAAuB,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;IACtE,CAAC;IAED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IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;IACpC,CAAC;CACJ;AAhBD,0DAgBC"}
@@ -0,0 +1,50 @@
1
+ import { Locator } from '@playwright/test';
2
+ import { TheiaApp } from './theia-app';
3
+ import { TheiaEditor } from './theia-editor';
4
+ import { TheiaNotebookCell } from './theia-notebook-cell';
5
+ import { TheiaNotebookToolbar } from './theia-notebook-toolbar';
6
+ import { TheiaToolbarItem } from './theia-toolbar-item';
7
+ export declare namespace NotebookCommands {
8
+ const SELECT_KERNEL_COMMAND = "notebook.selectKernel";
9
+ const ADD_NEW_CELL_COMMAND = "notebook.add-new-code-cell";
10
+ const ADD_NEW_MARKDOWN_CELL_COMMAND = "notebook.add-new-markdown-cell";
11
+ const EXECUTE_NOTEBOOK_COMMAND = "notebook.execute";
12
+ const CLEAR_ALL_OUTPUTS_COMMAND = "notebook.clear-all-outputs";
13
+ const EXPORT_COMMAND = "jupyter.notebookeditor.export";
14
+ }
15
+ export declare class TheiaNotebookEditor extends TheiaEditor {
16
+ constructor(filePath: string, app: TheiaApp);
17
+ protected viewLocator(): Locator;
18
+ tabLocator(): Locator;
19
+ waitForVisible(): Promise<void>;
20
+ /**
21
+ * @returns The main toolbar of the notebook editor.
22
+ */
23
+ notebookToolbar(): TheiaNotebookToolbar;
24
+ /**
25
+ * @returns The name of the selected kernel.
26
+ */
27
+ selectedKernel(): Promise<string | undefined | null>;
28
+ /**
29
+ * Allows to select a kernel using toolbar item.
30
+ * @param kernelName The name of the kernel to select.
31
+ */
32
+ selectKernel(kernelName: string): Promise<void>;
33
+ availableKernels(): Promise<string[]>;
34
+ /**
35
+ * Adds a new code cell to the notebook.
36
+ */
37
+ addCodeCell(): Promise<void>;
38
+ /**
39
+ * Adds a new markdown cell to the notebook.
40
+ */
41
+ addMarkdownCell(): Promise<void>;
42
+ waitForCellCountChanged(prevCount: number): Promise<void>;
43
+ executeAllCells(): Promise<void>;
44
+ clearAllOutputs(): Promise<void>;
45
+ exportAs(): Promise<void>;
46
+ cells(): Promise<TheiaNotebookCell[]>;
47
+ protected triggerToolbarItem(id: string): Promise<void>;
48
+ protected toolbarItem(id: string): Promise<TheiaToolbarItem | undefined>;
49
+ }
50
+ //# sourceMappingURL=theia-notebook-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-notebook-editor.d.ts","sourceRoot":"","sources":["../src/theia-notebook-editor.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,yBAAiB,gBAAgB,CAAC;IACvB,MAAM,qBAAqB,0BAA0B,CAAC;IACtD,MAAM,oBAAoB,+BAA+B,CAAC;IAC1D,MAAM,6BAA6B,mCAAmC,CAAC;IACvE,MAAM,wBAAwB,qBAAqB,CAAC;IACpD,MAAM,yBAAyB,+BAA+B,CAAC;IAC/D,MAAM,cAAc,kCAAkC,CAAC;CACjE;AAED,qBAAa,mBAAoB,SAAQ,WAAW;gBAEpC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ;IAS3C,SAAS,CAAC,WAAW,IAAI,OAAO;IAIhC,UAAU,IAAI,OAAO;IAIN,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAM9C;;OAEG;IACH,eAAe,IAAI,oBAAoB;IAIvC;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAQ1D;;;OAGG;IACG,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW/C,gBAAgB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAkB3C;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAOlC;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAMhC,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMzD,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,KAAK,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;cAU3B,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cAQ7C,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;CAKjF"}
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 TypeFox GmbH and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.TheiaNotebookEditor = exports.NotebookCommands = void 0;
19
+ const theia_editor_1 = require("./theia-editor");
20
+ const theia_notebook_cell_1 = require("./theia-notebook-cell");
21
+ const theia_notebook_toolbar_1 = require("./theia-notebook-toolbar");
22
+ const theia_quick_command_palette_1 = require("./theia-quick-command-palette");
23
+ const util_1 = require("./util");
24
+ var NotebookCommands;
25
+ (function (NotebookCommands) {
26
+ NotebookCommands.SELECT_KERNEL_COMMAND = 'notebook.selectKernel';
27
+ NotebookCommands.ADD_NEW_CELL_COMMAND = 'notebook.add-new-code-cell';
28
+ NotebookCommands.ADD_NEW_MARKDOWN_CELL_COMMAND = 'notebook.add-new-markdown-cell';
29
+ NotebookCommands.EXECUTE_NOTEBOOK_COMMAND = 'notebook.execute';
30
+ NotebookCommands.CLEAR_ALL_OUTPUTS_COMMAND = 'notebook.clear-all-outputs';
31
+ NotebookCommands.EXPORT_COMMAND = 'jupyter.notebookeditor.export';
32
+ })(NotebookCommands || (exports.NotebookCommands = NotebookCommands = {}));
33
+ class TheiaNotebookEditor extends theia_editor_1.TheiaEditor {
34
+ constructor(filePath, app) {
35
+ // shell-tab-notebook::file://<path>
36
+ // notebook:file://<path>
37
+ super({
38
+ tabSelector: (0, util_1.normalizeId)(`#shell-tab-notebook:${app.workspace.pathAsUrl(filePath)}`),
39
+ viewSelector: (0, util_1.normalizeId)(`#notebook:${app.workspace.pathAsUrl(filePath)}`)
40
+ }, app);
41
+ }
42
+ viewLocator() {
43
+ return this.page.locator(this.data.viewSelector);
44
+ }
45
+ tabLocator() {
46
+ return this.page.locator(this.data.tabSelector);
47
+ }
48
+ async waitForVisible() {
49
+ await super.waitForVisible();
50
+ // wait for toolbar being rendered as it takes some time to load the kernel data.
51
+ await this.notebookToolbar().waitForVisible();
52
+ }
53
+ /**
54
+ * @returns The main toolbar of the notebook editor.
55
+ */
56
+ notebookToolbar() {
57
+ return new theia_notebook_toolbar_1.TheiaNotebookToolbar(this.viewLocator(), this.app);
58
+ }
59
+ /**
60
+ * @returns The name of the selected kernel.
61
+ */
62
+ async selectedKernel() {
63
+ const kernelItem = await this.toolbarItem(NotebookCommands.SELECT_KERNEL_COMMAND);
64
+ if (!kernelItem) {
65
+ throw new Error('Select kernel toolbar item not found.');
66
+ }
67
+ return this.notebookToolbar().locator.locator('#kernel-text').innerText();
68
+ }
69
+ /**
70
+ * Allows to select a kernel using toolbar item.
71
+ * @param kernelName The name of the kernel to select.
72
+ */
73
+ async selectKernel(kernelName) {
74
+ await this.triggerToolbarItem(NotebookCommands.SELECT_KERNEL_COMMAND);
75
+ const qInput = new theia_quick_command_palette_1.TheiaQuickCommandPalette(this.app);
76
+ const widget = await this.page.waitForSelector(qInput.selector, { timeout: 5000 });
77
+ if (widget && !await qInput.isOpen()) {
78
+ throw new Error('Failed to trigger kernel selection');
79
+ }
80
+ await qInput.type(kernelName, true);
81
+ await qInput.hide();
82
+ }
83
+ async availableKernels() {
84
+ await this.triggerToolbarItem(NotebookCommands.SELECT_KERNEL_COMMAND);
85
+ const qInput = new theia_quick_command_palette_1.TheiaQuickCommandPalette(this.app);
86
+ const widget = await this.page.waitForSelector(qInput.selector, { timeout: 5000 });
87
+ if (widget && !await qInput.isOpen()) {
88
+ throw new Error('Failed to trigger kernel selection');
89
+ }
90
+ await qInput.type('Python', false);
91
+ try {
92
+ const listItems = await Promise.all((await qInput.visibleItems()).map(async (item) => item.textContent()));
93
+ await this.page.keyboard.press('Enter');
94
+ await qInput.hide();
95
+ return listItems.filter(item => item !== null);
96
+ }
97
+ finally {
98
+ await qInput.hide();
99
+ }
100
+ }
101
+ /**
102
+ * Adds a new code cell to the notebook.
103
+ */
104
+ async addCodeCell() {
105
+ const currentCellsCount = (await this.cells()).length;
106
+ // FIXME Command sometimes produces bogus Editor cell without the monaco editor.
107
+ await this.triggerToolbarItem(NotebookCommands.ADD_NEW_CELL_COMMAND);
108
+ await this.waitForCellCountChanged(currentCellsCount);
109
+ }
110
+ /**
111
+ * Adds a new markdown cell to the notebook.
112
+ */
113
+ async addMarkdownCell() {
114
+ const currentCellsCount = (await this.cells()).length;
115
+ await this.triggerToolbarItem(NotebookCommands.ADD_NEW_MARKDOWN_CELL_COMMAND);
116
+ await this.waitForCellCountChanged(currentCellsCount);
117
+ }
118
+ async waitForCellCountChanged(prevCount) {
119
+ await this.viewLocator().locator('li.theia-notebook-cell').evaluateAll((elements, currentCount) => elements.length !== currentCount, prevCount);
120
+ }
121
+ async executeAllCells() {
122
+ await this.triggerToolbarItem(NotebookCommands.EXECUTE_NOTEBOOK_COMMAND);
123
+ }
124
+ async clearAllOutputs() {
125
+ await this.triggerToolbarItem(NotebookCommands.CLEAR_ALL_OUTPUTS_COMMAND);
126
+ }
127
+ async exportAs() {
128
+ await this.triggerToolbarItem(NotebookCommands.EXPORT_COMMAND);
129
+ }
130
+ async cells() {
131
+ const cellsLocator = this.viewLocator().locator('li.theia-notebook-cell');
132
+ const cells = [];
133
+ for (const cellLocator of await cellsLocator.all()) {
134
+ await cellLocator.waitFor({ state: 'visible' });
135
+ cells.push(new theia_notebook_cell_1.TheiaNotebookCell(cellLocator, this.viewLocator(), this.app));
136
+ }
137
+ return cells;
138
+ }
139
+ async triggerToolbarItem(id) {
140
+ const item = await this.toolbarItem(id);
141
+ if (!item) {
142
+ throw new Error(`Toolbar item with id ${id} not found`);
143
+ }
144
+ await item.trigger();
145
+ }
146
+ async toolbarItem(id) {
147
+ const toolBar = this.notebookToolbar();
148
+ await toolBar.waitForVisible();
149
+ return toolBar.toolBarItem(id);
150
+ }
151
+ }
152
+ exports.TheiaNotebookEditor = TheiaNotebookEditor;
153
+ //# sourceMappingURL=theia-notebook-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-notebook-editor.js","sourceRoot":"","sources":["../src/theia-notebook-editor.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,8CAA8C;AAC9C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAIhF,iDAA6C;AAC7C,+DAA0D;AAC1D,qEAAgE;AAChE,+EAAyE;AAEzE,iCAAqC;AAErC,IAAiB,gBAA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AI,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;IAES,KAAK,CAAC,WAAW,CAAC,EAAU;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACvC,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC;QAC/B,OAAO,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACnC,CAAC;CACJ;AAxID,kDAwIC"}
@@ -0,0 +1,13 @@
1
+ import { ElementHandle, Locator } from '@playwright/test';
2
+ import { TheiaApp } from './theia-app';
3
+ import { TheiaToolbar } from './theia-toolbar';
4
+ export declare class TheiaNotebookToolbar extends TheiaToolbar {
5
+ readonly locator: Locator;
6
+ constructor(parentLocator: Locator, app: TheiaApp);
7
+ protected toolBarItemSelector(toolbarItemId?: string): string;
8
+ protected toolbarElementHandle(): Promise<ElementHandle<SVGElement | HTMLElement> | null>;
9
+ waitForVisible(): Promise<void>;
10
+ waitUntilHidden(): Promise<void>;
11
+ waitUntilShown(): Promise<void>;
12
+ }
13
+ //# sourceMappingURL=theia-notebook-toolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-notebook-toolbar.d.ts","sourceRoot":"","sources":["../src/theia-notebook-toolbar.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBAAa,oBAAqB,SAAQ,YAAY;IAClD,SAAgB,OAAO,EAAE,OAAO,CAAC;gBAErB,aAAa,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;cAM9B,mBAAmB,CAAC,aAAa,SAAK,GAAG,MAAM;cAIzC,oBAAoB,IAAI,OAAO,CAAC,aAAa,CAAC,UAAU,GAAG,WAAW,CAAC,GAAG,IAAI,CAAC;IAKzF,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAKhC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAIjD"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 TypeFox GmbH and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.TheiaNotebookToolbar = void 0;
19
+ const theia_toolbar_1 = require("./theia-toolbar");
20
+ class TheiaNotebookToolbar extends theia_toolbar_1.TheiaToolbar {
21
+ constructor(parentLocator, app) {
22
+ super(app);
23
+ this.selector = 'div#notebook-main-toolbar';
24
+ this.locator = parentLocator.locator(this.selector);
25
+ }
26
+ toolBarItemSelector(toolbarItemId = '') {
27
+ return `div.theia-notebook-main-toolbar-item${toolbarItemId ? `[id="${toolbarItemId}"]` : ''}`;
28
+ }
29
+ async toolbarElementHandle() {
30
+ // Use locator instead of page to find the toolbar element.
31
+ return this.locator.elementHandle();
32
+ }
33
+ async waitForVisible() {
34
+ // Use locator instead of page to find the toolbar element.
35
+ await this.locator.waitFor({ state: 'visible' });
36
+ }
37
+ async waitUntilHidden() {
38
+ // Use locator instead of page to find the toolbar element.
39
+ await this.locator.waitFor({ state: 'hidden' });
40
+ }
41
+ async waitUntilShown() {
42
+ // Use locator instead of page to find the toolbar element.
43
+ await this.locator.waitFor({ state: 'visible' });
44
+ }
45
+ }
46
+ exports.TheiaNotebookToolbar = TheiaNotebookToolbar;
47
+ //# sourceMappingURL=theia-notebook-toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-notebook-toolbar.js","sourceRoot":"","sources":["../src/theia-notebook-toolbar.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,8CAA8C;AAC9C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAIhF,mDAA+C;AAE/C,MAAa,oBAAqB,SAAQ,4BAAY;IAGlD,YAAY,aAAsB,EAAE,GAAa;QAC7C,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,QAAQ,GAAG,2BAA2B,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;IAEkB,mBAAmB,CAAC,aAAa,GAAG,EAAE;QACrD,OAAO,uCAAuC,aAAa,CAAC,CAAC,CAAC,QAAQ,aAAa,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACnG,CAAC;IAEkB,KAAK,CAAC,oBAAoB;QACzC,2DAA2D;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;IACxC,CAAC;IAEQ,KAAK,CAAC,cAAc;QACzB,2DAA2D;QAC3D,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACrD,CAAC;IAEQ,KAAK,CAAC,eAAe;QAC1B,2DAA2D;QAC3D,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IACpD,CAAC;IAEQ,KAAK,CAAC,cAAc;QACzB,2DAA2D;QAC3D,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACrD,CAAC;CACJ;AAhCD,oDAgCC"}
@@ -0,0 +1,8 @@
1
+ import { TheiaStatusIndicator } from './theia-status-indicator';
2
+ export declare class TheiaNotificationIndicator extends TheiaStatusIndicator {
3
+ id: string;
4
+ hasNotifications(): Promise<boolean>;
5
+ waitForVisible(expectNotifications?: boolean): Promise<void>;
6
+ toggleOverlay(): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=theia-notification-indicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theia-notification-indicator.d.ts","sourceRoot":"","sources":["../src/theia-notification-indicator.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIhE,qBAAa,0BAA2B,SAAQ,oBAAoB;IAChE,EAAE,SAA+B;IAE3B,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IAM3B,cAAc,CAAC,mBAAmB,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAOnE,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;CAOvC"}