@redhat-developer/page-objects 1.1.3 → 1.3.0

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 (50) hide show
  1. package/out/components/ElementWithContextMenu.d.ts +1 -1
  2. package/out/components/ElementWithContextMenu.js +7 -7
  3. package/out/components/activityBar/ActionsControl.d.ts +2 -2
  4. package/out/components/activityBar/ActionsControl.js +1 -1
  5. package/out/components/activityBar/ActivityBar.d.ts +2 -2
  6. package/out/components/activityBar/ActivityBar.js +1 -1
  7. package/out/components/activityBar/ViewControl.d.ts +2 -2
  8. package/out/components/activityBar/ViewControl.js +1 -1
  9. package/out/components/bottomBar/AbstractViews.d.ts +2 -2
  10. package/out/components/bottomBar/AbstractViews.js +1 -1
  11. package/out/components/bottomBar/ProblemsView.d.ts +2 -2
  12. package/out/components/bottomBar/ProblemsView.js +1 -1
  13. package/out/components/bottomBar/Views.d.ts +2 -2
  14. package/out/components/bottomBar/Views.js +1 -1
  15. package/out/components/editor/Editor.d.ts +2 -2
  16. package/out/components/editor/Editor.js +1 -1
  17. package/out/components/editor/EditorAction.d.ts +6 -3
  18. package/out/components/editor/EditorAction.js +38 -3
  19. package/out/components/editor/EditorView.d.ts +2 -2
  20. package/out/components/editor/EditorView.js +10 -2
  21. package/out/components/editor/SettingsEditor.js +1 -1
  22. package/out/components/editor/TextEditor.d.ts +64 -4
  23. package/out/components/editor/TextEditor.js +124 -27
  24. package/out/components/editor/WebView.js +1 -13
  25. package/out/components/menu/TitleBar.d.ts +1 -0
  26. package/out/components/menu/TitleBar.js +1 -0
  27. package/out/components/menu/WindowControls.d.ts +5 -0
  28. package/out/components/menu/WindowControls.js +5 -0
  29. package/out/components/sidebar/ViewItem.d.ts +2 -2
  30. package/out/components/sidebar/ViewItem.js +1 -1
  31. package/out/components/sidebar/ViewSection.js +2 -2
  32. package/out/components/sidebar/ViewTitlePart.d.ts +2 -2
  33. package/out/components/sidebar/ViewTitlePart.js +1 -1
  34. package/out/components/sidebar/debug/DebugView.d.ts +6 -0
  35. package/out/components/sidebar/debug/DebugView.js +9 -0
  36. package/out/components/sidebar/scm/NewScmView.js +1 -1
  37. package/out/components/sidebar/scm/ScmView.d.ts +3 -3
  38. package/out/components/sidebar/scm/ScmView.js +3 -3
  39. package/out/components/sidebar/tree/debug/CallStackItem.d.ts +32 -0
  40. package/out/components/sidebar/tree/debug/CallStackItem.js +43 -0
  41. package/out/components/sidebar/tree/debug/DebugCallStackSection.d.ts +23 -0
  42. package/out/components/sidebar/tree/debug/DebugCallStackSection.js +28 -0
  43. package/out/components/sidebar/tree/debug/SectionBreakpoint.d.ts +2 -2
  44. package/out/components/sidebar/tree/debug/SectionBreakpoint.js +1 -1
  45. package/out/components/workbench/Notification.d.ts +2 -2
  46. package/out/components/workbench/Notification.js +1 -1
  47. package/out/index.d.ts +2 -0
  48. package/out/index.js +2 -0
  49. package/out/locators/locators.d.ts +8 -0
  50. package/package.json +3 -3
@@ -19,7 +19,7 @@ import { ContextMenu } from '..';
19
19
  /**
20
20
  * Abstract element that has a context menu
21
21
  */
