@redhat-developer/page-objects 1.0.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 (127) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +5 -0
  3. package/out/components/AbstractElement.d.ts +35 -0
  4. package/out/components/AbstractElement.js +69 -0
  5. package/out/components/ElementWithContextMenu.d.ts +11 -0
  6. package/out/components/ElementWithContextMenu.js +38 -0
  7. package/out/components/WebviewMixin.d.ts +29 -0
  8. package/out/components/WebviewMixin.js +70 -0
  9. package/out/components/activityBar/ActionsControl.d.ts +18 -0
  10. package/out/components/activityBar/ActionsControl.js +27 -0
  11. package/out/components/activityBar/ActivityBar.d.ts +30 -0
  12. package/out/components/activityBar/ActivityBar.js +71 -0
  13. package/out/components/activityBar/ViewControl.d.ts +23 -0
  14. package/out/components/activityBar/ViewControl.js +56 -0
  15. package/out/components/bottomBar/AbstractViews.d.ts +38 -0
  16. package/out/components/bottomBar/AbstractViews.js +88 -0
  17. package/out/components/bottomBar/BottomBarPanel.d.ts +47 -0
  18. package/out/components/bottomBar/BottomBarPanel.js +123 -0
  19. package/out/components/bottomBar/ProblemsView.d.ts +88 -0
  20. package/out/components/bottomBar/ProblemsView.js +149 -0
  21. package/out/components/bottomBar/Views.d.ts +75 -0
  22. package/out/components/bottomBar/Views.js +195 -0
  23. package/out/components/bottomBar/WebviewView.d.ts +12 -0
  24. package/out/components/bottomBar/WebviewView.js +21 -0
  25. package/out/components/dialog/ModalDialog.d.ts +32 -0
  26. package/out/components/dialog/ModalDialog.js +56 -0
  27. package/out/components/editor/Breakpoint.d.ts +18 -0
  28. package/out/components/editor/Breakpoint.js +38 -0
  29. package/out/components/editor/ContentAssist.d.ts +34 -0
  30. package/out/components/editor/ContentAssist.js +94 -0
  31. package/out/components/editor/CustomEditor.d.ts +26 -0
  32. package/out/components/editor/CustomEditor.js +45 -0
  33. package/out/components/editor/DiffEditor.d.ts +19 -0
  34. package/out/components/editor/DiffEditor.js +31 -0
  35. package/out/components/editor/Editor.d.ts +17 -0
  36. package/out/components/editor/Editor.js +29 -0
  37. package/out/components/editor/EditorAction.d.ts +10 -0
  38. package/out/components/editor/EditorAction.js +17 -0
  39. package/out/components/editor/EditorView.d.ts +153 -0
  40. package/out/components/editor/EditorView.js +350 -0
  41. package/out/components/editor/SettingsEditor.d.ts +121 -0
  42. package/out/components/editor/SettingsEditor.js +278 -0
  43. package/out/components/editor/TextEditor.d.ts +265 -0
  44. package/out/components/editor/TextEditor.js +707 -0
  45. package/out/components/editor/WebView.d.ts +11 -0
  46. package/out/components/editor/WebView.js +38 -0
  47. package/out/components/menu/ContextMenu.d.ts +37 -0
  48. package/out/components/menu/ContextMenu.js +123 -0
  49. package/out/components/menu/MacTitleBar.d.ts +16 -0
  50. package/out/components/menu/MacTitleBar.js +41 -0
  51. package/out/components/menu/Menu.d.ts +38 -0
  52. package/out/components/menu/Menu.js +53 -0
  53. package/out/components/menu/MenuItem.d.ts +24 -0
  54. package/out/components/menu/MenuItem.js +36 -0
  55. package/out/components/menu/TitleBar.d.ts +36 -0
  56. package/out/components/menu/TitleBar.js +78 -0
  57. package/out/components/menu/WindowControls.d.ts +28 -0
  58. package/out/components/menu/WindowControls.js +59 -0
  59. package/out/components/sidebar/SideBarView.d.ts +18 -0
  60. package/out/components/sidebar/SideBarView.js +29 -0
  61. package/out/components/sidebar/ViewContent.d.ts +57 -0
  62. package/out/components/sidebar/ViewContent.js +76 -0
  63. package/out/components/sidebar/ViewItem.d.ts +97 -0
  64. package/out/components/sidebar/ViewItem.js +192 -0
  65. package/out/components/sidebar/ViewSection.d.ts +98 -0
  66. package/out/components/sidebar/ViewSection.js +164 -0
  67. package/out/components/sidebar/ViewTitlePart.d.ts +35 -0
  68. package/out/components/sidebar/ViewTitlePart.js +59 -0
  69. package/out/components/sidebar/WelcomeContent.d.ts +47 -0
  70. package/out/components/sidebar/WelcomeContent.js +72 -0
  71. package/out/components/sidebar/debug/DebugView.d.ts +33 -0
  72. package/out/components/sidebar/debug/DebugView.js +70 -0
  73. package/out/components/sidebar/extensions/ExtensionsViewItem.d.ts +48 -0
  74. package/out/components/sidebar/extensions/ExtensionsViewItem.js +93 -0
  75. package/out/components/sidebar/extensions/ExtensionsViewSection.d.ts +33 -0
  76. package/out/components/sidebar/extensions/ExtensionsViewSection.js +117 -0
  77. package/out/components/sidebar/scm/NewScmView.d.ts +34 -0
  78. package/out/components/sidebar/scm/NewScmView.js +155 -0
  79. package/out/components/sidebar/scm/ScmView.d.ts +110 -0
  80. package/out/components/sidebar/scm/ScmView.js +275 -0
  81. package/out/components/sidebar/tree/TreeSection.d.ts +14 -0
  82. package/out/components/sidebar/tree/TreeSection.js +55 -0
  83. package/out/components/sidebar/tree/custom/CustomTreeItem.d.ts +15 -0
  84. package/out/components/sidebar/tree/custom/CustomTreeItem.js +36 -0
  85. package/out/components/sidebar/tree/custom/CustomTreeSection.d.ts +26 -0
  86. package/out/components/sidebar/tree/custom/CustomTreeSection.js +66 -0
  87. package/out/components/sidebar/tree/debug/BreakpointSectionItem.d.ts +33 -0
  88. package/out/components/sidebar/tree/debug/BreakpointSectionItem.js +63 -0
  89. package/out/components/sidebar/tree/debug/DebugBreakpointSection.d.ts +7 -0
  90. package/out/components/sidebar/tree/debug/DebugBreakpointSection.js +12 -0
  91. package/out/components/sidebar/tree/debug/DebugVariablesSection.d.ts +7 -0
  92. package/out/components/sidebar/tree/debug/DebugVariablesSection.js +12 -0
  93. package/out/components/sidebar/tree/debug/SectionBreakpoint.d.ts +3 -0
  94. package/out/components/sidebar/tree/debug/SectionBreakpoint.js +8 -0
  95. package/out/components/sidebar/tree/debug/VariableSectionItem.d.ts +33 -0
  96. package/out/components/sidebar/tree/debug/VariableSectionItem.js +60 -0
  97. package/out/components/sidebar/tree/default/DefaultTreeItem.d.ts +14 -0
  98. package/out/components/sidebar/tree/default/DefaultTreeItem.js +39 -0
  99. package/out/components/sidebar/tree/default/DefaultTreeSection.d.ts +9 -0
  100. package/out/components/sidebar/tree/default/DefaultTreeSection.js +44 -0
  101. package/out/components/statusBar/StatusBar.d.ts +96 -0
  102. package/out/components/statusBar/StatusBar.js +159 -0
  103. package/out/components/workbench/DebugToolbar.d.ts +52 -0
  104. package/out/components/workbench/DebugToolbar.js +93 -0
  105. package/out/components/workbench/Notification.d.ts +78 -0
  106. package/out/components/workbench/Notification.js +134 -0
  107. package/out/components/workbench/NotificationsCenter.d.ts +27 -0
  108. package/out/components/workbench/NotificationsCenter.js +57 -0
  109. package/out/components/workbench/Workbench.d.ts +69 -0
  110. package/out/components/workbench/Workbench.js +135 -0
  111. package/out/components/workbench/input/Input.d.ts +107 -0
  112. package/out/components/workbench/input/Input.js +249 -0
  113. package/out/components/workbench/input/InputBox.d.ts +30 -0
  114. package/out/components/workbench/input/InputBox.js +75 -0
  115. package/out/components/workbench/input/QuickOpenBox.d.ts +15 -0
  116. package/out/components/workbench/input/QuickOpenBox.js +41 -0
  117. package/out/conditions/WaitForAttribute.d.ts +8 -0
  118. package/out/conditions/WaitForAttribute.js +17 -0
  119. package/out/errors/NullAttributeError.d.ts +3 -0
  120. package/out/errors/NullAttributeError.js +11 -0
  121. package/out/index.d.ts +67 -0
  122. package/out/index.js +95 -0
  123. package/out/locators/loader.d.ts +20 -0
  124. package/out/locators/loader.js +108 -0
  125. package/out/locators/locators.d.ts +463 -0
  126. package/out/locators/locators.js +52 -0
  127. package/package.json +48 -0
