@redhat-developer/page-objects 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/components/AbstractElement.d.ts +2 -2
- package/out/components/AbstractElement.js +2 -2
- package/out/components/ElementWithContextMenu.d.ts +2 -2
- package/out/components/WebviewMixin.d.ts +2 -2
- package/out/components/activityBar/ActionsControl.d.ts +3 -3
- package/out/components/activityBar/ActivityBar.d.ts +2 -2
- package/out/components/activityBar/ViewControl.d.ts +3 -3
- package/out/components/bottomBar/AbstractViews.d.ts +4 -4
- package/out/components/bottomBar/AbstractViews.js +8 -7
- package/out/components/bottomBar/BottomBarPanel.d.ts +2 -2
- package/out/components/bottomBar/BottomBarPanel.js +2 -3
- package/out/components/bottomBar/ProblemsView.d.ts +3 -3
- package/out/components/bottomBar/ProblemsView.js +7 -5
- package/out/components/bottomBar/Views.d.ts +3 -3
- package/out/components/bottomBar/Views.js +1 -1
- package/out/components/bottomBar/WebviewView.d.ts +2 -2
- package/out/components/dialog/ModalDialog.d.ts +2 -2
- package/out/components/dialog/ModalDialog.js +1 -1
- package/out/components/editor/ContentAssist.d.ts +1 -1
- package/out/components/editor/ContentAssist.js +6 -5
- package/out/components/editor/CustomEditor.d.ts +1 -1
- package/out/components/editor/Editor.d.ts +2 -2
- package/out/components/editor/Editor.js +1 -1
- package/out/components/editor/EditorAction.d.ts +3 -3
- package/out/components/editor/EditorView.d.ts +5 -5
- package/out/components/editor/EditorView.js +12 -7
- package/out/components/editor/SettingsEditor.d.ts +11 -11
- package/out/components/editor/SettingsEditor.js +20 -19
- package/out/components/editor/TextEditor.d.ts +6 -6
- package/out/components/editor/TextEditor.js +15 -13
- package/out/components/editor/WebView.d.ts +2 -2
- package/out/components/editor/WebView.js +2 -2
- package/out/components/menu/ContextMenu.d.ts +2 -2
- package/out/components/menu/ContextMenu.js +2 -2
- package/out/components/menu/MacTitleBar.js +1 -5
- package/out/components/menu/Menu.d.ts +2 -2
- package/out/components/menu/Menu.js +2 -2
- package/out/components/menu/MenuItem.d.ts +2 -2
- package/out/components/menu/MenuItem.js +1 -1
- package/out/components/menu/TitleBar.d.ts +3 -3
- package/out/components/menu/TitleBar.js +2 -2
- package/out/components/menu/WindowControls.d.ts +2 -2
- package/out/components/sidebar/SideBarView.d.ts +2 -2
- package/out/components/sidebar/ViewContent.d.ts +4 -4
- package/out/components/sidebar/ViewContent.js +1 -2
- package/out/components/sidebar/ViewItem.d.ts +3 -3
- package/out/components/sidebar/ViewItem.js +7 -7
- package/out/components/sidebar/ViewSection.d.ts +3 -3
- package/out/components/sidebar/ViewSection.js +7 -7
- package/out/components/sidebar/ViewTitlePart.d.ts +3 -3
- package/out/components/sidebar/WelcomeContent.d.ts +3 -3
- package/out/components/sidebar/WelcomeContent.js +1 -1
- package/out/components/sidebar/debug/DebugView.d.ts +3 -3
- package/out/components/sidebar/extensions/ExtensionsViewItem.d.ts +4 -4
- package/out/components/sidebar/extensions/ExtensionsViewSection.d.ts +2 -2
- package/out/components/sidebar/extensions/ExtensionsViewSection.js +3 -3
- package/out/components/sidebar/scm/NewScmView.d.ts +2 -2
- package/out/components/sidebar/scm/NewScmView.js +14 -14
- package/out/components/sidebar/scm/ScmView.d.ts +5 -5
- package/out/components/sidebar/scm/ScmView.js +8 -8
- package/out/components/sidebar/tree/TreeSection.d.ts +3 -3
- package/out/components/sidebar/tree/TreeSection.js +4 -4
- package/out/components/sidebar/tree/custom/CustomTreeItem.d.ts +3 -3
- package/out/components/sidebar/tree/custom/CustomTreeSection.d.ts +5 -5
- package/out/components/sidebar/tree/custom/CustomTreeSection.js +2 -2
- package/out/components/sidebar/tree/debug/BreakpointSectionItem.d.ts +4 -4
- package/out/components/sidebar/tree/debug/BreakpointSectionItem.js +1 -1
- package/out/components/sidebar/tree/debug/DebugBreakpointSection.d.ts +4 -4
- package/out/components/sidebar/tree/debug/DebugVariablesSection.d.ts +4 -4
- package/out/components/sidebar/tree/debug/SectionBreakpoint.d.ts +1 -1
- package/out/components/sidebar/tree/debug/VariableSectionItem.d.ts +3 -3
- package/out/components/sidebar/tree/default/DefaultTreeItem.d.ts +3 -3
- package/out/components/sidebar/tree/default/DefaultTreeSection.d.ts +2 -2
- package/out/components/sidebar/tree/default/DefaultTreeSection.js +1 -1
- package/out/components/statusBar/StatusBar.d.ts +3 -3
- package/out/components/statusBar/StatusBar.js +1 -1
- package/out/components/workbench/DebugToolbar.d.ts +1 -1
- package/out/components/workbench/Notification.d.ts +3 -3
- package/out/components/workbench/Notification.js +1 -2
- package/out/components/workbench/NotificationsCenter.d.ts +2 -2
- package/out/components/workbench/NotificationsCenter.js +1 -1
- package/out/components/workbench/Workbench.d.ts +12 -12
- package/out/components/workbench/Workbench.js +1 -1
- package/out/components/workbench/input/Input.d.ts +1 -1
- package/out/components/workbench/input/Input.js +13 -20
- package/out/components/workbench/input/InputBox.d.ts +1 -1
- package/out/components/workbench/input/InputBox.js +4 -5
- package/out/components/workbench/input/QuickOpenBox.d.ts +1 -1
- package/out/components/workbench/input/QuickOpenBox.js +2 -3
- package/out/conditions/WaitForAttribute.d.ts +1 -1
- package/out/locators/loader.js +8 -8
- package/out/locators/locators.d.ts +8 -8
- package/out/locators/locators.js +1 -1
- package/package.json +2 -2
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { WebElement, WebDriver, Locator } from
|
|
18
|
-
import { Locators } from
|
|
17
|
+
import { WebElement, WebDriver, Locator } from 'selenium-webdriver';
|
|
18
|
+
import { Locators } from '../locators/locators';
|
|
19
19
|
/**
|
|
20
20
|
* Default wrapper for webelement
|
|
21
21
|
*/
|
|
@@ -55,10 +55,10 @@ class AbstractElement extends selenium_webdriver_1.WebElement {
|
|
|
55
55
|
this.enclosingItem = item;
|
|
56
56
|
}
|
|
57
57
|
async isEnabled() {
|
|
58
|
-
return await super.isEnabled() && await AbstractElement.locators.AbstractElement.enabled(this);
|
|
58
|
+
return (await super.isEnabled()) && (await AbstractElement.locators.AbstractElement.enabled(this));
|
|
59
59
|
}
|
|
60
60
|
async isSelected() {
|
|
61
|
-
return await super.isSelected() && await AbstractElement.locators.AbstractElement.selected(this);
|
|
61
|
+
return (await super.isSelected()) && (await AbstractElement.locators.AbstractElement.selected(this));
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Wait for the element to become visible
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { AbstractElement } from
|
|
18
|
-
import { ContextMenu } from
|
|
17
|
+
import { AbstractElement } from './AbstractElement';
|
|
18
|
+
import { ContextMenu } from '..';
|
|
19
19
|
/**
|
|
20
20
|
* Abstract element that has a context menu
|
|
21
21
|
*/
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { Locator, WebElement } from
|
|
18
|
-
import { AbstractElement } from
|
|
17
|
+
import { Locator, WebElement } from 'selenium-webdriver';
|
|
18
|
+
import { AbstractElement } from './AbstractElement';
|
|
19
19
|
/**
|
|
20
20
|
* Heavily inspired by https://stackoverflow.com/a/65418734
|
|
21
21
|
*/
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { WebElement } from
|
|
18
|
-
import { ActivityBar, ContextMenu } from
|
|
19
|
-
import { ElementWithContexMenu } from
|
|
17
|
+
import { WebElement } from 'selenium-webdriver';
|
|
18
|
+
import { ActivityBar, ContextMenu } from '../..';
|
|
19
|
+
import { ElementWithContexMenu } from '../ElementWithContextMenu';
|
|
20
20
|
/**
|
|
21
21
|
* Page object representing the global action controls on the bottom of the action bar
|
|
22
22
|
*/
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { ActionsControl, ViewControl } from
|
|
18
|
-
import { ElementWithContexMenu } from
|
|
17
|
+
import { ActionsControl, ViewControl } from '../..';
|
|
18
|
+
import { ElementWithContexMenu } from '../ElementWithContextMenu';
|
|
19
19
|
/**
|
|
20
20
|
* Page object representing the left side activity bar in VS Code
|
|
21
21
|
*/
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { ActivityBar, SideBarView } from
|
|
18
|
-
import { ElementWithContexMenu } from
|
|
19
|
-
import { WebElement } from
|
|
17
|
+
import { ActivityBar, SideBarView } from '../..';
|
|
18
|
+
import { ElementWithContexMenu } from '../ElementWithContextMenu';
|
|
19
|
+
import { WebElement } from 'selenium-webdriver';
|
|
20
20
|
/**
|
|
21
21
|
* Page object representing a view container item in the activity bar
|
|
22
22
|
*/
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { ElementWithContexMenu } from
|
|
17
|
+
import { ElementWithContexMenu } from '../ElementWithContextMenu';
|
|
18
18
|
/**
|
|
19
19
|
* View with channel selector
|
|
20
20
|
*/
|
|
21
21
|
export declare abstract class ChannelView extends ElementWithContexMenu {
|
|
22
22
|
protected actionsLabel: string;
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
* Get names of all selectable channels
|
|
25
|
+
* @returns Promise resolving to array of strings - channel names
|
|
26
|
+
*/
|
|
27
27
|
getChannelNames(): Promise<string[]>;
|
|
28
28
|
/**
|
|
29
29
|
* Get name of the current channel
|
|
@@ -25,13 +25,12 @@ const ElementWithContextMenu_1 = require("../ElementWithContextMenu");
|
|
|
25
25
|
class ChannelView extends ElementWithContextMenu_1.ElementWithContexMenu {
|
|
26
26
|
actionsLabel;
|
|
27
27
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
* Get names of all selectable channels
|
|
29
|
+
* @returns Promise resolving to array of strings - channel names
|
|
30
|
+
*/
|
|
31
31
|
async getChannelNames() {
|
|
32
32
|
const names = [];
|
|
33
|
-
const elements = await (await this.enclosingItem.findElement(ChannelView.locators.BottomBarViews.actionsContainer(this.actionsLabel)))
|
|
34
|
-
.findElements(ChannelView.locators.BottomBarViews.channelOption);
|
|
33
|
+
const elements = await (await this.enclosingItem.findElement(ChannelView.locators.BottomBarViews.actionsContainer(this.actionsLabel))).findElements(ChannelView.locators.BottomBarViews.channelOption);
|
|
35
34
|
await Promise.all(elements.map(async (element) => {
|
|
36
35
|
const disabled = await element.getAttribute('disabled');
|
|
37
36
|
if (!disabled) {
|
|
@@ -97,8 +96,10 @@ class TextView extends ChannelView {
|
|
|
97
96
|
* @returns Promise resolving when the clear text button is pressed
|
|
98
97
|
*/
|
|
99
98
|
async clearText() {
|
|
100
|
-
await this.enclosingItem
|
|
101
|
-
.findElement(ChannelView.locators.BottomBarViews.
|
|
99
|
+
await this.enclosingItem
|
|
100
|
+
.findElement(ChannelView.locators.BottomBarViews.actionsContainer(this.actionsLabel))
|
|
101
|
+
.findElement(ChannelView.locators.BottomBarViews.clearText)
|
|
102
|
+
.click();
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
exports.TextView = TextView;
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { AbstractElement } from
|
|
18
|
-
import { ProblemsView, OutputView, DebugConsoleView, TerminalView } from
|
|
17
|
+
import { AbstractElement } from '../AbstractElement';
|
|
18
|
+
import { ProblemsView, OutputView, DebugConsoleView, TerminalView } from '../..';
|
|
19
19
|
/**
|
|
20
20
|
* Page object for the bottom view panel
|
|
21
21
|
*/
|
|
@@ -41,7 +41,7 @@ class BottomBarPanel extends AbstractElement_1.AbstractElement {
|
|
|
41
41
|
// ignore and move on
|
|
42
42
|
}
|
|
43
43
|
const height = (await this.getRect()).height;
|
|
44
|
-
if ((open && height === 0) || !open && height > 0) {
|
|
44
|
+
if ((open && height === 0) || (!open && height > 0)) {
|
|
45
45
|
if (open) {
|
|
46
46
|
await this.getDriver().actions().clear();
|
|
47
47
|
await this.getDriver().actions().keyDown(BottomBarPanel.ctlKey).sendKeys('j').perform();
|
|
@@ -120,8 +120,7 @@ class BottomBarPanel extends AbstractElement_1.AbstractElement {
|
|
|
120
120
|
await this.toggle(true);
|
|
121
121
|
let action;
|
|
122
122
|
try {
|
|
123
|
-
action = await this.findElement(BottomBarPanel.locators.BottomBarPanel.globalActions)
|
|
124
|
-
.findElement(BottomBarPanel.locators.BottomBarPanel.action(label));
|
|
123
|
+
action = await this.findElement(BottomBarPanel.locators.BottomBarPanel.globalActions).findElement(BottomBarPanel.locators.BottomBarPanel.action(label));
|
|
125
124
|
}
|
|
126
125
|
catch (err) {
|
|
127
126
|
// the panel is already maximized
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { BottomBarPanel } from
|
|
18
|
-
import { AbstractElement } from
|
|
17
|
+
import { BottomBarPanel } from '../..';
|
|
18
|
+
import { AbstractElement } from '../AbstractElement';
|
|
19
19
|
import { WebElement } from 'selenium-webdriver';
|
|
20
|
-
import { ElementWithContexMenu } from
|
|
20
|
+
import { ElementWithContexMenu } from '../ElementWithContextMenu';
|
|
21
21
|
/**
|
|
22
22
|
* Problems view in the bottom panel
|
|
23
23
|
*/
|
|
@@ -41,7 +41,8 @@ class ProblemsView extends AbstractElement_1.AbstractElement {
|
|
|
41
41
|
* @returns Promise resolving to the filter field WebElement
|
|
42
42
|
*/
|
|
43
43
|
async clearFilter() {
|
|
44
|
-
const filterField = await this.enclosingItem
|
|
44
|
+
const filterField = await this.enclosingItem
|
|
45
|
+
.findElement(ProblemsView.locators.BottomBarPanel.actions)
|
|
45
46
|
.findElement(ProblemsView.locators.ProblemsView.markersFilter)
|
|
46
47
|
.findElement(ProblemsView.locators.ProblemsView.input);
|
|
47
48
|
await filterField.clear();
|
|
@@ -52,7 +53,8 @@ class ProblemsView extends AbstractElement_1.AbstractElement {
|
|
|
52
53
|
* @returns Promise resolving when the collapse all button is pressed
|
|
53
54
|
*/
|
|
54
55
|
async collapseAll() {
|
|
55
|
-
const button = await this.enclosingItem
|
|
56
|
+
const button = await this.enclosingItem
|
|
57
|
+
.findElement(ProblemsView.locators.BottomBarPanel.actions)
|
|
56
58
|
.findElement(ProblemsView.locators.ProblemsView.collapseAll);
|
|
57
59
|
await button.click();
|
|
58
60
|
}
|
|
@@ -76,7 +78,7 @@ class ProblemsView extends AbstractElement_1.AbstractElement {
|
|
|
76
78
|
const elements = await this.findElements(ProblemsView.locators.ProblemsView.markerRow);
|
|
77
79
|
for (const element of elements) {
|
|
78
80
|
const marker = await new Marker(element, this).wait();
|
|
79
|
-
if (type === MarkerType.Any || type === await marker.getType()) {
|
|
81
|
+
if (type === MarkerType.Any || type === (await marker.getType())) {
|
|
80
82
|
markers.push(marker);
|
|
81
83
|
}
|
|
82
84
|
}
|
|
@@ -138,9 +140,9 @@ class Marker extends ElementWithContextMenu_1.ElementWithContexMenu {
|
|
|
138
140
|
* @returns Promise resolving when the expand/collapse twistie is clicked
|
|
139
141
|
*/
|
|
140
142
|
async toggleExpand(expand) {
|
|
141
|
-
if (await this.getType() === MarkerType.File) {
|
|
143
|
+
if ((await this.getType()) === MarkerType.File) {
|
|
142
144
|
const klass = await this.findElement(ProblemsView.locators.ProblemsView.markerTwistie).getAttribute('class');
|
|
143
|
-
if (
|
|
145
|
+
if (klass.indexOf('collapsed') > -1 === expand) {
|
|
144
146
|
await this.click();
|
|
145
147
|
}
|
|
146
148
|
}
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { BottomBarPanel, ContentAssist } from
|
|
18
|
-
import { TextView, ChannelView } from
|
|
19
|
-
import { ElementWithContexMenu } from
|
|
17
|
+
import { BottomBarPanel, ContentAssist } from '../..';
|
|
18
|
+
import { TextView, ChannelView } from './AbstractViews';
|
|
19
|
+
import { ElementWithContexMenu } from '../ElementWithContextMenu';
|
|
20
20
|
/**
|
|
21
21
|
* Output view of the bottom panel
|
|
22
22
|
*/
|
|
@@ -115,7 +115,7 @@ class TerminalView extends AbstractViews_1.ChannelView {
|
|
|
115
115
|
if (timeout > 0 && timer > timeout) {
|
|
116
116
|
throw new Error(`Timeout of ${timeout}ms exceeded`);
|
|
117
117
|
}
|
|
118
|
-
await new Promise(res => setTimeout(res, 500));
|
|
118
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
119
119
|
timer += 500;
|
|
120
120
|
style = await input.getCssValue('left');
|
|
121
121
|
} while (style === '0px');
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { WebElement } from
|
|
18
|
-
import { AbstractElement } from
|
|
17
|
+
import { WebElement } from 'selenium-webdriver';
|
|
18
|
+
import { AbstractElement } from '../AbstractElement';
|
|
19
19
|
/**
|
|
20
20
|
* Page object representing a user-contributed panel implemented using a Webview.
|
|
21
21
|
*/
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { WebElement } from
|
|
18
|
-
import { AbstractElement } from
|
|
17
|
+
import { WebElement } from 'selenium-webdriver';
|
|
18
|
+
import { AbstractElement } from '../AbstractElement';
|
|
19
19
|
/**
|
|
20
20
|
* Page Object for Custom Style Modal Dialogs (non-native)
|
|
21
21
|
*/
|
|
@@ -55,7 +55,7 @@ class ModalDialog extends AbstractElement_1.AbstractElement {
|
|
|
55
55
|
async pushButton(title) {
|
|
56
56
|
const buttons = await this.getButtons();
|
|
57
57
|
const titles = await Promise.all(buttons.map(async (btn) => ModalDialog.locators.Dialog.buttonLabel.value(btn)));
|
|
58
|
-
const index = titles.findIndex(value => value === title);
|
|
58
|
+
const index = titles.findIndex((value) => value === title);
|
|
59
59
|
if (index > -1) {
|
|
60
60
|
await buttons[index].click();
|
|
61
61
|
}
|
|
@@ -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 { TextEditor, Menu, MenuItem, DebugConsoleView } from
|
|
17
|
+
import { TextEditor, Menu, MenuItem, DebugConsoleView } from '../..';
|
|
18
18
|
import { WebElement } from 'selenium-webdriver';
|
|
19
19
|
/**
|
|
20
20
|
* Page object representing the content assistant
|
|
@@ -44,14 +44,14 @@ class ContentAssist extends __1.Menu {
|
|
|
44
44
|
while (!lastItem) {
|
|
45
45
|
const items = await this.getItems();
|
|
46
46
|
for (const item of items) {
|
|
47
|
-
if (await item.getLabel() === name) {
|
|
47
|
+
if ((await item.getLabel()) === name) {
|
|
48
48
|
return item;
|
|
49
49
|
}
|
|
50
50
|
lastItem = lastItem || (await item.getAttribute('data-last-element')) === 'true';
|
|
51
51
|
}
|
|
52
52
|
if (!lastItem) {
|
|
53
53
|
await scrollable.sendKeys(selenium_webdriver_1.Key.PAGE_DOWN);
|
|
54
|
-
await new Promise(res => setTimeout(res, 100));
|
|
54
|
+
await new Promise((res) => setTimeout(res, 100));
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -60,9 +60,10 @@ class ContentAssist extends __1.Menu {
|
|
|
60
60
|
* @returns Promise resolving to array of ContentAssistItem objects
|
|
61
61
|
*/
|
|
62
62
|
async getItems() {
|
|
63
|
-
await this.getDriver().wait(async () => {
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
await this.getDriver().wait(async () => {
|
|
64
|
+
return await this.isLoaded();
|
|
65
|
+
});
|
|
66
|
+
const elements = await this.findElement(ContentAssist.locators.ContentAssist.itemRows).findElements(ContentAssist.locators.ContentAssist.itemRow);
|
|
66
67
|
const items = [];
|
|
67
68
|
for (const item of elements) {
|
|
68
69
|
try {
|
|
@@ -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 { Editor, InputBox, WebView } from
|
|
17
|
+
import { Editor, InputBox, WebView } from '../..';
|
|
18
18
|
/**
|
|
19
19
|
* Page object for custom editors
|
|
20
20
|
*/
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { ElementWithContexMenu } from
|
|
18
|
-
import { EditorTab, EditorView, EditorGroup } from
|
|
17
|
+
import { ElementWithContexMenu } from '../ElementWithContextMenu';
|
|
18
|
+
import { EditorTab, EditorView, EditorGroup } from '../..';
|
|
19
19
|
import { WebElement, Locator } from 'selenium-webdriver';
|
|
20
20
|
/**
|
|
21
21
|
* Abstract representation of an editor tab
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { EditorGroup } from
|
|
18
|
-
import { AbstractElement } from
|
|
19
|
-
import { WebElement } from
|
|
17
|
+
import { EditorGroup } from './EditorView';
|
|
18
|
+
import { AbstractElement } from '../AbstractElement';
|
|
19
|
+
import { WebElement } from '../..';
|
|
20
20
|
export declare class EditorAction extends AbstractElement {
|
|
21
21
|
constructor(element: WebElement, parent: EditorGroup);
|
|
22
22
|
/**
|
|
@@ -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 { WebElement } from
|
|
18
|
-
import { AbstractElement } from
|
|
19
|
-
import { ElementWithContexMenu } from
|
|
20
|
-
import { Editor } from
|
|
21
|
-
import { EditorAction } from
|
|
17
|
+
import { WebElement } from 'selenium-webdriver';
|
|
18
|
+
import { AbstractElement } from '../AbstractElement';
|
|
19
|
+
import { ElementWithContexMenu } from '../ElementWithContextMenu';
|
|
20
|
+
import { Editor } from './Editor';
|
|
21
|
+
import { EditorAction } from './EditorAction';
|
|
22
22
|
export declare class EditorTabNotFound extends Error {
|
|
23
23
|
constructor(title: string, group: number);
|
|
24
24
|
}
|
|
@@ -70,7 +70,7 @@ class EditorView extends AbstractElement_1.AbstractElement {
|
|
|
70
70
|
}
|
|
71
71
|
while (groups.length > 0 && (await groups[0].getOpenEditorTitles()).length > 0) {
|
|
72
72
|
await groups[0].closeAllEditors();
|
|
73
|
-
await new Promise(res => setTimeout(res, 1000));
|
|
73
|
+
await new Promise((res) => setTimeout(res, 1000));
|
|
74
74
|
groups = await this.getEditorGroups();
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -313,8 +313,7 @@ class EditorGroup extends AbstractElement_1.AbstractElement {
|
|
|
313
313
|
* @returns promise resolving to list of EditorAction objects
|
|
314
314
|
*/
|
|
315
315
|
async getActions() {
|
|
316
|
-
const actions = await this.findElement(EditorGroup.locators.EditorView.actionContainer)
|
|
317
|
-
.findElements(EditorGroup.locators.EditorView.actionItem);
|
|
316
|
+
const actions = await this.findElement(EditorGroup.locators.EditorView.actionContainer).findElements(EditorGroup.locators.EditorView.actionItem);
|
|
318
317
|
return actions.map((action) => new EditorAction_1.EditorAction(action, this));
|
|
319
318
|
}
|
|
320
319
|
/**
|
|
@@ -323,8 +322,7 @@ class EditorGroup extends AbstractElement_1.AbstractElement {
|
|
|
323
322
|
* @returns promise resolving to EditorAction representing the button if found, undefined otherwise
|
|
324
323
|
*/
|
|
325
324
|
async getAction(predicateOrTitle) {
|
|
326
|
-
const predicate =
|
|
327
|
-
(async (action) => await action.getTitle() === predicateOrTitle) : (predicateOrTitle);
|
|
325
|
+
const predicate = typeof predicateOrTitle === 'string' ? async (action) => (await action.getTitle()) === predicateOrTitle : predicateOrTitle;
|
|
328
326
|
const actions = await this.getActions();
|
|
329
327
|
for (const action of actions) {
|
|
330
328
|
if (await predicate(action)) {
|
|
@@ -354,12 +352,19 @@ class EditorTab extends ElementWithContextMenu_1.ElementWithContexMenu {
|
|
|
354
352
|
*/
|
|
355
353
|
async select() {
|
|
356
354
|
const tabCoords = await this.getRect();
|
|
357
|
-
await this.getDriver()
|
|
355
|
+
await this.getDriver()
|
|
356
|
+
.actions()
|
|
357
|
+
.move({
|
|
358
|
+
x: Math.ceil(tabCoords.x + 10),
|
|
359
|
+
y: Math.ceil(tabCoords.y + 10),
|
|
360
|
+
})
|
|
361
|
+
.click()
|
|
362
|
+
.perform();
|
|
358
363
|
}
|
|
359
364
|
async isSelected() {
|
|
360
365
|
const klass = await this.getAttribute('class');
|
|
361
366
|
const segments = klass?.split(/\s+/g) ?? [];
|
|
362
|
-
return await super.isSelected() || segments.includes('active');
|
|
367
|
+
return (await super.isSelected()) || segments.includes('active');
|
|
363
368
|
}
|
|
364
369
|
}
|
|
365
370
|
exports.EditorTab = EditorTab;
|
|
@@ -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 { Editor } from
|
|
18
|
-
import { ContextMenu } from
|
|
19
|
-
import { WebElement, By } from
|
|
20
|
-
import { AbstractElement } from
|
|
21
|
-
import { EditorView, EditorGroup } from
|
|
17
|
+
import { Editor } from './Editor';
|
|
18
|
+
import { ContextMenu } from '../menu/ContextMenu';
|
|
19
|
+
import { WebElement, By } from 'selenium-webdriver';
|
|
20
|
+
import { AbstractElement } from '../AbstractElement';
|
|
21
|
+
import { EditorView, EditorGroup } from '../..';
|
|
22
22
|
/**
|
|
23
23
|
* Page object representing the internal VS Code settings editor
|
|
24
24
|
*/
|
|
@@ -206,13 +206,13 @@ export declare class ArraySettingItem extends AbstractElement {
|
|
|
206
206
|
*/
|
|
207
207
|
remove(): Promise<void>;
|
|
208
208
|
/**
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
* Click 'OK' button
|
|
210
|
+
* @description Only when the item is in edit mode
|
|
211
|
+
*/
|
|
212
212
|
ok(): Promise<void>;
|
|
213
213
|
/**
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
* Click 'Cancel' button
|
|
215
|
+
* @description Only when the item is in edit mode
|
|
216
|
+
*/
|
|
217
217
|
cancel(): Promise<void>;
|
|
218
218
|
}
|
|
@@ -67,7 +67,7 @@ class SettingsEditor extends Editor_1.Editor {
|
|
|
67
67
|
const count = await this.findElement(SettingsEditor.locators.SettingsEditor.itemCount);
|
|
68
68
|
let textCount = await count.getText();
|
|
69
69
|
await this.getDriver().wait(async function () {
|
|
70
|
-
await new Promise(res => setTimeout(res, 1500));
|
|
70
|
+
await new Promise((res) => setTimeout(res, 1500));
|
|
71
71
|
const text = await count.getText();
|
|
72
72
|
if (text !== textCount) {
|
|
73
73
|
textCount = text;
|
|
@@ -82,7 +82,8 @@ class SettingsEditor extends Editor_1.Editor {
|
|
|
82
82
|
const itemCategory = (await (await item.findElement(SettingsEditor.locators.SettingsEditor.settingCategory)).getText()).replace(':', '');
|
|
83
83
|
const itemTitle = await (await item.findElement(SettingsEditor.locators.SettingsEditor.settingLabel)).getText();
|
|
84
84
|
if (category !== '') {
|
|
85
|
-
if (category.toLowerCase().replace(this.divider, '').replace(/\s/g, '').trim() !==
|
|
85
|
+
if (category.toLowerCase().replace(this.divider, '').replace(/\s/g, '').trim() !==
|
|
86
|
+
itemCategory.toLowerCase().replace(this.divider, '').replace(/\s/g, '').trim()) {
|
|
86
87
|
continue;
|
|
87
88
|
}
|
|
88
89
|
}
|
|
@@ -255,7 +256,7 @@ class CheckboxSetting extends Setting {
|
|
|
255
256
|
}
|
|
256
257
|
async setValue(value) {
|
|
257
258
|
const checkbox = await this.findElement(SettingsEditor.locators.SettingsEditor.checkboxSetting);
|
|
258
|
-
if (await this.getValue() !== value) {
|
|
259
|
+
if ((await this.getValue()) !== value) {
|
|
259
260
|
await checkbox.click();
|
|
260
261
|
}
|
|
261
262
|
}
|
|
@@ -290,14 +291,14 @@ class ArraySetting extends Setting {
|
|
|
290
291
|
* @deprecated Method 'getValue' is not available for ArraySetting!
|
|
291
292
|
*/
|
|
292
293
|
async getValue() {
|
|
293
|
-
throw new Error(
|
|
294
|
+
throw new Error("Method 'getValue' is not available for ArraySetting!");
|
|
294
295
|
}
|
|
295
296
|
/**
|
|
296
297
|
* @deprecated Method 'setValue' is not available for ArraySetting!
|
|
297
298
|
*/
|
|
298
299
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
299
300
|
async setValue(value) {
|
|
300
|
-
throw new Error(
|
|
301
|
+
throw new Error("Method 'setValue' is not available for ArraySetting!");
|
|
301
302
|
}
|
|
302
303
|
/**
|
|
303
304
|
* Select a row of a setting array of string values
|
|
@@ -351,7 +352,7 @@ class ArraySetting extends Setting {
|
|
|
351
352
|
// click 'Add Item' button
|
|
352
353
|
const button = await this.findElement(SettingsEditor.locators.SettingsEditor.arrayNewRow).findElement(selenium_webdriver_1.By.className('monaco-button'));
|
|
353
354
|
await button.click();
|
|
354
|
-
await new Promise(sleep => setTimeout(sleep, 1_000)); // need to force some time to allow DOM rerender elements
|
|
355
|
+
await new Promise((sleep) => setTimeout(sleep, 1_000)); // need to force some time to allow DOM rerender elements
|
|
355
356
|
// get item row switched to 'edit' mode
|
|
356
357
|
const list = await this.getListRootElement();
|
|
357
358
|
const editRow = await list.findElement(SettingsEditor.locators.SettingsEditor.arrayEditRow);
|
|
@@ -368,10 +369,10 @@ class ArraySetting extends Setting {
|
|
|
368
369
|
// select item row
|
|
369
370
|
const toEdit = new ArraySettingItem(row, this);
|
|
370
371
|
await toEdit.select();
|
|
371
|
-
// click 'Edit Item' button
|
|
372
|
+
// click 'Edit Item' button
|
|
372
373
|
const edit = await toEdit.findElement(SettingsEditor.locators.SettingsEditor.arrayBtnConstructor('Edit Item'));
|
|
373
374
|
await edit.click();
|
|
374
|
-
await new Promise(sleep => setTimeout(sleep, 1_000)); // need to force some time to allow DOM rerender elements
|
|
375
|
+
await new Promise((sleep) => setTimeout(sleep, 1_000)); // need to force some time to allow DOM rerender elements
|
|
375
376
|
// get item row switched to 'edit' mode
|
|
376
377
|
const list = await this.getListRootElement();
|
|
377
378
|
const editRow = await list.findElement(SettingsEditor.locators.SettingsEditor.arrayEditRow);
|
|
@@ -398,7 +399,7 @@ class ArraySetting extends Setting {
|
|
|
398
399
|
else {
|
|
399
400
|
for (const row of listRows) {
|
|
400
401
|
const li = await row.findElement(SettingsEditor.locators.SettingsEditor.arrayRowValue);
|
|
401
|
-
if (await li.getText() === item) {
|
|
402
|
+
if ((await li.getText()) === item) {
|
|
402
403
|
return row;
|
|
403
404
|
}
|
|
404
405
|
}
|
|
@@ -419,7 +420,7 @@ class ArraySettingItem extends AbstractElement_1.AbstractElement {
|
|
|
419
420
|
*/
|
|
420
421
|
async select() {
|
|
421
422
|
await this.click();
|
|
422
|
-
await new Promise(sleep => setTimeout(sleep, 500));
|
|
423
|
+
await new Promise((sleep) => setTimeout(sleep, 500));
|
|
423
424
|
}
|
|
424
425
|
/**
|
|
425
426
|
* Get item text value
|
|
@@ -444,25 +445,25 @@ class ArraySettingItem extends AbstractElement_1.AbstractElement {
|
|
|
444
445
|
await this.select();
|
|
445
446
|
const remove = await this.findElement(SettingsEditor.locators.SettingsEditor.arrayBtnConstructor('Remove Item'));
|
|
446
447
|
await remove.click();
|
|
447
|
-
await new Promise(sleep => setTimeout(sleep, 500));
|
|
448
|
+
await new Promise((sleep) => setTimeout(sleep, 500));
|
|
448
449
|
}
|
|
449
450
|
/**
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
451
|
+
* Click 'OK' button
|
|
452
|
+
* @description Only when the item is in edit mode
|
|
453
|
+
*/
|
|
453
454
|
async ok() {
|
|
454
455
|
const ok = await this.findElement(SettingsEditor.locators.SettingsEditor.arraySettingItem.btnConstructor('OK'));
|
|
455
456
|
await ok.click();
|
|
456
|
-
await new Promise(sleep => setTimeout(sleep, 500));
|
|
457
|
+
await new Promise((sleep) => setTimeout(sleep, 500));
|
|
457
458
|
}
|
|
458
459
|
/**
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
460
|
+
* Click 'Cancel' button
|
|
461
|
+
* @description Only when the item is in edit mode
|
|
462
|
+
*/
|
|
462
463
|
async cancel() {
|
|
463
464
|
const cancel = await this.findElement(SettingsEditor.locators.SettingsEditor.arraySettingItem.btnConstructor('Cancel'));
|
|
464
465
|
await cancel.click();
|
|
465
|
-
await new Promise(sleep => setTimeout(sleep, 500));
|
|
466
|
+
await new Promise((sleep) => setTimeout(sleep, 500));
|
|
466
467
|
}
|
|
467
468
|
}
|
|
468
469
|
exports.ArraySettingItem = ArraySettingItem;
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { ContentAssist, ContextMenu, InputBox } from
|
|
18
|
-
import { WebElement } from
|
|
19
|
-
import { Editor } from
|
|
20
|
-
import { ElementWithContexMenu } from
|
|
21
|
-
import { AbstractElement } from
|
|
22
|
-
import { Breakpoint } from
|
|
17
|
+
import { ContentAssist, ContextMenu, InputBox } from '../..';
|
|
18
|
+
import { WebElement } from 'selenium-webdriver';
|
|
19
|
+
import { Editor } from './Editor';
|
|
20
|
+
import { ElementWithContexMenu } from '../ElementWithContextMenu';
|
|
21
|
+
import { AbstractElement } from '../AbstractElement';
|
|
22
|
+
import { Breakpoint } from './Breakpoint';
|
|
23
23
|
export declare class BreakpointError extends Error {
|
|
24
24
|
}
|
|
25
25
|
/**
|