22
- export declare abstract class ElementWithContexMenu extends AbstractElement {
22
+ export declare abstract class ElementWithContextMenu extends AbstractElement {
23
23
  /**
24
24
  * Open context menu on the element
25
25
  */
@@ -16,26 +16,26 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.ElementWithContexMenu = void 0;
19
+ exports.ElementWithContextMenu = void 0;
20
20
  const AbstractElement_1 = require("./AbstractElement");
21
21
  const __1 = require("..");
22
22
  const selenium_webdriver_1 = require("selenium-webdriver");
23
23
  /**
24
24
  * Abstract element that has a context menu
25
25
  */
26
- class ElementWithContexMenu extends AbstractElement_1.AbstractElement {
26
+ class ElementWithContextMenu extends AbstractElement_1.AbstractElement {
27
27
  /**
28
28
  * Open context menu on the element
29
29
  */
30
30
  async openContextMenu() {
31
- const workbench = await this.getDriver().findElement(ElementWithContexMenu.locators.Workbench.constructor);
32
- const menus = await workbench.findElements(ElementWithContexMenu.locators.ContextMenu.contextView);
31
+ const workbench = await this.getDriver().findElement(ElementWithContextMenu.locators.Workbench.constructor);
32
+ const menus = await workbench.findElements(ElementWithContextMenu.locators.ContextMenu.contextView);
33
33
  if (menus.length < 1) {
34
34
  await this.getDriver().actions().contextClick(this).perform();
35
- await this.getDriver().wait(selenium_webdriver_1.until.elementLocated(ElementWithContexMenu.locators.ContextMenu.contextView), 2000);
35
+ await this.getDriver().wait(selenium_webdriver_1.until.elementLocated(ElementWithContextMenu.locators.ContextMenu.contextView), 2000);
36
36
  return new __1.ContextMenu(workbench).wait();
37
37
  }
38
- else if ((await workbench.findElements(ElementWithContexMenu.locators.ContextMenu.viewBlock)).length > 0) {
38
+ else if ((await workbench.findElements(ElementWithContextMenu.locators.ContextMenu.viewBlock)).length > 0) {
39
39
  await this.getDriver().actions().contextClick(this).perform();
40
40
  try {
41
41
  await this.getDriver().wait(selenium_webdriver_1.until.elementIsNotVisible(this), 1000);
@@ -50,5 +50,5 @@ class ElementWithContexMenu extends AbstractElement_1.AbstractElement {
50
50
  return new __1.ContextMenu(workbench).wait();
51
51
  }
52
52
  }
53
- exports.ElementWithContexMenu = ElementWithContexMenu;
53
+ exports.ElementWithContextMenu = ElementWithContextMenu;
54
54
  //# sourceMappingURL=ElementWithContextMenu.js.map
@@ -16,11 +16,11 @@
16
16
  */
17
17
  import { WebElement } from 'selenium-webdriver';
18
18
  import { ActivityBar, ContextMenu } from '../..';
19
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
19
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
20
20
  /**
21
21
  * Page object representing the global action controls on the bottom of the action bar
22
22
  */
23
- export declare class ActionsControl extends ElementWithContexMenu {
23
+ export declare class ActionsControl extends ElementWithContextMenu {
24
24
  constructor(element: WebElement, bar: ActivityBar);
25
25
  /**
26
26
  * Open the context menu bound to this global action
@@ -21,7 +21,7 @@ const ElementWithContextMenu_1 = require("../ElementWithContextMenu");
21
21
  /**
22
22
  * Page object representing the global action controls on the bottom of the action bar
23
23
  */
24
- class ActionsControl extends ElementWithContextMenu_1.ElementWithContexMenu {
24
+ class ActionsControl extends ElementWithContextMenu_1.ElementWithContextMenu {
25
25
  constructor(element, bar) {
26
26
  super(element, bar);
27
27
  }
@@ -15,11 +15,11 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { ActionsControl, ViewControl } from '../..';
18
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
18
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
19
19
  /**
20
20
  * Page object representing the left side activity bar in VS Code
21
21
  */
22
- export declare class ActivityBar extends ElementWithContexMenu {
22
+ export declare class ActivityBar extends ElementWithContextMenu {
23
23
  constructor();
24
24
  /**
25
25
  * Find all view containers displayed in the activity bar
@@ -22,7 +22,7 @@ const ElementWithContextMenu_1 = require("../ElementWithContextMenu");
22
22
  /**
23
23
  * Page object representing the left side activity bar in VS Code
24
24
  */
25
- class ActivityBar extends ElementWithContextMenu_1.ElementWithContexMenu {
25
+ class ActivityBar extends ElementWithContextMenu_1.ElementWithContextMenu {
26
26
  constructor() {
27
27
  super(ActivityBar.locators.ActivityBar.constructor, ActivityBar.locators.Workbench.constructor);
28
28
  }
@@ -15,12 +15,12 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { ActivityBar, SideBarView } from '../..';
18
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
18
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
19
19
  import { WebElement } from 'selenium-webdriver';
20
20
  /**
21
21
  * Page object representing a view container item in the activity bar
22
22
  */
23
- export declare class ViewControl extends ElementWithContexMenu {
23
+ export declare class ViewControl extends ElementWithContextMenu {
24
24
  constructor(element: WebElement, bar: ActivityBar);
25
25
  /**
26
26
  * Opens the associated view if not already open
@@ -23,7 +23,7 @@ const NewScmView_1 = require("../sidebar/scm/NewScmView");
23
23
  /**
24
24
  * Page object representing a view container item in the activity bar
25
25
  */
26
- class ViewControl extends ElementWithContextMenu_1.ElementWithContexMenu {
26
+ class ViewControl extends ElementWithContextMenu_1.ElementWithContextMenu {
27
27
  constructor(element, bar) {
28
28
  super(element, bar);
29
29
  }
@@ -14,11 +14,11 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
17
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
18
18
  /**
19
19
  * View with channel selector
20
20
  */
21
- export declare abstract class ChannelView extends ElementWithContexMenu {
21
+ export declare abstract class ChannelView extends ElementWithContextMenu {
22
22
  protected actionsLabel: string;
23
23
  /**
24
24
  * Get names of all selectable channels
@@ -22,7 +22,7 @@ const ElementWithContextMenu_1 = require("../ElementWithContextMenu");
22
22
  /**
23
23
  * View with channel selector
24
24
  */
25
- class ChannelView extends ElementWithContextMenu_1.ElementWithContexMenu {
25
+ class ChannelView extends ElementWithContextMenu_1.ElementWithContextMenu {
26
26
  actionsLabel;
27
27
  /**
28
28
  * Get names of all selectable channels
@@ -17,7 +17,7 @@
17
17
  import { BottomBarPanel } from '../..';
18
18
  import { AbstractElement } from '../AbstractElement';
19
19
  import { WebElement } from 'selenium-webdriver';
20
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
20
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
21
21
  /**
22
22
  * Problems view in the bottom panel
23
23
  */
@@ -62,7 +62,7 @@ export declare class ProblemsView extends AbstractElement {
62
62
  /**
63
63
  * Page object for a Marker in Problems view
64
64
  */
65
- export declare class Marker extends ElementWithContexMenu {
65
+ export declare class Marker extends ElementWithContextMenu {
66
66
  constructor(element: WebElement, view: ProblemsView);
67
67
  /**
68
68
  * Get the type of the marker. Possible types are:
@@ -96,7 +96,7 @@ exports.ProblemsView = ProblemsView;
96
96
  /**
97
97
  * Page object for a Marker in Problems view
98
98
  */
99
- class Marker extends ElementWithContextMenu_1.ElementWithContexMenu {
99
+ class Marker extends ElementWithContextMenu_1.ElementWithContextMenu {
100
100
  constructor(element, view) {
101
101
  super(element, view);
102
102
  }
@@ -16,7 +16,7 @@
16
16
  */
17
17
  import { BottomBarPanel, ContentAssist } from '../..';
18
18
  import { TextView, ChannelView } from './AbstractViews';
19
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
19
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
20
20
  /**
21
21
  * Output view of the bottom panel
22
22
  */
@@ -32,7 +32,7 @@ export declare class OutputView extends TextView {
32
32
  * Debug Console view on the bottom panel
33
33
  * Most functionality will only be available when a debug session is running
34
34
  */
35
- export declare class DebugConsoleView extends ElementWithContexMenu {
35
+ export declare class DebugConsoleView extends ElementWithContextMenu {
36
36
  constructor(panel?: BottomBarPanel);
37
37
  /**
38
38
  * Clear the console of all text
@@ -42,7 +42,7 @@ exports.OutputView = OutputView;
42
42
  * Debug Console view on the bottom panel
43
43
  * Most functionality will only be available when a debug session is running
44
44
  */
45
- class DebugConsoleView extends ElementWithContextMenu_1.ElementWithContexMenu {
45
+ class DebugConsoleView extends ElementWithContextMenu_1.ElementWithContextMenu {
46
46
  constructor(panel = new __1.BottomBarPanel()) {
47
47
  super(DebugConsoleView.locators.DebugConsoleView.constructor, panel);
48
48
  }
@@ -14,13 +14,13 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
17
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
18
18
  import { EditorTab, EditorView, EditorGroup } from '../..';
19
19
  import { WebElement, Locator } from 'selenium-webdriver';
20
20
  /**
21
21
  * Abstract representation of an editor tab
22
22
  */
23
- export declare abstract class Editor extends ElementWithContexMenu {
23
+ export declare abstract class Editor extends ElementWithContextMenu {
24
24
  constructor(view?: EditorView | EditorGroup, base?: Locator | WebElement);
25
25
  /**
26
26
  * Get title/name of the open editor
@@ -22,7 +22,7 @@ const __1 = require("../..");
22
22
  /**
23
23
  * Abstract representation of an editor tab
24
24
  */
25
- class Editor extends ElementWithContextMenu_1.ElementWithContexMenu {
25
+ class Editor extends ElementWithContextMenu_1.ElementWithContextMenu {
26
26
  constructor(view = new __1.EditorView(), base = Editor.locators.Editor.constructor) {
27
27
  super(base, view);
28
28
  }
@@ -15,12 +15,15 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { EditorGroup } from './EditorView';
18
- import { AbstractElement } from '../AbstractElement';
19
- import { WebElement } from '../..';
20
- export declare class EditorAction extends AbstractElement {
18
+ import { ContextMenu, WebElement } from '../..';
19
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
20
+ export declare class EditorAction extends ElementWithContextMenu {
21
21
  constructor(element: WebElement, parent: EditorGroup);
22
22
  /**
23
23
  * Get text description of the action.
24
24
  */
25
25
  getTitle(): Promise<string>;
26
26
  }
27
+ export declare class EditorActionDropdown extends EditorAction {
28
+ open(): Promise<ContextMenu>;
29
+ }
@@ -16,9 +16,10 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.EditorAction = void 0;
20
- const AbstractElement_1 = require("../AbstractElement");
21
- class EditorAction extends AbstractElement_1.AbstractElement {
19
+ exports.EditorActionDropdown = exports.EditorAction = void 0;
20
+ const __1 = require("../..");
21
+ const ElementWithContextMenu_1 = require("../ElementWithContextMenu");
22
+ class EditorAction extends ElementWithContextMenu_1.ElementWithContextMenu {
22
23
  constructor(element, parent) {
23
24
  super(element, parent);
24
25
  }
@@ -30,4 +31,38 @@ class EditorAction extends AbstractElement_1.AbstractElement {
30
31
  }
31
32
  }
32
33
  exports.EditorAction = EditorAction;
34
+ class EditorActionDropdown extends EditorAction {
35
+ async open() {
36
+ await this.click();
37
+ const shadowRootHost = await this.enclosingItem.findElements(__1.By.className('shadow-root-host'));
38
+ const actions = this.getDriver().actions();
39
+ await actions.clear();
40
+ await actions.sendKeys(__1.Key.ESCAPE).perform();
41
+ const webdriverCapabilities = await this.getDriver().getCapabilities();
42
+ const chromiumVersion = webdriverCapabilities.getBrowserVersion();
43
+ if (shadowRootHost.length > 0) {
44
+ if ((await this.getAttribute('aria-expanded')) !== 'true') {
45
+ await this.click();
46
+ }
47
+ let shadowRoot;
48
+ const webdriverCapabilities = await this.getDriver().getCapabilities();
49
+ const chromiumVersion = webdriverCapabilities.getBrowserVersion();
50
+ if (chromiumVersion && parseInt(chromiumVersion.split('.')[0]) >= 96) {
51
+ shadowRoot = await shadowRootHost[0].getShadowRoot();
52
+ return new __1.ContextMenu(await shadowRoot.findElement(__1.By.className('monaco-menu-container'))).wait();
53
+ }
54
+ else {
55
+ shadowRoot = (await this.getDriver().executeScript('return arguments[0].shadowRoot', shadowRootHost[0]));
56
+ return new __1.ContextMenu(shadowRoot).wait();
57
+ }
58
+ }
59
+ else if (chromiumVersion && parseInt(chromiumVersion.split('.')[0]) >= 100) {
60
+ await this.click();
61
+ const workbench = await this.getDriver().findElement(ElementWithContextMenu_1.ElementWithContextMenu.locators.Workbench.constructor);
62
+ return new __1.ContextMenu(workbench).wait();
63
+ }
64
+ return await super.openContextMenu();
65
+ }
66
+ }
67
+ exports.EditorActionDropdown = EditorActionDropdown;
33
68
  //# sourceMappingURL=EditorAction.js.map
@@ -16,7 +16,7 @@
16
16
  */
17
17
  import { WebElement } from 'selenium-webdriver';
18
18
  import { AbstractElement } from '../AbstractElement';
19
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
19
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
20
20
  import { Editor } from './Editor';
21
21
  import { EditorAction } from './EditorAction';
22
22
  export declare class EditorTabNotFound extends Error {
@@ -155,7 +155,7 @@ export declare class EditorGroup extends AbstractElement {
155
155
  /**
156
156
  * Page object for editor view tab
157
157
  */
158
- export declare class EditorTab extends ElementWithContexMenu {
158
+ export declare class EditorTab extends ElementWithContextMenu {
159
159
  constructor(element: WebElement, view: EditorView);
160
160
  /**
161
161
  * Get the tab title as string
@@ -314,7 +314,15 @@ class EditorGroup extends AbstractElement_1.AbstractElement {
314
314
  */
315
315
  async getActions() {
316
316
  const actions = await this.findElement(EditorGroup.locators.EditorView.actionContainer).findElements(EditorGroup.locators.EditorView.actionItem);
317
- return actions.map((action) => new EditorAction_1.EditorAction(action, this));
317
+ return Promise.all(actions.map(async (action) => {
318
+ const dropdown = await action.getAttribute(EditorGroup.locators.EditorView.dropdown);
319
+ if (dropdown) {
320
+ return new EditorAction_1.EditorActionDropdown(action, this);
321
+ }
322
+ else {
323
+ return new EditorAction_1.EditorAction(action, this);
324
+ }
325
+ }));
318
326
  }
319
327
  /**
320
328
  * Find an editor action button by predicate or title
@@ -336,7 +344,7 @@ exports.EditorGroup = EditorGroup;
336
344
  /**
337
345
  * Page object for editor view tab
338
346
  */
339
- class EditorTab extends ElementWithContextMenu_1.ElementWithContexMenu {
347
+ class EditorTab extends ElementWithContextMenu_1.ElementWithContextMenu {
340
348
  constructor(element, view) {
341
349
  super(element, view);
342
350
  }
@@ -45,7 +45,7 @@ class SettingsEditor extends Editor_1.Editor {
45
45
  const category = categories.join(this.divider);
46
46
  const searchBox = await this.findElement(SettingsEditor.locators.Editor.inputArea);
47
47
  await searchBox.sendKeys(selenium_webdriver_1.Key.chord(SettingsEditor.ctlKey, 'a'));
48
- await searchBox.sendKeys(`${category}${this.divider}${title}`);
48
+ await searchBox.sendKeys(`${category}>${title}`);
49
49
  return await this._getSettingItem(title, category);
50
50
  }
51
51
  /**
@@ -17,7 +17,7 @@
17
17
  import { ContentAssist, ContextMenu, InputBox } from '../..';
18
18
  import { WebElement } from 'selenium-webdriver';
19
19
  import { Editor } from './Editor';
20
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
20
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
21
21
  import { AbstractElement } from '../AbstractElement';
22
22
  import { Breakpoint } from './Breakpoint';
23
23
  export declare class BreakpointError extends Error {
@@ -105,7 +105,7 @@ export declare class TextEditor extends Editor {
105
105
  * Find and select a given text. Not usable for multi line selection.
106
106
  *
107
107
  * @param text text to select
108
- * @param occurrence specify which onccurrence of text to select if multiple are present in the document
108
+ * @param occurrence specify which occurrence of text to select if multiple are present in the document
109
109
  */
110
110
  selectText(text: string, occurrence?: number): Promise<void>;
111
111
  /**
@@ -132,13 +132,73 @@ export declare class TextEditor extends Editor {
132
132
  * @returns promise resolving when the text is typed in
133
133
  */
134
134
  typeText(text: string): Promise<void>;
135
+ /**
136
+ * Set cursor to given position using command prompt :Ln,Col
137
+ * @param line line number to set to
138
+ * @param column column number to set to
139
+ * @returns Promise resolving when the cursor has reached the given coordinates
140
+ */
141
+ setCursor(line: number, column: number, timeout?: number): Promise<void>;
142
+ /**
143
+ * Get indentation from the status bar for the currently opened text editor
144
+ * @returns \{ string, number \} object which contains label and value of indentation
145
+ */
146
+ getIndentation(): Promise<{
147
+ label: string;
148
+ value: number;
149
+ }>;
135
150
  /**
136
151
  * Move the cursor to the given coordinates
137
152
  * @param line line number to move to
138
153
  * @param column column number to move to
139
154
  * @returns Promise resolving when the cursor has reached the given coordinates
140
155
  */
141
- moveCursor(line: number, column: number): Promise<void>;
156
+ moveCursor(line: number, column: number, timeout?: number): Promise<void>;
157
+ /**
158
+ * (private) Move the cursor to the given line coordinate
159
+ * @param inputArea WebElement of an editor input area
160
+ * @param line line number to move to
161
+ * @returns Promise resolving when the cursor has reached the given line coordinate
162
+ */
163
+ private moveCursorToLine;
164
+ /**
165
+ * (private) Move the cursor to the given column coordinate
166
+ * @param inputArea WebElement of an editor input area
167
+ * @param column column number to move to
168
+ * @returns Promise resolving when the cursor has reached the given column coordinate
169
+ */
170
+ private moveCursorToColumn;
171
+ /**
172
+ * (private) Check if the cursor is already on requested line
173
+ * @param line line number to check against current cursor position
174
+ * @returns true / false
175
+ */
176
+ private isLine;
177
+ /**
178
+ * (private) Check if the cursor is already on requested column
179
+ * @param column column number to check against current cursor position
180
+ * @returns true / false
181
+ */
182
+ private isColumn;
183
+ /**
184
+ * (private) Dynamic waiting for cursor position movements
185
+ * @param line line number to wait
186
+ * @param column column number to wait
187
+ * @param timeout default timeout
188
+ */
189
+ private waitForCursorPositionAt;
190
+ /**
191
+ * (private) Dynamic waiting for cursor position movements at line
192
+ * @param line line number to wait
193
+ * @param timeout
194
+ */
195
+ private waitForCursorPositionAtLine;
196
+ /**
197
+ * (private) Dynamic waiting for cursor position movements at column
198
+ * @param column column number to wait
199
+ * @param timeout
200
+ */
201
+ private waitForCursorPositionAtColumn;
142
202
  /**
143
203
  * Get number of lines in the editor
144
204
  * @returns Promise resolving to number of lines
@@ -184,7 +244,7 @@ export declare class TextEditor extends Editor {
184
244
  /**
185
245
  * Text selection block
186
246
  */
187
- declare class Selection extends ElementWithContexMenu {
247
+ declare class Selection extends ElementWithContextMenu {
188
248
  constructor(el: WebElement, editor: TextEditor);
189
249
  openContextMenu(): Promise<ContextMenu>;
190
250
  }
@@ -225,7 +225,7 @@ class TextEditor extends Editor_1.Editor {
225
225
  * Find and select a given text. Not usable for multi line selection.
226
226
  *
227
227
  * @param text text to select
228
- * @param occurrence specify which onccurrence of text to select if multiple are present in the document
228
+ * @param occurrence specify which occurrence of text to select if multiple are present in the document
229
229
  */
230
230
  async selectText(text, occurrence = 1) {
231
231
  const lineNum = await this.getLineOfText(text, occurrence);
@@ -318,47 +318,144 @@ class TextEditor extends Editor_1.Editor {
318
318
  const inputarea = await this.findElement(TextEditor.locators.Editor.inputArea);
319
319
  await inputarea.sendKeys(text);
320
320
  }
321
+ /**
322
+ * Set cursor to given position using command prompt :Ln,Col
323
+ * @param line line number to set to
324
+ * @param column column number to set to
325
+ * @returns Promise resolving when the cursor has reached the given coordinates
326
+ */
327
+ async setCursor(line, column, timeout = 2_500) {
328
+ const input = await new __1.Workbench().openCommandPrompt();
329
+ await input.setText(`:${line},${column}`);
330
+ await input.confirm();
331
+ await this.waitForCursorPositionAt(line, column, timeout);
332
+ }
333
+ /**
334
+ * Get indentation from the status bar for the currently opened text editor
335
+ * @returns \{ string, number \} object which contains label and value of indentation
336
+ */
337
+ async getIndentation() {
338
+ const indentation = await new StatusBar_1.StatusBar().getCurrentIndentation();
339
+ const value = Number(indentation.match(/\d+/g)?.at(0));
340
+ const label = indentation.match(/^[a-zA-Z\s]+/g)?.at(0);
341
+ return { label, value };
342
+ }
321
343
  /**
322
344
  * Move the cursor to the given coordinates
323
345
  * @param line line number to move to
324
346
  * @param column column number to move to
325
347
  * @returns Promise resolving when the cursor has reached the given coordinates
326
348
  */
327
- async moveCursor(line, column) {
349
+ async moveCursor(line, column, timeout = 10_000) {
328
350
  if (line < 1 || line > (await this.getNumberOfLines())) {
329
351
  throw new Error(`Line number ${line} does not exist`);
330
352
  }
331
353
  if (column < 1) {
332
354
  throw new Error(`Column number ${column} does not exist`);
333
355
  }
334
- if (process.platform === 'darwin') {
335
- const input = await new __1.Workbench().openCommandPrompt();
336
- await input.setText(`:${line},${column}`);
337
- await input.confirm();
356
+ const inputarea = await this.findElement(TextEditor.locators.Editor.inputArea);
357
+ await inputarea.getDriver().wait(async () => {
358
+ await this.moveCursorToLine(inputarea, line);
359
+ return await this.isLine(line);
360
+ }, timeout, `Unable to move cursor to line: ${line}`);
361
+ await inputarea.getDriver().wait(async () => {
362
+ await this.moveCursorToColumn(inputarea, column);
363
+ return await this.isColumn(column);
364
+ }, timeout, `Unable to move cursor to column: ${column}`);
365
+ }
366
+ /**
367
+ * (private) Move the cursor to the given line coordinate
368
+ * @param inputArea WebElement of an editor input area
369
+ * @param line line number to move to
370
+ * @returns Promise resolving when the cursor has reached the given line coordinate
371
+ */
372
+ async moveCursorToLine(inputArea, line) {
373
+ const coordinates = await this.getCoordinates();
374
+ const lineGap = coordinates[0] - line;
375
+ const lineKey = lineGap >= 0 ? selenium_webdriver_1.Key.UP : selenium_webdriver_1.Key.DOWN;
376
+ for (let i = 0; i < Math.abs(lineGap); i++) {
377
+ if (await this.isLine(line)) {
378
+ break;
379
+ }
380
+ await inputArea.getDriver().actions().clear();
381
+ await inputArea.sendKeys(lineKey);
382
+ await inputArea.getDriver().sleep(500);
338
383
  }
339
- else {
340
- const inputarea = await this.findElement(TextEditor.locators.Editor.inputArea);
341
- let coordinates = await this.getCoordinates();
342
- const lineGap = coordinates[0] - line;
343
- const lineKey = lineGap >= 0 ? selenium_webdriver_1.Key.UP : selenium_webdriver_1.Key.DOWN;
344
- for (let i = 0; i < Math.abs(lineGap); i++) {
345
- await inputarea.sendKeys(lineKey);
384
+ }
385
+ /**
386
+ * (private) Move the cursor to the given column coordinate
387
+ * @param inputArea WebElement of an editor input area
388
+ * @param column column number to move to
389
+ * @returns Promise resolving when the cursor has reached the given column coordinate
390
+ */
391
+ async moveCursorToColumn(inputArea, column) {
392
+ const coordinates = await this.getCoordinates();
393
+ const columnGap = coordinates[1] - column;
394
+ const columnKey = columnGap >= 0 ? selenium_webdriver_1.Key.LEFT : selenium_webdriver_1.Key.RIGHT;
395
+ for (let i = 0; i < Math.abs(columnGap); i++) {
396
+ if (await this.isColumn(column)) {
397
+ break;
346
398
  }
347
- coordinates = await this.getCoordinates();
348
- const columnGap = coordinates[1] - column;
349
- const columnKey = columnGap >= 0 ? selenium_webdriver_1.Key.LEFT : selenium_webdriver_1.Key.RIGHT;
350
- for (let i = 0; i < Math.abs(columnGap); i++) {
351
- await inputarea.sendKeys(columnKey);
352
- const actualCoordinates = (await this.getCoordinates())[0];
353
- if (actualCoordinates !== coordinates[0]) {
354
- throw new Error(`Column number ${column} is not accessible on line ${line}`);
355
- }
399
+ await inputArea.getDriver().actions().clear();
400
+ await inputArea.sendKeys(columnKey);
401
+ await inputArea.getDriver().sleep(500);
402
+ if ((await this.getCoordinates())[0] !== coordinates[0]) {
403
+ throw new Error(`Column number ${column} is not accessible on line ${coordinates[0]}`);
356
404
  }
357
405
  }
358
- await this.getDriver().wait(async () => {
359
- const coor = await this.getCoordinates();
360
- return coor[0] === line && coor[1] === column;
361
- }, 10000, `Unable to set cursor at position ${column}:${line}`);
406
+ }
407
+ /**
408
+ * (private) Check if the cursor is already on requested line
409
+ * @param line line number to check against current cursor position
410
+ * @returns true / false
411
+ */
412
+ async isLine(line) {
413
+ const actualCoordinates = await this.getCoordinates();
414
+ if (actualCoordinates[0] === line) {
415
+ return true;
416
+ }
417
+ return false;
418
+ }
419
+ /**
420
+ * (private) Check if the cursor is already on requested column
421
+ * @param column column number to check against current cursor position
422
+ * @returns true / false
423
+ */
424
+ async isColumn(column) {
425
+ const actualCoordinates = await this.getCoordinates();
426
+ if (actualCoordinates[1] === column) {
427
+ return true;
428
+ }
429
+ return false;
430
+ }
431
+ /**
432
+ * (private) Dynamic waiting for cursor position movements
433
+ * @param line line number to wait
434
+ * @param column column number to wait
435
+ * @param timeout default timeout
436
+ */
437
+ async waitForCursorPositionAt(line, column, timeout = 2_500) {
438
+ (await this.waitForCursorPositionAtLine(line, timeout)) && (await this.waitForCursorPositionAtColumn(column, timeout));
439
+ }
440
+ /**
441
+ * (private) Dynamic waiting for cursor position movements at line
442
+ * @param line line number to wait
443
+ * @param timeout
444
+ */
445
+ async waitForCursorPositionAtLine(line, timeout) {
446
+ return await this.getDriver().wait(async () => {
447
+ return await this.isLine(line);
448
+ }, timeout, `Unable to set cursor at line ${line}`, 500);
449
+ }
450
+ /**
451
+ * (private) Dynamic waiting for cursor position movements at column
452
+ * @param column column number to wait
453
+ * @param timeout
454
+ */
455
+ async waitForCursorPositionAtColumn(column, timeout) {
456
+ return await this.getDriver().wait(async () => {
457
+ return await this.isColumn(column);
458
+ }, timeout, `Unable to set cursor at column ${column}`, 500);
362
459
  }
363
460
  /**
364
461
  * Get number of lines in the editor
@@ -511,7 +608,7 @@ exports.TextEditor = TextEditor;
511
608
  /**
512
609
  * Text selection block
513
610
  */
514
- class Selection extends ElementWithContextMenu_1.ElementWithContexMenu {
611
+ class Selection extends ElementWithContextMenu_1.ElementWithContextMenu {
515
612
  constructor(el, editor) {
516
613
  super(el, editor);
517
614
  }
@@ -20,8 +20,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.WebView = void 0;
23
- /* eslint-disable no-redeclare */
24
- const selenium_webdriver_1 = require("selenium-webdriver");
25
23
  const WebviewMixin_1 = __importDefault(require("../WebviewMixin"));
26
24
  const Editor_1 = require("./Editor");
27
25
  /**
@@ -38,17 +36,7 @@ class WebViewBase extends Editor_1.Editor {
38
36
  }
39
37
  }
40
38
  await this.getDriver().switchTo().window(handle);
41
- const reference = await this.findElement(WebViewBase.locators.EditorView.webView);
42
- const containers = await this.getDriver().wait(selenium_webdriver_1.until.elementsLocated(WebViewBase.locators.WebView.container(await reference.getAttribute(WebViewBase.locators.WebView.attribute))), 5000);
43
- return (await containers[0].getDriver().wait(async () => {
44
- for (const container of containers) {
45
- const tries = await container.findElements(WebViewBase.locators.WebView.iframe);
46
- if (tries.length > 0) {
47
- return tries[0];
48
- }
49
- }
50
- return undefined;
51
- }, 5000));
39
+ return await this.getDriver().findElement(WebViewBase.locators.WebView.iframe);
52
40
  }
53
41
  }
54
42
  exports.WebView = (0, WebviewMixin_1.default)(WebViewBase);
@@ -40,6 +40,7 @@ export declare class TitleBar extends Menu {
40
40
  getTitle(): Promise<string>;
41
41
  /**
42
42
  * Get a reference to the WindowControls
43
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
43
44
  */
44
45
  getWindowControls(): WindowControls;
45
46
  }
@@ -65,6 +65,7 @@ class TitleBar extends Menu_1.Menu {
65
65
  }
66
66
  /**
67
67
  * Get a reference to the WindowControls
68
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
68
69
  */
69
70
  getWindowControls() {
70
71
  return new __1.WindowControls(this);
@@ -18,27 +18,32 @@ import { AbstractElement } from '../AbstractElement';
18
18
  import { TitleBar } from '../..';
19
19
  /**
20
20
  * Page object for the windows controls part of the title bar
21
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
21
22
  */
22
23
  export declare class WindowControls extends AbstractElement {
23
24
  constructor(bar?: TitleBar);
24
25
  /**
25
26
  * Use the minimize window button
26
27
  * @returns Promise resolving when minimize button is pressed
28
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
27
29
  */
28
30
  minimize(): Promise<void>;
29
31
  /**
30
32
  * Use the maximize window button if the window is not maximized
31
33
  * @returns Promise resolving when maximize button is pressed
34
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
32
35
  */
33
36
  maximize(): Promise<void>;
34
37
  /**
35
38
  * Use the restore window button if the window is maximized
36
39
  * @returns Promise resolving when restore button is pressed
40
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
37
41
  */
38
42
  restore(): Promise<void>;
39
43
  /**
40
44
  * Use the window close button. Use at your own risk.
41
45
  * @returns Promise resolving when close button is pressed
46
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
42
47
  */
43
48
  close(): Promise<void>;
44
49
  }
@@ -21,6 +21,7 @@ const AbstractElement_1 = require("../AbstractElement");
21
21
  const __1 = require("../..");
22
22
  /**
23
23
  * Page object for the windows controls part of the title bar
24
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
24
25
  */
25
26
  class WindowControls extends AbstractElement_1.AbstractElement {
26
27
  constructor(bar = new __1.TitleBar()) {
@@ -29,6 +30,7 @@ class WindowControls extends AbstractElement_1.AbstractElement {
29
30
  /**
30
31
  * Use the minimize window button
31
32
  * @returns Promise resolving when minimize button is pressed
33
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
32
34
  */
33
35
  async minimize() {
34
36
  const minButton = await this.findElement(WindowControls.locators.WindowControls.minimize);
@@ -37,6 +39,7 @@ class WindowControls extends AbstractElement_1.AbstractElement {
37
39
  /**
38
40
  * Use the maximize window button if the window is not maximized
39
41
  * @returns Promise resolving when maximize button is pressed
42
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
40
43
  */
41
44
  async maximize() {
42
45
  let maxButton;
@@ -51,6 +54,7 @@ class WindowControls extends AbstractElement_1.AbstractElement {
51
54
  /**
52
55
  * Use the restore window button if the window is maximized
53
56
  * @returns Promise resolving when restore button is pressed
57
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
54
58
  */
55
59
  async restore() {
56
60
  let maxButton;
@@ -65,6 +69,7 @@ class WindowControls extends AbstractElement_1.AbstractElement {
65
69
  /**
66
70
  * Use the window close button. Use at your own risk.
67
71
  * @returns Promise resolving when close button is pressed
72
+ * @deprecated Window Control is no more available in a DOM of Visual Studio Code
68
73
  */
69
74
  async close() {
70
75
  const closeButton = await this.findElement(WindowControls.locators.WindowControls.close);
@@ -14,13 +14,13 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
17
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
18
18
  import { AbstractElement } from '../AbstractElement';
19
19
  import { WebElement, By } from 'selenium-webdriver';
20
20
  /**
21
21
  * Arbitrary item in the side bar view
22
22
  */
23
- export declare abstract class ViewItem extends ElementWithContexMenu {
23
+ export declare abstract class ViewItem extends ElementWithContextMenu {
24
24
  /**
25
25
  * Select the item in the view.
26
26
  * Note that selecting the item will toggle its expand state when applicable.
@@ -24,7 +24,7 @@ const NullAttributeError_1 = require("../../errors/NullAttributeError");
24
24
  /**
25
25
  * Arbitrary item in the side bar view
26
26
  */
27
- class ViewItem extends ElementWithContextMenu_1.ElementWithContexMenu {
27
+ class ViewItem extends ElementWithContextMenu_1.ElementWithContextMenu {
28
28
  /**
29
29
  * Select the item in the view.
30
30
  * Note that selecting the item will toggle its expand state when applicable.
@@ -130,7 +130,7 @@ class ViewSection extends AbstractElement_1.AbstractElement {
130
130
  return undefined;
131
131
  }
132
132
  const section = this;
133
- const btn = new (class extends ElementWithContextMenu_1.ElementWithContexMenu {
133
+ const btn = new (class extends ElementWithContextMenu_1.ElementWithContextMenu {
134
134
  async openContextMenu() {
135
135
  await this.click();
136
136
  const shadowRootHost = await section.findElements(selenium_webdriver_1.By.className('shadow-root-host'));
@@ -172,7 +172,7 @@ class ViewPanelAction extends AbstractElement_1.AbstractElement {
172
172
  return await this.getAttribute(ViewSection.locators.ViewSection.buttonLabel);
173
173
  }
174
174
  async wait(timeout = 1000) {
175
- await this.getDriver().wait(selenium_webdriver_1.until.elementIsEnabled(this), timeout);
175
+ await this.getDriver().wait(selenium_webdriver_1.until.elementLocated(ViewSection.locators.ViewSection.actions), timeout);
176
176
  return this;
177
177
  }
178
178
  }
@@ -14,13 +14,13 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
17
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
18
18
  import { AbstractElement } from '../AbstractElement';
19
19
  import { By, SideBarView } from '../..';
20
20
  /**
21
21
  * Page object representing the top (title) part of a side bar view
22
22
  */
23
- export declare class ViewTitlePart extends ElementWithContexMenu {
23
+ export declare class ViewTitlePart extends ElementWithContextMenu {
24
24
  constructor(view?: SideBarView);
25
25
  /**
26
26
  * Returns the displayed title of the view
@@ -23,7 +23,7 @@ const __1 = require("../..");
23
23
  /**
24
24
  * Page object representing the top (title) part of a side bar view
25
25
  */
26
- class ViewTitlePart extends ElementWithContextMenu_1.ElementWithContexMenu {
26
+ class ViewTitlePart extends ElementWithContextMenu_1.ElementWithContextMenu {
27
27
  constructor(view = new __1.SideBarView()) {
28
28
  super(ViewTitlePart.locators.ViewTitlePart.constructor, view);
29
29
  }
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { SideBarView } from '../SideBarView';
18
18
  import { DebugBreakpointSection } from '../tree/debug/DebugBreakpointSection';
19
+ import { DebugCallStackSection } from '../tree/debug/DebugCallStackSection';
19
20
  import { DebugVariableSection } from '../tree/debug/DebugVariablesSection';
20
21
  /**
21
22
  * Page object representing the Run/Debug view in the side bar
@@ -47,4 +48,9 @@ export declare class DebugView extends SideBarView {
47
48
  * Start Debugging using the current launch configuration
48
49
  */
49
50
  start(): Promise<void>;
51
+ /**
52
+ * Get Call Stack section
53
+ * @returns CallStackSection page object
54
+ */
55
+ getCallStackSection(): Promise<DebugCallStackSection>;
50
56
  }
@@ -19,6 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.DebugView = void 0;
20
20
  const SideBarView_1 = require("../SideBarView");
21
21
  const DebugBreakpointSection_1 = require("../tree/debug/DebugBreakpointSection");
22
+ const DebugCallStackSection_1 = require("../tree/debug/DebugCallStackSection");
22
23
  const DebugVariablesSection_1 = require("../tree/debug/DebugVariablesSection");
23
24
  /**
24
25
  * Page object representing the Run/Debug view in the side bar
@@ -82,6 +83,14 @@ class DebugView extends SideBarView_1.SideBarView {
82
83
  const action = await this.getTitlePart().findElement(DebugView.locators.DebugView.launchCombo);
83
84
  await action.findElement(DebugView.locators.DebugView.startButton).click();
84
85
  }
86
+ /**
87
+ * Get Call Stack section
88
+ * @returns CallStackSection page object
89
+ */
90
+ async getCallStackSection() {
91
+ const content = this.getContent();
92
+ return content.getSection(DebugCallStackSection_1.DebugCallStackSection.locators.DebugCallStackSection.predicate, DebugCallStackSection_1.DebugCallStackSection);
93
+ }
85
94
  }
86
95
  exports.DebugView = DebugView;
87
96
  //# sourceMappingURL=DebugView.js.map
@@ -163,7 +163,7 @@ class MultiScmProvider extends ScmView_1.ScmProvider {
163
163
  }
164
164
  }
165
165
  exports.MultiScmProvider = MultiScmProvider;
166
- class MultiMoreAction extends ElementWithContextMenu_1.ElementWithContexMenu {
166
+ class MultiMoreAction extends ElementWithContextMenu_1.ElementWithContextMenu {
167
167
  constructor(scm) {
168
168
  super(ScmView_1.MoreAction.locators.ScmView.multiMore, scm);
169
169
  }
@@ -18,7 +18,7 @@ import { SideBarView } from '../SideBarView';
18
18
  import { WebElement } from 'selenium-webdriver';
19
19
  import { AbstractElement } from '../../AbstractElement';
20
20
  import { ContextMenu } from '../../..';
21
- import { ElementWithContexMenu } from '../../ElementWithContextMenu';
21
+ import { ElementWithContextMenu } from '../../ElementWithContextMenu';
22
22
  /**
23
23
  * Page object representing the Source Control view
24
24
  */
@@ -87,7 +87,7 @@ export declare class ScmProvider extends AbstractElement {
87
87
  /**
88
88
  * Page object representing a SCM change tree item
89
89
  */
90
- export declare class ScmChange extends ElementWithContexMenu {
90
+ export declare class ScmChange extends ElementWithContextMenu {
91
91
  constructor(row: WebElement, provider: ScmProvider);
92
92
  /**
93
93
  * Get label as a string
@@ -120,7 +120,7 @@ export declare class ScmChange extends ElementWithContexMenu {
120
120
  */
121
121
  takeAction(title: string): Promise<boolean>;
122
122
  }
123
- export declare class MoreAction extends ElementWithContexMenu {
123
+ export declare class MoreAction extends ElementWithContextMenu {
124
124
  constructor(scm: ScmProvider | ScmView);
125
125
  openContextMenu(): Promise<ContextMenu>;
126
126
  }
@@ -177,7 +177,7 @@ exports.ScmProvider = ScmProvider;
177
177
  /**
178
178
  * Page object representing a SCM change tree item
179
179
  */
180
- class ScmChange extends ElementWithContextMenu_1.ElementWithContexMenu {
180
+ class ScmChange extends ElementWithContextMenu_1.ElementWithContextMenu {
181
181
  constructor(row, provider) {
182
182
  super(row, provider);
183
183
  }
@@ -251,7 +251,7 @@ class ScmChange extends ElementWithContextMenu_1.ElementWithContexMenu {
251
251
  }
252
252
  }
253
253
  exports.ScmChange = ScmChange;
254
- class MoreAction extends ElementWithContextMenu_1.ElementWithContexMenu {
254
+ class MoreAction extends ElementWithContextMenu_1.ElementWithContextMenu {
255
255
  constructor(scm) {
256
256
  super(MoreAction.locators.ScmView.more, scm);
257
257
  }
@@ -281,7 +281,7 @@ class MoreAction extends ElementWithContextMenu_1.ElementWithContexMenu {
281
281
  }
282
282
  else if (chromiumVersion && parseInt(chromiumVersion.split('.')[0]) >= 100) {
283
283
  await this.click();
284
- const workbench = await this.getDriver().findElement(ElementWithContextMenu_1.ElementWithContexMenu.locators.Workbench.constructor);
284
+ const workbench = await this.getDriver().findElement(ElementWithContextMenu_1.ElementWithContextMenu.locators.Workbench.constructor);
285
285
  return new __1.ContextMenu(workbench).wait();
286
286
  }
287
287
  return await super.openContextMenu();
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License", destination); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { WebElement } from 'selenium-webdriver';
18
+ import { TreeSection } from '../TreeSection';
19
+ import { CustomTreeItem } from '../custom/CustomTreeItem';
20
+ export declare class CallStackItem extends CustomTreeItem {
21
+ constructor(element: WebElement, viewPart: TreeSection);
22
+ /**
23
+ * Get label of the Call Stack item.
24
+ * @returns a promise resolving to Call Stack item label string
25
+ */
26
+ getLabel(): Promise<string>;
27
+ /**
28
+ * Get text of the Call Stack item.
29
+ * @returns a promise resolving to Call Stack item text string
30
+ */
31
+ getText(): Promise<string>;
32
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ /**
3
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4
+ * contributor license agreements. See the NOTICE file distributed with
5
+ * this work for additional information regarding copyright ownership.
6
+ * The ASF licenses this file to You under the Apache License, Version 2.0
7
+ * (the "License", destination); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ *
10
+ * https://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.CallStackItem = void 0;
20
+ const CustomTreeItem_1 = require("../custom/CustomTreeItem");
21
+ class CallStackItem extends CustomTreeItem_1.CustomTreeItem {
22
+ constructor(element, viewPart) {
23
+ super(element, viewPart);
24
+ }
25
+ /**
26
+ * Get label of the Call Stack item.
27
+ * @returns a promise resolving to Call Stack item label string
28
+ */
29
+ async getLabel() {
30
+ const name = await this.findElement(CallStackItem.locators.CallStackItem.label);
31
+ return await name?.getAttribute('textContent');
32
+ }
33
+ /**
34
+ * Get text of the Call Stack item.
35
+ * @returns a promise resolving to Call Stack item text string
36
+ */
37
+ async getText() {
38
+ const value = await this.findElement(CallStackItem.locators.CallStackItem.text);
39
+ return await value.getText();
40
+ }
41
+ }
42
+ exports.CallStackItem = CallStackItem;
43
+ //# sourceMappingURL=CallStackItem.js.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License", destination); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { WebElement } from 'selenium-webdriver';
18
+ import { ViewContent } from '../../ViewContent';
19
+ import { GenericCustomTreeSection } from '../custom/CustomTreeSection';
20
+ import { CallStackItem } from './CallStackItem';
21
+ export declare class DebugCallStackSection extends GenericCustomTreeSection<CallStackItem> {
22
+ constructor(panel: WebElement, viewContent: ViewContent);
23
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /**
3
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4
+ * contributor license agreements. See the NOTICE file distributed with
5
+ * this work for additional information regarding copyright ownership.
6
+ * The ASF licenses this file to You under the Apache License, Version 2.0
7
+ * (the "License", destination); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ *
10
+ * https://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.DebugCallStackSection = void 0;
20
+ const CustomTreeSection_1 = require("../custom/CustomTreeSection");
21
+ const CallStackItem_1 = require("./CallStackItem");
22
+ class DebugCallStackSection extends CustomTreeSection_1.GenericCustomTreeSection {
23
+ constructor(panel, viewContent) {
24
+ super(panel, viewContent, CallStackItem_1.CallStackItem);
25
+ }
26
+ }
27
+ exports.DebugCallStackSection = DebugCallStackSection;
28
+ //# sourceMappingURL=DebugCallStackSection.js.map
@@ -14,6 +14,6 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { ElementWithContexMenu } from '../../../ElementWithContextMenu';
18
- export declare class SectionBreakpoint extends ElementWithContexMenu {
17
+ import { ElementWithContextMenu } from '../../../ElementWithContextMenu';
18
+ export declare class SectionBreakpoint extends ElementWithContextMenu {
19
19
  }
@@ -18,7 +18,7 @@
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.SectionBreakpoint = void 0;
20
20
  const ElementWithContextMenu_1 = require("../../../ElementWithContextMenu");
21
- class SectionBreakpoint extends ElementWithContextMenu_1.ElementWithContexMenu {
21
+ class SectionBreakpoint extends ElementWithContextMenu_1.ElementWithContextMenu {
22
22
  }
23
23
  exports.SectionBreakpoint = SectionBreakpoint;
24
24
  //# sourceMappingURL=SectionBreakpoint.js.map
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { ElementWithContexMenu } from '../ElementWithContextMenu';
17
+ import { ElementWithContextMenu } from '../ElementWithContextMenu';
18
18
  import { AbstractElement } from '../AbstractElement';
19
19
  import { By, WebElement } from 'selenium-webdriver';
20
20
  /**
@@ -29,7 +29,7 @@ export declare enum NotificationType {
29
29
  /**
30
30
  * Abstract element representing a notification
31
31
  */
32
- export declare abstract class Notification extends ElementWithContexMenu {
32
+ export declare abstract class Notification extends ElementWithContextMenu {
33
33
  /**
34
34
  * Get the message of the notification
35
35
  * @returns Promise resolving to notification message
@@ -33,7 +33,7 @@ var NotificationType;
33
33
  /**
34
34
  * Abstract element representing a notification
35
35
  */
36
- class Notification extends ElementWithContextMenu_1.ElementWithContexMenu {
36
+ class Notification extends ElementWithContextMenu_1.ElementWithContextMenu {
37
37
  /**
38
38
  * Get the message of the notification
39
39
  * @returns Promise resolving to notification message
package/out/index.d.ts CHANGED
@@ -42,6 +42,8 @@ export * from './components/sidebar/tree/debug/DebugBreakpointSection';
42
42
  export * from './components/sidebar/tree/debug/BreakpointSectionItem';
43
43
  export * from './components/sidebar/tree/debug/DebugVariablesSection';
44
44
  export * from './components/sidebar/tree/debug/VariableSectionItem';
45
+ export * from './components/sidebar/tree/debug/CallStackItem';
46
+ export * from './components/sidebar/tree/debug/DebugCallStackSection';
45
47
  export * from './components/sidebar/extensions/ExtensionsViewSection';
46
48
  export * from './components/sidebar/extensions/ExtensionsViewItem';
47
49
  export { ScmView, ScmProvider, ScmChange } from './components/sidebar/scm/ScmView';
package/out/index.js CHANGED
@@ -61,6 +61,8 @@ __exportStar(require("./components/sidebar/tree/debug/DebugBreakpointSection"),
61
61
  __exportStar(require("./components/sidebar/tree/debug/BreakpointSectionItem"), exports);
62
62
  __exportStar(require("./components/sidebar/tree/debug/DebugVariablesSection"), exports);
63
63
  __exportStar(require("./components/sidebar/tree/debug/VariableSectionItem"), exports);
64
+ __exportStar(require("./components/sidebar/tree/debug/CallStackItem"), exports);
65
+ __exportStar(require("./components/sidebar/tree/debug/DebugCallStackSection"), exports);
64
66
  __exportStar(require("./components/sidebar/extensions/ExtensionsViewSection"), exports);
65
67
  __exportStar(require("./components/sidebar/extensions/ExtensionsViewItem"), exports);
66
68
  var ScmView_1 = require("./components/sidebar/scm/ScmView");
@@ -114,6 +114,7 @@ export interface Locators {
114
114
  actionContainer: By;
115
115
  actionItem: By;
116
116
  attribute: string;
117
+ dropdown: string;
117
118
  };
118
119
  Editor: {
119
120
  constructor: By;
@@ -336,6 +337,13 @@ export interface Locators {
336
337
  tooltip: WebElementFunction<WebElement, string>;
337
338
  };
338
339
  };
340
+ DebugCallStackSection: {
341
+ predicate: WebElementFunction<ViewSection, boolean>;
342
+ };
343
+ CallStackItem: {
344
+ label: By;
345
+ text: By;
346
+ };
339
347
  ExtensionsViewSection: {
340
348
  items: By;
341
349
  itemRow: By;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redhat-developer/page-objects",
3
- "version": "1.1.3",
3
+ "version": "1.3.0",
4
4
  "description": "Page Object API implementation for a VS Code editor used by ExTester framework.",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",
@@ -39,12 +39,12 @@
39
39
  "dependencies": {
40
40
  "clipboardy": "^4.0.0",
41
41
  "clone-deep": "^4.0.1",
42
- "compare-versions": "^6.1.0",
42
+ "compare-versions": "^6.1.1",
43
43
  "fs-extra": "^11.2.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "selenium-webdriver": ">=4.6.1",
47
47
  "typescript": ">=4.6.2"
48
48
  },
49
- "gitHead": "d60b9bb6451e776a9ceefbaee32d9becdee5430d"
49
+ "gitHead": "7f9bdbf22d797c53c7d8375b7222e66308dbc180"
50
50
  }