@@ -0,0 +1,26 @@
1
+ import { TreeSection } from "../TreeSection";
2
+ import { TreeItem } from "../../ViewItem";
3
+ import { WebElement } from "selenium-webdriver";
4
+ import { CustomTreeItem, ViewContent } from "../../../..";
5
+ export type GenericCustomTreeItemConstructor<T extends TreeItem> = {
6
+ new (rootElement: WebElement, tree: TreeSection): T;
7
+ };
8
+ /**
9
+ * Generic custom tree view, e.g. contributed by an extension
10
+ */
11
+ export declare class GenericCustomTreeSection<T extends TreeItem> extends TreeSection {
12
+ private _viewContent;
13
+ private _itemConstructor;
14
+ constructor(panel: WebElement, _viewContent: ViewContent, itemConstructor: GenericCustomTreeItemConstructor<T>);
15
+ private get viewContent();
16
+ private get itemConstructor();
17
+ getVisibleItems(): Promise<T[]>;
18
+ findItem(labelOrPredicate: string | ((el: T) => (PromiseLike<boolean> | boolean)), maxLevel?: number): Promise<T | undefined>;
19
+ private getContainer;
20
+ }
21
+ /**
22
+ * Custom tree view, e.g. contributed by an extension
23
+ */
24
+ export declare class CustomTreeSection extends GenericCustomTreeSection<CustomTreeItem> {
25
+ constructor(panel: WebElement, viewContent: ViewContent);
26
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomTreeSection = exports.GenericCustomTreeSection = void 0;
4
+ const TreeSection_1 = require("../TreeSection");
5
+ const selenium_webdriver_1 = require("selenium-webdriver");
6
+ const __1 = require("../../../..");
7
+ /**
8
+ * Generic custom tree view, e.g. contributed by an extension
9
+ */
10
+ class GenericCustomTreeSection extends TreeSection_1.TreeSection {
11
+ _viewContent;
12
+ _itemConstructor;
13
+ constructor(panel, _viewContent, itemConstructor) {
14
+ super(panel, _viewContent);
15
+ this._viewContent = _viewContent;
16
+ this._itemConstructor = itemConstructor;
17
+ }
18
+ get viewContent() {
19
+ return this._viewContent;
20
+ }
21
+ get itemConstructor() {
22
+ return this._itemConstructor;
23
+ }
24
+ async getVisibleItems() {
25
+ const items = [];
26
+ const container = await this.getContainer();
27
+ const elements = await container.findElements(CustomTreeSection.locators.CustomTreeSection.itemRow);
28
+ for (const element of elements) {
29
+ if (await element.isDisplayed()) {
30
+ items.push(new this.itemConstructor(element, this));
31
+ }
32
+ }
33
+ return items;
34
+ }
35
+ async findItem(labelOrPredicate, maxLevel = 0) {
36
+ const predicate = typeof labelOrPredicate === 'string' ? (async (el) => await el.getLabel() === labelOrPredicate) : (labelOrPredicate);
37
+ const elements = await this.getVisibleItems();
38
+ for (const element of elements) {
39
+ if (await predicate(element)) {
40
+ const level = +await element.getAttribute(CustomTreeSection.locators.ViewSection.level);
41
+ if (maxLevel < 1 || level <= maxLevel) {
42
+ return element;
43
+ }
44
+ }
45
+ }
46
+ return undefined;
47
+ }
48
+ async getContainer() {
49
+ await this.expand();
50
+ await this.getDriver().wait(selenium_webdriver_1.until.elementLocated(CustomTreeSection.locators.CustomTreeSection.rowContainer), 5000);
51
+ const container = await this.findElement(CustomTreeSection.locators.CustomTreeSection.rowContainer);
52
+ await container.sendKeys(selenium_webdriver_1.Key.HOME);
53
+ return new GenericCustomTreeSection(container, this.viewContent, this.itemConstructor);
54
+ }
55
+ }
56
+ exports.GenericCustomTreeSection = GenericCustomTreeSection;
57
+ /**
58
+ * Custom tree view, e.g. contributed by an extension
59
+ */
60
+ class CustomTreeSection extends GenericCustomTreeSection {
61
+ constructor(panel, viewContent) {
62
+ super(panel, viewContent, __1.CustomTreeItem);
63
+ }
64
+ }
65
+ exports.CustomTreeSection = CustomTreeSection;
66
+ //# sourceMappingURL=CustomTreeSection.js.map
@@ -0,0 +1,33 @@
1
+ import { WebElement } from "selenium-webdriver";
2
+ import { TreeSection } from "../TreeSection";
3
+ import { CustomTreeItem } from "../custom/CustomTreeItem";
4
+ import { SectionBreakpoint } from "./SectionBreakpoint";
5
+ export declare class BreakpointSectionItem extends CustomTreeItem {
6
+ constructor(element: WebElement, viewPart: TreeSection);
7
+ /**
8
+ * Get breakpoint element which has context menu.
9
+ * @returns SectionBreakpoint page object
10
+ */
11
+ getBreakpoint(): Promise<SectionBreakpoint>;
12
+ /**
13
+ * Get status of the breakpoint.
14
+ * @returns boolean indicating status
15
+ */
16
+ isBreakpointEnabled(): Promise<boolean>;
17
+ /**
18
+ * Change breakpoint status to desired state.
19
+ * @param value new state
20
+ */
21
+ setBreakpointEnabled(value: boolean): Promise<void>;
22
+ getLabel(): Promise<string>;
23
+ /**
24
+ * Get breakpoint file path. Empty string is returned if path is not specified.
25
+ * @returns file path of breakpoint or empty string
26
+ */
27
+ getBreakpointFilePath(): Promise<string>;
28
+ /**
29
+ * Get line number of the breakpoint.
30
+ * @returns number indicating line position in file
31
+ */
32
+ getBreakpointLine(): Promise<number>;
33
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BreakpointSectionItem = void 0;
4
+ const CustomTreeItem_1 = require("../custom/CustomTreeItem");
5
+ const SectionBreakpoint_1 = require("./SectionBreakpoint");
6
+ class BreakpointSectionItem extends CustomTreeItem_1.CustomTreeItem {
7
+ constructor(element, viewPart) {
8
+ super(element, viewPart);
9
+ }
10
+ /**
11
+ * Get breakpoint element which has context menu.
12
+ * @returns SectionBreakpoint page object
13
+ */
14
+ async getBreakpoint() {
15
+ return new SectionBreakpoint_1.SectionBreakpoint(BreakpointSectionItem.locators.BreakpointSectionItem.breakpoint.constructor, this);
16
+ }
17
+ /**
18
+ * Get status of the breakpoint.
19
+ * @returns boolean indicating status
20
+ */
21
+ async isBreakpointEnabled() {
22
+ const locator = BreakpointSectionItem.locators.BreakpointSectionItem.breakpointCheckbox;
23
+ const el = await this.findElement(locator.constructor);
24
+ return await locator.value(el);
25
+ }
26
+ /**
27
+ * Change breakpoint status to desired state.
28
+ * @param value new state
29
+ */
30
+ async setBreakpointEnabled(value) {
31
+ if (await this.isBreakpointEnabled() === value) {
32
+ return;
33
+ }
34
+ const locator = BreakpointSectionItem.locators.BreakpointSectionItem.breakpointCheckbox;
35
+ const el = await this.findElement(locator.constructor);
36
+ await el.click();
37
+ }
38
+ async getLabel() {
39
+ const locator = BreakpointSectionItem.locators.BreakpointSectionItem.label;
40
+ const el = await this.findElement(locator.constructor);
41
+ return await locator.value(el);
42
+ }
43
+ /**
44
+ * Get breakpoint file path. Empty string is returned if path is not specified.
45
+ * @returns file path of breakpoint or empty string
46
+ */
47
+ async getBreakpointFilePath() {
48
+ const locator = BreakpointSectionItem.locators.BreakpointSectionItem.filePath;
49
+ const el = await this.findElement(locator.constructor);
50
+ return await locator.value(el);
51
+ }
52
+ /**
53
+ * Get line number of the breakpoint.
54
+ * @returns number indicating line position in file
55
+ */
56
+ async getBreakpointLine() {
57
+ const locator = BreakpointSectionItem.locators.BreakpointSectionItem.lineNumber;
58
+ const el = await this.findElement(locator.constructor);
59
+ return Number.parseInt(await locator.value(el));
60
+ }
61
+ }
62
+ exports.BreakpointSectionItem = BreakpointSectionItem;
63
+ //# sourceMappingURL=BreakpointSectionItem.js.map
@@ -0,0 +1,7 @@
1
+ import { WebElement } from "selenium-webdriver";
2
+ import { ViewContent } from "../../ViewContent";
3
+ import { GenericCustomTreeSection } from "../custom/CustomTreeSection";
4
+ import { BreakpointSectionItem } from "./BreakpointSectionItem";
5
+ export declare class DebugBreakpointSection extends GenericCustomTreeSection<BreakpointSectionItem> {
6
+ constructor(panel: WebElement, viewContent: ViewContent);
7
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DebugBreakpointSection = void 0;
4
+ const CustomTreeSection_1 = require("../custom/CustomTreeSection");
5
+ const BreakpointSectionItem_1 = require("./BreakpointSectionItem");
6
+ class DebugBreakpointSection extends CustomTreeSection_1.GenericCustomTreeSection {
7
+ constructor(panel, viewContent) {
8
+ super(panel, viewContent, BreakpointSectionItem_1.BreakpointSectionItem);
9
+ }
10
+ }
11
+ exports.DebugBreakpointSection = DebugBreakpointSection;
12
+ //# sourceMappingURL=DebugBreakpointSection.js.map
@@ -0,0 +1,7 @@
1
+ import { WebElement } from "selenium-webdriver";
2
+ import { ViewContent } from "../../ViewContent";
3
+ import { GenericCustomTreeSection } from "../custom/CustomTreeSection";
4
+ import { VariableSectionItem } from "./VariableSectionItem";
5
+ export declare class DebugVariableSection extends GenericCustomTreeSection<VariableSectionItem> {
6
+ constructor(panel: WebElement, viewContent: ViewContent);
7
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DebugVariableSection = void 0;
4
+ const CustomTreeSection_1 = require("../custom/CustomTreeSection");
5
+ const VariableSectionItem_1 = require("./VariableSectionItem");
6
+ class DebugVariableSection extends CustomTreeSection_1.GenericCustomTreeSection {
7
+ constructor(panel, viewContent) {
8
+ super(panel, viewContent, VariableSectionItem_1.VariableSectionItem);
9
+ }
10
+ }
11
+ exports.DebugVariableSection = DebugVariableSection;
12
+ //# sourceMappingURL=DebugVariablesSection.js.map
@@ -0,0 +1,3 @@
1
+ import { ElementWithContexMenu } from "../../../ElementWithContextMenu";
2
+ export declare class SectionBreakpoint extends ElementWithContexMenu {
3
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SectionBreakpoint = void 0;
4
+ const ElementWithContextMenu_1 = require("../../../ElementWithContextMenu");
5
+ class SectionBreakpoint extends ElementWithContextMenu_1.ElementWithContexMenu {
6
+ }
7
+ exports.SectionBreakpoint = SectionBreakpoint;
8
+ //# sourceMappingURL=SectionBreakpoint.js.map
@@ -0,0 +1,33 @@
1
+ import { WebElement } from "selenium-webdriver";
2
+ import { TreeSection } from "../TreeSection";
3
+ import { CustomTreeItem } from "../custom/CustomTreeItem";
4
+ export declare class VariableSectionItem extends CustomTreeItem {
5
+ constructor(element: WebElement, viewPart: TreeSection);
6
+ /**
7
+ * Get name of the variable.
8
+ * @returns a promise resolving to variable name string
9
+ */
10
+ getVariableName(): Promise<string>;
11
+ /**
12
+ * Get value of the variable.
13
+ * @returns a promise resolving to value string of the variable
14
+ */
15
+ getVariableValue(): Promise<string>;
16
+ /**
17
+ * Get variable name tooltip.
18
+ * @returns a promise resolving to variable name tooltip string
19
+ */
20
+ getVariableNameTooltip(): Promise<string>;
21
+ /**
22
+ * Get variable value tooltip.
23
+ * @returns a promise resolving to variable value tooltip string
24
+ */
25
+ getVariableValueTooltip(): Promise<string>;
26
+ getLabel(): Promise<string>;
27
+ getTooltip(): Promise<string>;
28
+ /**
29
+ * Assign new value to the variable.
30
+ * @param value new value
31
+ */
32
+ setVariableValue(value: string): Promise<void>;
33
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VariableSectionItem = void 0;
4
+ const selenium_webdriver_1 = require("selenium-webdriver");
5
+ const CustomTreeItem_1 = require("../custom/CustomTreeItem");
6
+ class VariableSectionItem extends CustomTreeItem_1.CustomTreeItem {
7
+ constructor(element, viewPart) {
8
+ super(element, viewPart);
9
+ }
10
+ /**
11
+ * Get name of the variable.
12
+ * @returns a promise resolving to variable name string
13
+ */
14
+ async getVariableName() {
15
+ const name = await this.findElement(VariableSectionItem.locators.VariableSectionItem.name.constructor);
16
+ return VariableSectionItem.locators.VariableSectionItem.name.value(name);
17
+ }
18
+ /**
19
+ * Get value of the variable.
20
+ * @returns a promise resolving to value string of the variable
21
+ */
22
+ async getVariableValue() {
23
+ const value = await this.findElement(VariableSectionItem.locators.VariableSectionItem.value.constructor);
24
+ return VariableSectionItem.locators.VariableSectionItem.value.value(value);
25
+ }
26
+ /**
27
+ * Get variable name tooltip.
28
+ * @returns a promise resolving to variable name tooltip string
29
+ */
30
+ async getVariableNameTooltip() {
31
+ const name = await this.findElement(VariableSectionItem.locators.VariableSectionItem.name.constructor);
32
+ return VariableSectionItem.locators.VariableSectionItem.name.tooltip(name);
33
+ }
34
+ /**
35
+ * Get variable value tooltip.
36
+ * @returns a promise resolving to variable value tooltip string
37
+ */
38
+ async getVariableValueTooltip() {
39
+ const value = await this.findElement(VariableSectionItem.locators.VariableSectionItem.value.constructor);
40
+ return VariableSectionItem.locators.VariableSectionItem.value.tooltip(value);
41
+ }
42
+ async getLabel() {
43
+ return VariableSectionItem.locators.VariableSectionItem.label(this);
44
+ }
45
+ getTooltip() {
46
+ throw new Error('unsupported: use either getVariableNameTooltip or getVariableValueTooltip');
47
+ }
48
+ /**
49
+ * Assign new value to the variable.
50
+ * @param value new value
51
+ */
52
+ async setVariableValue(value) {
53
+ const valueRootElement = await this.findElement(VariableSectionItem.locators.VariableSectionItem.value.constructor);
54
+ const driver = this.getDriver();
55
+ await driver.actions().clear();
56
+ await driver.actions().doubleClick(valueRootElement).sendKeys(value, selenium_webdriver_1.Key.ENTER).perform();
57
+ }
58
+ }
59
+ exports.VariableSectionItem = VariableSectionItem;
60
+ //# sourceMappingURL=VariableSectionItem.js.map
@@ -0,0 +1,14 @@
1
+ import { TreeItem } from "../../ViewItem";
2
+ import { TreeSection } from "../TreeSection";
3
+ import { WebElement } from "selenium-webdriver";
4
+ /**
5
+ * Default tree item base on the items in explorer view
6
+ */
7
+ export declare class DefaultTreeItem extends TreeItem {
8
+ constructor(element: WebElement, viewPart: TreeSection);
9
+ getLabel(): Promise<string>;
10
+ getTooltip(): Promise<string>;
11
+ isExpanded(): Promise<boolean>;
12
+ getChildren(): Promise<TreeItem[]>;
13
+ isExpandable(): Promise<boolean>;
14
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultTreeItem = void 0;
4
+ const ViewItem_1 = require("../../ViewItem");
5
+ const NullAttributeError_1 = require("../../../../errors/NullAttributeError");
6
+ /**
7
+ * Default tree item base on the items in explorer view
8
+ */
9
+ class DefaultTreeItem extends ViewItem_1.TreeItem {
10
+ constructor(element, viewPart) {
11
+ super(element, viewPart);
12
+ }
13
+ async getLabel() {
14
+ const value = await this.getAttribute(DefaultTreeItem.locators.DefaultTreeSection.itemLabel);
15
+ if (value === null) {
16
+ throw new NullAttributeError_1.NullAttributeError(`${this.constructor.name}.getLabel returned null`);
17
+ }
18
+ return value;
19
+ }
20
+ async getTooltip() {
21
+ const tooltip = await this.findElement(DefaultTreeItem.locators.DefaultTreeItem.tooltip);
22
+ return await tooltip.getAttribute(DefaultTreeItem.locators.DefaultTreeItem.labelAttribute);
23
+ }
24
+ async isExpanded() {
25
+ const twistieClass = await this.findElement(DefaultTreeItem.locators.DefaultTreeItem.twistie).getAttribute('class');
26
+ return twistieClass.indexOf('collapsed') < 0;
27
+ }
28
+ async getChildren() {
29
+ const rows = await this.getChildItems(DefaultTreeItem.locators.DefaultTreeSection.itemRow);
30
+ const items = await Promise.all(rows.map(async (row) => new DefaultTreeItem(row, this.enclosingItem).wait()));
31
+ return items;
32
+ }
33
+ async isExpandable() {
34
+ const twistieClass = await this.findElement(DefaultTreeItem.locators.DefaultTreeItem.twistie).getAttribute('class');
35
+ return twistieClass.indexOf('collapsible') > -1;
36
+ }
37
+ }
38
+ exports.DefaultTreeItem = DefaultTreeItem;
39
+ //# sourceMappingURL=DefaultTreeItem.js.map
@@ -0,0 +1,9 @@
1
+ import { TreeSection } from "../TreeSection";
2
+ import { TreeItem } from "../../../..";
3
+ /**
4
+ * Default view section
5
+ */
6
+ export declare class DefaultTreeSection extends TreeSection {
7
+ getVisibleItems(): Promise<TreeItem[]>;
8
+ findItem(label: string, maxLevel?: number): Promise<TreeItem | undefined>;
9
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultTreeSection = void 0;
4
+ const TreeSection_1 = require("../TreeSection");
5
+ const selenium_webdriver_1 = require("selenium-webdriver");
6
+ const DefaultTreeItem_1 = require("./DefaultTreeItem");
7
+ /**
8
+ * Default view section
9
+ */
10
+ class DefaultTreeSection extends TreeSection_1.TreeSection {
11
+ async getVisibleItems() {
12
+ const items = [];
13
+ const elements = await this.findElements(DefaultTreeSection.locators.DefaultTreeSection.itemRow);
14
+ for (const element of elements) {
15
+ items.push(await new DefaultTreeItem_1.DefaultTreeItem(element, this).wait());
16
+ }
17
+ return items;
18
+ }
19
+ async findItem(label, maxLevel = 0) {
20
+ await this.expand();
21
+ const container = await this.findElement(DefaultTreeSection.locators.DefaultTreeSection.rowContainer);
22
+ await container.sendKeys(selenium_webdriver_1.Key.HOME);
23
+ let item = undefined;
24
+ do {
25
+ const temp = await container.findElements(DefaultTreeSection.locators.DefaultTreeItem.ctor(label));
26
+ if (temp.length > 0) {
27
+ const level = +await temp[0].getAttribute(DefaultTreeSection.locators.ViewSection.level);
28
+ if (maxLevel < 1 || level <= maxLevel) {
29
+ item = await new DefaultTreeItem_1.DefaultTreeItem(temp[0], this).wait();
30
+ }
31
+ }
32
+ if (!item) {
33
+ const lastrow = await container.findElements(DefaultTreeSection.locators.DefaultTreeSection.lastRow);
34
+ if (lastrow.length > 0) {
35
+ break;
36
+ }
37
+ await container.sendKeys(selenium_webdriver_1.Key.PAGE_DOWN);
38
+ }
39
+ } while (!item);
40
+ return item;
41
+ }
42
+ }
43
+ exports.DefaultTreeSection = DefaultTreeSection;
44
+ //# sourceMappingURL=DefaultTreeSection.js.map
@@ -0,0 +1,96 @@
1
+ import { WebElement } from "selenium-webdriver";
2
+ import { AbstractElement } from "../AbstractElement";
3
+ import { NotificationsCenter } from "../workbench/NotificationsCenter";
4
+ /**
5
+ * Page object for the status bar at the bottom
6
+ */
7
+ export declare class StatusBar extends AbstractElement {
8
+ constructor();
9
+ /**
10
+ * Retrieve all status bar items currently displayed
11
+ * @returns Promise resolving to an array of WebElement
12
+ */
13
+ getItems(): Promise<WebElement[]>;
14
+ /**
15
+ * Find status bar item by title/visible label
16
+ * @param title title of the item
17
+ * @returns Promise resolving to a WebElement if item is found, to undefined otherwise
18
+ */
19
+ getItem(title: string): Promise<WebElement | undefined>;
20
+ /**
21
+ * Open the notifications center
22
+ * @returns Promise resolving to NotificationsCenter object
23
+ */
24
+ openNotificationsCenter(): Promise<NotificationsCenter>;
25
+ /**
26
+ * Close the notifications center
27
+ * @returns Promise resolving when the notifications center is closed
28
+ */
29
+ closeNotificationsCenter(): Promise<void>;
30
+ /**
31
+ * Open the language selection quick pick
32
+ * Only works with an open editor
33
+ * @returns Promise resolving when the language selection is opened
34
+ */
35
+ openLanguageSelection(): Promise<void>;
36
+ /**
37
+ * Get the current language label text
38
+ * Only works with an open editor
39
+ * @returns Promise resolving to string representation of current language
40
+ */
41
+ getCurrentLanguage(): Promise<string>;
42
+ /**
43
+ * Open the quick pick for line endings selection
44
+ * Only works with an open editor
45
+ * @returns Promise resolving when the line ending selection is opened
46
+ */
47
+ openLineEndingSelection(): Promise<void>;
48
+ /**
49
+ * Get the currently selected line ending as text
50
+ * Only works with an open editor
51
+ * @returns Promise resolving to string representation of current line ending
52
+ */
53
+ getCurrentLineEnding(): Promise<string>;
54
+ /**
55
+ * Open the encoding selection quick pick
56
+ * Only works with an open editor
57
+ * @returns Promise resolving when the encoding selection is opened
58
+ */
59
+ openEncodingSelection(): Promise<void>;
60
+ /**
61
+ * Get the name of the current encoding as text
62
+ * Only works with an open editor
63
+ * @returns Promise resolving to string representation of current encoding
64
+ */
65
+ getCurrentEncoding(): Promise<string>;
66
+ /**
67
+ * Open the indentation selection quick pick
68
+ * Only works with an open editor
69
+ * @returns Promise resolving when the indentation selection is opened
70
+ */
71
+ openIndentationSelection(): Promise<void>;
72
+ /**
73
+ * Get the current indentation option label as text
74
+ * Only works with an open editor
75
+ * @returns Promise resolving to string representation of current indentation
76
+ */
77
+ getCurrentIndentation(): Promise<string>;
78
+ /**
79
+ * Open the line selection input box
80
+ * Only works with an open editor
81
+ * @returns Promise resolving when the line selection is opened
82
+ */
83
+ openLineSelection(): Promise<void>;
84
+ /**
85
+ * Get the current editor coordinates as text
86
+ * Only works with an open editor
87
+ * @returns Promise resolving to string representation of current position in the editor
88
+ */
89
+ getCurrentPosition(): Promise<string>;
90
+ /**
91
+ * Open/Close notification centre
92
+ * @param open true to open, false to close
93
+ */
94
+ private toggleNotificationsCentre;
95
+ private getPartText;
96
+ }