@redhat-developer/page-objects 1.1.1 → 1.1.3
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/WebviewMixin.js +1 -1
- 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/conditions/WaitForAttribute.js +1 -2
- package/out/index.js +2 -2
- package/out/locators/loader.js +8 -8
- package/out/locators/locators.d.ts +8 -8
- package/out/locators/locators.js +7 -8
- package/package.json +2 -2
|
@@ -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
|
/**
|
|
@@ -99,7 +99,9 @@ class TextEditor extends Editor_1.Editor {
|
|
|
99
99
|
await this.getDriver().wait(selenium_webdriver_1.until.elementLocated(TextEditor.locators.ContentAssist.constructor), 2000);
|
|
100
100
|
}
|
|
101
101
|
const assist = await new __1.ContentAssist(this).wait();
|
|
102
|
-
await this.getDriver().wait(() => {
|
|
102
|
+
await this.getDriver().wait(() => {
|
|
103
|
+
return assist.isLoaded();
|
|
104
|
+
}, 10000);
|
|
103
105
|
return assist;
|
|
104
106
|
}
|
|
105
107
|
else {
|
|
@@ -124,7 +126,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
124
126
|
}
|
|
125
127
|
const inputarea = await this.findElement(TextEditor.locators.Editor.inputArea);
|
|
126
128
|
await inputarea.sendKeys(selenium_webdriver_1.Key.chord(TextEditor.ctlKey, 'a'), selenium_webdriver_1.Key.chord(TextEditor.ctlKey, 'c'));
|
|
127
|
-
await new Promise(res => setTimeout(res, 500));
|
|
129
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
128
130
|
const text = clipboard.readSync();
|
|
129
131
|
await inputarea.sendKeys(selenium_webdriver_1.Key.UP);
|
|
130
132
|
if (originalClipboard.length > 0) {
|
|
@@ -187,7 +189,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
187
189
|
* @returns Promise resolving when the text is typed in
|
|
188
190
|
*/
|
|
189
191
|
async setTextAtLine(line, text) {
|
|
190
|
-
if (line < 1 || line > await this.getNumberOfLines()) {
|
|
192
|
+
if (line < 1 || line > (await this.getNumberOfLines())) {
|
|
191
193
|
throw new Error(`Line number ${line} does not exist`);
|
|
192
194
|
}
|
|
193
195
|
const lines = (await this.getText()).split('\n');
|
|
@@ -241,7 +243,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
241
243
|
}
|
|
242
244
|
actions = actions.keyUp(selenium_webdriver_1.Key.SHIFT);
|
|
243
245
|
await actions.perform();
|
|
244
|
-
await new Promise(res => setTimeout(res, 500));
|
|
246
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
245
247
|
}
|
|
246
248
|
/**
|
|
247
249
|
* Get the text that is currently selected as string
|
|
@@ -267,10 +269,10 @@ class TextEditor extends Editor_1.Editor {
|
|
|
267
269
|
else {
|
|
268
270
|
const inputarea = await this.findElement(TextEditor.locators.Editor.inputArea);
|
|
269
271
|
await inputarea.sendKeys(selenium_webdriver_1.Key.chord(TextEditor.ctlKey, 'c'));
|
|
270
|
-
await new Promise(res => setTimeout(res, 500));
|
|
272
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
271
273
|
await inputarea.sendKeys(selenium_webdriver_1.Key.UP);
|
|
272
274
|
}
|
|
273
|
-
await new Promise(res => setTimeout(res, 500));
|
|
275
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
274
276
|
const text = clipboard.readSync();
|
|
275
277
|
if (originalClipboard.length > 0) {
|
|
276
278
|
clipboard.writeSync(originalClipboard);
|
|
@@ -323,7 +325,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
323
325
|
* @returns Promise resolving when the cursor has reached the given coordinates
|
|
324
326
|
*/
|
|
325
327
|
async moveCursor(line, column) {
|
|
326
|
-
if (line < 1 || line > await this.getNumberOfLines()) {
|
|
328
|
+
if (line < 1 || line > (await this.getNumberOfLines())) {
|
|
327
329
|
throw new Error(`Line number ${line} does not exist`);
|
|
328
330
|
}
|
|
329
331
|
if (column < 1) {
|
|
@@ -394,7 +396,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
394
396
|
return new __1.ContextMenu(await shadowRoot.findElement(selenium_webdriver_1.By.className('monaco-menu-container'))).wait();
|
|
395
397
|
}
|
|
396
398
|
else {
|
|
397
|
-
shadowRoot = await this.getDriver().executeScript('return arguments[0].shadowRoot', shadowRootHost[0]);
|
|
399
|
+
shadowRoot = (await this.getDriver().executeScript('return arguments[0].shadowRoot', shadowRootHost[0]));
|
|
398
400
|
return new __1.ContextMenu(shadowRoot).wait();
|
|
399
401
|
}
|
|
400
402
|
}
|
|
@@ -430,7 +432,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
430
432
|
if (breakPoint.length > 0) {
|
|
431
433
|
if (this.breakPoints.indexOf(line) !== -1) {
|
|
432
434
|
await breakPoint[this.breakPoints.indexOf(line)].click();
|
|
433
|
-
await new Promise(res => setTimeout(res, 200));
|
|
435
|
+
await new Promise((res) => setTimeout(res, 200));
|
|
434
436
|
this.breakPoints.splice(this.breakPoints.indexOf(line), 1);
|
|
435
437
|
return false;
|
|
436
438
|
}
|
|
@@ -438,7 +440,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
438
440
|
const noBreak = await breakpointContainer.findElements(TextEditor.locators.TextEditor.debugHint);
|
|
439
441
|
if (noBreak.length > 0) {
|
|
440
442
|
await noBreak[0].click();
|
|
441
|
-
await new Promise(res => setTimeout(res, 200));
|
|
443
|
+
await new Promise((res) => setTimeout(res, 200));
|
|
442
444
|
this.breakPoints.push(line);
|
|
443
445
|
return true;
|
|
444
446
|
}
|
|
@@ -490,7 +492,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
490
492
|
*/
|
|
491
493
|
async getCodeLens(indexOrTitle) {
|
|
492
494
|
const lenses = await this.getCodeLenses();
|
|
493
|
-
if (typeof
|
|
495
|
+
if (typeof indexOrTitle === 'string') {
|
|
494
496
|
for (const lens of lenses) {
|
|
495
497
|
const title = await lens.getText();
|
|
496
498
|
const match = title.match(indexOrTitle);
|
|
@@ -526,7 +528,7 @@ class Selection extends ElementWithContextMenu_1.ElementWithContexMenu {
|
|
|
526
528
|
return new __1.ContextMenu(await shadowRoot.findElement(selenium_webdriver_1.By.className('monaco-menu-container'))).wait();
|
|
527
529
|
}
|
|
528
530
|
else {
|
|
529
|
-
shadowRoot = await this.getDriver().executeScript('return arguments[0].shadowRoot', shadowRootHost[0]);
|
|
531
|
+
shadowRoot = (await this.getDriver().executeScript('return arguments[0].shadowRoot', shadowRootHost[0]));
|
|
530
532
|
return new __1.ContextMenu(shadowRoot).wait();
|
|
531
533
|
}
|
|
532
534
|
}
|
|
@@ -560,7 +562,7 @@ class FindWidget extends AbstractElement_1.AbstractElement {
|
|
|
560
562
|
async toggleReplace(replace) {
|
|
561
563
|
const btn = await this.findElement(FindWidget.locators.FindWidget.toggleReplace);
|
|
562
564
|
const klass = await btn.getAttribute('class');
|
|
563
|
-
if (replace && klass.includes('collapsed') || !replace && !klass.includes('collapsed')) {
|
|
565
|
+
if ((replace && klass.includes('collapsed')) || (!replace && !klass.includes('collapsed'))) {
|
|
564
566
|
await btn.sendKeys(selenium_webdriver_1.Key.SPACE);
|
|
565
567
|
const repl = await this.getDriver().wait(selenium_webdriver_1.until.elementLocated(FindWidget.locators.FindWidget.replacePart), 2000);
|
|
566
568
|
if (replace) {
|
|
@@ -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 { Editor } from
|
|
17
|
+
import { WebElement } from 'selenium-webdriver';
|
|
18
|
+
import { Editor } from './Editor';
|
|
19
19
|
/**
|
|
20
20
|
* Page object representing an open editor containing a web view
|
|
21
21
|
*/
|
|
@@ -40,7 +40,7 @@ class WebViewBase extends Editor_1.Editor {
|
|
|
40
40
|
await this.getDriver().switchTo().window(handle);
|
|
41
41
|
const reference = await this.findElement(WebViewBase.locators.EditorView.webView);
|
|
42
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 () => {
|
|
43
|
+
return (await containers[0].getDriver().wait(async () => {
|
|
44
44
|
for (const container of containers) {
|
|
45
45
|
const tries = await container.findElements(WebViewBase.locators.WebView.iframe);
|
|
46
46
|
if (tries.length > 0) {
|
|
@@ -48,7 +48,7 @@ class WebViewBase extends Editor_1.Editor {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
return undefined;
|
|
51
|
-
}, 5000);
|
|
51
|
+
}, 5000));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.WebView = (0, WebviewMixin_1.default)(WebViewBase);
|
|
@@ -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 { Menu, MenuItem } from
|
|
18
|
-
import { WebElement } from
|
|
17
|
+
import { Menu, MenuItem } from '../..';
|
|
18
|
+
import { WebElement } from 'selenium-webdriver';
|
|
19
19
|
/**
|
|
20
20
|
* Object representing a context menu
|
|
21
21
|
*/
|
|
@@ -35,7 +35,7 @@ class ContextMenu extends __1.Menu {
|
|
|
35
35
|
try {
|
|
36
36
|
const items = await this.getItems();
|
|
37
37
|
for (const item of items) {
|
|
38
|
-
if (await item.getLabel() === name) {
|
|
38
|
+
if ((await item.getLabel()) === name) {
|
|
39
39
|
return item;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -116,7 +116,7 @@ class ContextMenuItem extends __1.MenuItem {
|
|
|
116
116
|
}
|
|
117
117
|
async select() {
|
|
118
118
|
await this.click();
|
|
119
|
-
await new Promise(res => setTimeout(res, 500));
|
|
119
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
120
120
|
if (await this.isNesting()) {
|
|
121
121
|
return await new ContextMenu(this).wait();
|
|
122
122
|
}
|
|
@@ -34,11 +34,7 @@ class MacTitleBar {
|
|
|
34
34
|
*/
|
|
35
35
|
static select(...items) {
|
|
36
36
|
let menuCounter = 0;
|
|
37
|
-
const commands = [
|
|
38
|
-
`tell application "System Events"`,
|
|
39
|
-
`tell process "Code"`,
|
|
40
|
-
`tell menu bar item "${items[0]}" of menu bar 1`
|
|
41
|
-
];
|
|
37
|
+
const commands = [`tell application "System Events"`, `tell process "Code"`, `tell menu bar item "${items[0]}" of menu bar 1`];
|
|
42
38
|
for (let i = 1; i < items.length - 1; i++) {
|
|
43
39
|
commands.push(`tell menu item "${items[i]}" of menu 1`);
|
|
44
40
|
++menuCounter;
|
|
@@ -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 { MenuItem } from
|
|
17
|
+
import { AbstractElement } from '../AbstractElement';
|
|
18
|
+
import { MenuItem } from './MenuItem';
|
|
19
19
|
/**
|
|
20
20
|
* Abstract element representing a menu
|
|
21
21
|
*/
|
|
@@ -29,7 +29,7 @@ class Menu extends AbstractElement_1.AbstractElement {
|
|
|
29
29
|
*/
|
|
30
30
|
async hasItem(name) {
|
|
31
31
|
const item = await this.getItem(name);
|
|
32
|
-
return !!item &&
|
|
32
|
+
return !!item && item.isDisplayed();
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Recursively select an item with a given path.
|
|
@@ -53,7 +53,7 @@ class Menu extends AbstractElement_1.AbstractElement {
|
|
|
53
53
|
return parent;
|
|
54
54
|
}
|
|
55
55
|
await Menu.driver.wait(async function () {
|
|
56
|
-
return await item.isDisplayed() && await item.isEnabled();
|
|
56
|
+
return (await item.isDisplayed()) && (await item.isEnabled());
|
|
57
57
|
});
|
|
58
58
|
const submenu = await item.select();
|
|
59
59
|
if (submenu) {
|
|
@@ -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 { Menu } from
|
|
17
|
+
import { AbstractElement } from '../AbstractElement';
|
|
18
|
+
import { Menu } from './Menu';
|
|
19
19
|
/**
|
|
20
20
|
* Abstract element representing a menu item
|
|
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 { WindowControls, ContextMenu } from
|
|
18
|
-
import { Menu } from
|
|
19
|
-
import { MenuItem } from
|
|
17
|
+
import { WindowControls, ContextMenu } from '../..';
|
|
18
|
+
import { Menu } from './Menu';
|
|
19
|
+
import { MenuItem } from './MenuItem';
|
|
20
20
|
/**
|
|
21
21
|
* Page object representing the custom VS Code title bar
|
|
22
22
|
*/
|
|
@@ -82,11 +82,11 @@ class TitleBarItem extends MenuItem_1.MenuItem {
|
|
|
82
82
|
}
|
|
83
83
|
async select() {
|
|
84
84
|
const openMenus = await this.getDriver().findElements(TitleBar.locators.ContextMenu.constructor);
|
|
85
|
-
if (openMenus.length > 0 && await openMenus[0].isDisplayed()) {
|
|
85
|
+
if (openMenus.length > 0 && (await openMenus[0].isDisplayed())) {
|
|
86
86
|
await this.getDriver().actions().sendKeys(selenium_webdriver_1.Key.ESCAPE).perform();
|
|
87
87
|
}
|
|
88
88
|
await this.click();
|
|
89
|
-
await new Promise(res => setTimeout(res, 500));
|
|
89
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
90
90
|
return new __1.ContextMenu(this).wait();
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -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 { TitleBar } from
|
|
17
|
+
import { AbstractElement } from '../AbstractElement';
|
|
18
|
+
import { TitleBar } from '../..';
|
|
19
19
|
/**
|
|
20
20
|
* Page object for the windows controls part of the title bar
|
|
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 { AbstractElement } from
|
|
18
|
-
import { ViewTitlePart, ViewContent } from
|
|
17
|
+
import { AbstractElement } from '../AbstractElement';
|
|
18
|
+
import { ViewTitlePart, ViewContent } from '../..';
|
|
19
19
|
/**
|
|
20
20
|
* Page object for the side bar view
|
|
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 { SideBarView, ViewSection, ViewSectionConstructor } from
|
|
18
|
-
import { AbstractElement } from
|
|
17
|
+
import { SideBarView, ViewSection, ViewSectionConstructor } from '../..';
|
|
18
|
+
import { AbstractElement } from '../AbstractElement';
|
|
19
19
|
/**
|
|
20
20
|
* Page object representing the view container of a side bar view
|
|
21
21
|
*/
|
|
@@ -53,7 +53,7 @@ export declare class ViewContent extends AbstractElement {
|
|
|
53
53
|
* @param predicate Predicate to be used when searching
|
|
54
54
|
* @returns Promise resolving to ViewSection object
|
|
55
55
|
*/
|
|
56
|
-
getSection<T extends ViewSection>(predicate: (
|
|
56
|
+
getSection<T extends ViewSection>(predicate: (section: ViewSection) => boolean | PromiseLike<boolean>): Promise<T>;
|
|
57
57
|
/**
|
|
58
58
|
* Retrieves a collapsible view content section by predicate.
|
|
59
59
|
* Type parameter allows caller to use custom section implementation,
|
|
@@ -63,7 +63,7 @@ export declare class ViewContent extends AbstractElement {
|
|
|
63
63
|
* @param type ViewSection constructor to be used
|
|
64
64
|
* @returns Promise resolving to object specified by type
|
|
65
65
|
*/
|
|
66
|
-
getSection<T extends ViewSection>(predicate: (
|
|
66
|
+
getSection<T extends ViewSection>(predicate: (section: ViewSection) => boolean | PromiseLike<boolean>, type: ViewSectionConstructor<T>): Promise<T>;
|
|
67
67
|
/**
|
|
68
68
|
* Retrieves all the collapsible view content sections
|
|
69
69
|
* @returns Promise resolving to array of ViewSection objects
|
|
@@ -41,8 +41,7 @@ class ViewContent extends AbstractElement_1.AbstractElement {
|
|
|
41
41
|
}
|
|
42
42
|
async getSection(titleOrPredicate, type) {
|
|
43
43
|
const sections = await this.getSections();
|
|
44
|
-
const predicate = typeof titleOrPredicate === 'string' ?
|
|
45
|
-
(async (section) => await section.getTitle() === titleOrPredicate) : titleOrPredicate;
|
|
44
|
+
const predicate = typeof titleOrPredicate === 'string' ? async (section) => (await section.getTitle()) === titleOrPredicate : titleOrPredicate;
|
|
46
45
|
for (const section of sections) {
|
|
47
46
|
if (await predicate(section)) {
|
|
48
47
|
if (type !== undefined && !(section instanceof type)) {
|
|
@@ -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 { ElementWithContexMenu } from
|
|
18
|
-
import { AbstractElement } from
|
|
19
|
-
import { WebElement, By } from
|
|
17
|
+
import { ElementWithContexMenu } from '../ElementWithContextMenu';
|
|
18
|
+
import { AbstractElement } from '../AbstractElement';
|
|
19
|
+
import { WebElement, By } from 'selenium-webdriver';
|
|
20
20
|
/**
|
|
21
21
|
* Arbitrary item in the side bar view
|
|
22
22
|
*/
|
|
@@ -66,7 +66,7 @@ class TreeItem extends ViewItem {
|
|
|
66
66
|
* Expands the current item, if it can be expanded and is collapsed.
|
|
67
67
|
*/
|
|
68
68
|
async expand() {
|
|
69
|
-
if (await this.isExpandable() && !await this.isExpanded()) {
|
|
69
|
+
if ((await this.isExpandable()) && !(await this.isExpanded())) {
|
|
70
70
|
await (await this.findTwistie()).click();
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -77,7 +77,7 @@ class TreeItem extends ViewItem {
|
|
|
77
77
|
async findChildItem(name) {
|
|
78
78
|
const children = await this.getChildren();
|
|
79
79
|
for (const item of children) {
|
|
80
|
-
if (await item.getLabel() === name) {
|
|
80
|
+
if ((await item.getLabel()) === name) {
|
|
81
81
|
return item;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -86,7 +86,7 @@ class TreeItem extends ViewItem {
|
|
|
86
86
|
* Collapse the item if expanded
|
|
87
87
|
*/
|
|
88
88
|
async collapse() {
|
|
89
|
-
if (await this.isExpandable() && await this.isExpanded()) {
|
|
89
|
+
if ((await this.isExpandable()) && (await this.isExpanded())) {
|
|
90
90
|
await (await this.findTwistie()).click();
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -163,11 +163,11 @@ class TreeItem extends ViewItem {
|
|
|
163
163
|
const items = [];
|
|
164
164
|
await this.expand();
|
|
165
165
|
const rows = await this.enclosingItem.findElements(locator);
|
|
166
|
-
const baseIndex = +await this.getAttribute(TreeItem.locators.ViewSection.index);
|
|
167
|
-
const baseLevel = +await this.getAttribute(TreeItem.locators.ViewSection.level);
|
|
166
|
+
const baseIndex = +(await this.getAttribute(TreeItem.locators.ViewSection.index));
|
|
167
|
+
const baseLevel = +(await this.getAttribute(TreeItem.locators.ViewSection.level));
|
|
168
168
|
for (const row of rows) {
|
|
169
|
-
const level = +await row.getAttribute(TreeItem.locators.ViewSection.level);
|
|
170
|
-
const index = +await row.getAttribute(TreeItem.locators.ViewSection.index);
|
|
169
|
+
const level = +(await row.getAttribute(TreeItem.locators.ViewSection.level));
|
|
170
|
+
const index = +(await row.getAttribute(TreeItem.locators.ViewSection.index));
|
|
171
171
|
if (index <= baseIndex) {
|
|
172
172
|
continue;
|
|
173
173
|
}
|
|
@@ -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 { ContextMenu, ViewContent, ViewItem, WelcomeContentSection } from
|
|
19
|
-
import { AbstractElement } from
|
|
17
|
+
import { WebElement } from 'selenium-webdriver';
|
|
18
|
+
import { ContextMenu, ViewContent, ViewItem, WelcomeContentSection } from '../..';
|
|
19
|
+
import { AbstractElement } from '../AbstractElement';
|
|
20
20
|
export type ViewSectionConstructor<T extends ViewSection> = {
|
|
21
21
|
new (rootElement: WebElement, tree: ViewContent): T;
|
|
22
22
|
};
|
|
@@ -44,7 +44,7 @@ class ViewSection extends AbstractElement_1.AbstractElement {
|
|
|
44
44
|
if (await this.isHeaderHidden()) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
if (!await this.isExpanded()) {
|
|
47
|
+
if (!(await this.isExpanded())) {
|
|
48
48
|
const panel = await this.findElement(ViewSection.locators.ViewSection.header);
|
|
49
49
|
await panel.click();
|
|
50
50
|
await this.getDriver().wait((0, __1.waitForAttributeValue)(panel, ViewSection.locators.ViewSection.headerExpanded, 'true'), 1000);
|
|
@@ -81,7 +81,7 @@ class ViewSection extends AbstractElement_1.AbstractElement {
|
|
|
81
81
|
async findWelcomeContent() {
|
|
82
82
|
try {
|
|
83
83
|
const res = await this.findElement(ViewSection.locators.ViewSection.welcomeContent);
|
|
84
|
-
if (!await res.isDisplayed()) {
|
|
84
|
+
if (!(await res.isDisplayed())) {
|
|
85
85
|
return undefined;
|
|
86
86
|
}
|
|
87
87
|
return new __1.WelcomeContentSection(res, this);
|
|
@@ -96,7 +96,7 @@ class ViewSection extends AbstractElement_1.AbstractElement {
|
|
|
96
96
|
*/
|
|
97
97
|
async getActions() {
|
|
98
98
|
const actions = [];
|
|
99
|
-
if (!await this.isHeaderHidden()) {
|
|
99
|
+
if (!(await this.isHeaderHidden())) {
|
|
100
100
|
const header = await this.findElement(ViewSection.locators.ViewSection.header);
|
|
101
101
|
const act = await header.findElement(ViewSection.locators.ViewSection.actions);
|
|
102
102
|
const elements = await act.findElements(ViewSection.locators.ViewSection.button);
|
|
@@ -114,7 +114,7 @@ class ViewSection extends AbstractElement_1.AbstractElement {
|
|
|
114
114
|
async getAction(label) {
|
|
115
115
|
const actions = await this.getActions();
|
|
116
116
|
for (const action of actions) {
|
|
117
|
-
if (await action.getLabel() === label) {
|
|
117
|
+
if ((await action.getLabel()) === label) {
|
|
118
118
|
return action;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -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.ElementWithContexMenu {
|
|
134
134
|
async openContextMenu() {
|
|
135
135
|
await this.click();
|
|
136
136
|
const shadowRootHost = await section.findElements(selenium_webdriver_1.By.className('shadow-root-host'));
|
|
@@ -143,13 +143,13 @@ class ViewSection extends AbstractElement_1.AbstractElement {
|
|
|
143
143
|
return new __1.ContextMenu(await shadowRoot.findElement(selenium_webdriver_1.By.className('monaco-menu-container'))).wait();
|
|
144
144
|
}
|
|
145
145
|
else {
|
|
146
|
-
shadowRoot = await this.getDriver().executeScript('return arguments[0].shadowRoot', shadowRootHost[0]);
|
|
146
|
+
shadowRoot = (await this.getDriver().executeScript('return arguments[0].shadowRoot', shadowRootHost[0]));
|
|
147
147
|
return new __1.ContextMenu(shadowRoot).wait();
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
return await super.openContextMenu();
|
|
151
151
|
}
|
|
152
|
-
}(more, this);
|
|
152
|
+
})(more, this);
|
|
153
153
|
return await btn.openContextMenu();
|
|
154
154
|
}
|
|
155
155
|
async isHeaderHidden() {
|
|
@@ -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 { ElementWithContexMenu } from
|
|
18
|
-
import { AbstractElement } from
|
|
19
|
-
import { By, SideBarView } from
|
|
17
|
+
import { ElementWithContexMenu } from '../ElementWithContextMenu';
|
|
18
|
+
import { AbstractElement } from '../AbstractElement';
|
|
19
|
+
import { By, SideBarView } from '../..';
|
|
20
20
|
/**
|
|
21
21
|
* Page object representing the top (title) part of a side bar view
|
|
22
22
|
*/
|
|
@@ -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 { AbstractElement } from
|
|
19
|
-
import { ViewSection } from
|
|
17
|
+
import { WebElement } from 'selenium-webdriver';
|
|
18
|
+
import { AbstractElement } from '../AbstractElement';
|
|
19
|
+
import { ViewSection } from '../..';
|
|
20
20
|
/**
|
|
21
21
|
* A button that appears in the welcome content and can be clicked to execute a command.
|
|
22
22
|
*
|
|
@@ -64,7 +64,7 @@ class WelcomeContentSection extends AbstractElement_1.AbstractElement {
|
|
|
64
64
|
const elements = await this.findElements(WelcomeContentSection.locators.WelcomeContent.buttonOrText);
|
|
65
65
|
return Promise.all(elements.map(async (e) => {
|
|
66
66
|
const tagName = await e.getTagName();
|
|
67
|
-
if (tagName ===
|
|
67
|
+
if (tagName === 'p') {
|
|
68
68
|
return await e.getText();
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
@@ -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 { SideBarView } from
|
|
18
|
-
import { DebugBreakpointSection } from
|
|
19
|
-
import { DebugVariableSection } from
|
|
17
|
+
import { SideBarView } from '../SideBarView';
|
|
18
|
+
import { DebugBreakpointSection } from '../tree/debug/DebugBreakpointSection';
|
|
19
|
+
import { DebugVariableSection } from '../tree/debug/DebugVariablesSection';
|
|
20
20
|
/**
|
|
21
21
|
* Page object representing the Run/Debug view in the side bar
|
|
22
22
|
*/
|
|
@@ -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 { ViewItem } from
|
|
18
|
-
import { WebElement } from
|
|
19
|
-
import { ContextMenu } from
|
|
20
|
-
import { ExtensionsViewSection } from
|
|
17
|
+
import { ViewItem } from '../ViewItem';
|
|
18
|
+
import { WebElement } from 'selenium-webdriver';
|
|
19
|
+
import { ContextMenu } from '../../menu/ContextMenu';
|
|
20
|
+
import { ExtensionsViewSection } from './ExtensionsViewSection';
|
|
21
21
|
/**
|
|
22
22
|
* Page object representing an extension in the extensions view
|
|
23
23
|
*/
|
|
@@ -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 { ViewSection } from
|
|
18
|
-
import { ExtensionsViewItem } from
|
|
17
|
+
import { ViewSection } from '../ViewSection';
|
|
18
|
+
import { ExtensionsViewItem } from './ExtensionsViewItem';
|
|
19
19
|
/**
|
|
20
20
|
* View section containing extensions
|
|
21
21
|
*/
|
|
@@ -61,21 +61,21 @@ class ExtensionsViewSection extends ViewSection_1.ViewSection {
|
|
|
61
61
|
await this.getDriver().wait(selenium_webdriver_1.until.elementIsVisible(progress), 1000);
|
|
62
62
|
}
|
|
63
63
|
catch (err) {
|
|
64
|
-
if (err.name !==
|
|
64
|
+
if (err.name !== 'TimeoutError') {
|
|
65
65
|
throw err;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
await this.getDriver().wait(selenium_webdriver_1.until.elementIsNotVisible(progress));
|
|
69
69
|
const parent = this.enclosingItem;
|
|
70
70
|
const sectionTitle = this.getSectionForCategory(title);
|
|
71
|
-
const section = await parent.getSection(sectionTitle);
|
|
71
|
+
const section = (await parent.getSection(sectionTitle));
|
|
72
72
|
const titleParts = title.split(' ');
|
|
73
73
|
if (titleParts[0].startsWith('@')) {
|
|
74
74
|
title = titleParts.slice(1).join(' ');
|
|
75
75
|
}
|
|
76
76
|
const extensions = await section.getVisibleItems();
|
|
77
77
|
for (const extension of extensions) {
|
|
78
|
-
if (await extension.getTitle() === title) {
|
|
78
|
+
if ((await extension.getTitle()) === title) {
|
|
79
79
|
return extension;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -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 { ScmView, ScmProvider, ScmChange } from
|
|
18
|
-
import { ContextMenu } from
|
|
17
|
+
import { ScmView, ScmProvider, ScmChange } from './ScmView';
|
|
18
|
+
import { ContextMenu } from '../../menu/ContextMenu';
|
|
19
19
|
/**
|
|
20
20
|
* New SCM view for code 1.47 onwards
|
|
21
21
|
*/
|