@redhat-developer/page-objects 1.1.0 → 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 +18 -2
- package/out/components/AbstractElement.js +18 -2
- package/out/components/ElementWithContextMenu.d.ts +18 -2
- package/out/components/ElementWithContextMenu.js +16 -0
- package/out/components/WebviewMixin.d.ts +18 -2
- package/out/components/WebviewMixin.js +16 -0
- package/out/components/activityBar/ActionsControl.d.ts +19 -3
- package/out/components/activityBar/ActionsControl.js +16 -0
- package/out/components/activityBar/ActivityBar.d.ts +18 -2
- package/out/components/activityBar/ActivityBar.js +16 -0
- package/out/components/activityBar/ViewControl.d.ts +19 -3
- package/out/components/activityBar/ViewControl.js +16 -0
- package/out/components/bottomBar/AbstractViews.d.ts +20 -4
- package/out/components/bottomBar/AbstractViews.js +24 -7
- package/out/components/bottomBar/BottomBarPanel.d.ts +18 -2
- package/out/components/bottomBar/BottomBarPanel.js +18 -3
- package/out/components/bottomBar/ProblemsView.d.ts +19 -3
- package/out/components/bottomBar/ProblemsView.js +23 -5
- package/out/components/bottomBar/Views.d.ts +19 -3
- package/out/components/bottomBar/Views.js +17 -1
- package/out/components/bottomBar/WebviewView.d.ts +18 -2
- package/out/components/bottomBar/WebviewView.js +16 -0
- package/out/components/dialog/ModalDialog.d.ts +18 -2
- package/out/components/dialog/ModalDialog.js +17 -1
- package/out/components/editor/Breakpoint.d.ts +16 -0
- package/out/components/editor/Breakpoint.js +16 -0
- package/out/components/editor/ContentAssist.d.ts +17 -1
- package/out/components/editor/ContentAssist.js +22 -5
- package/out/components/editor/CustomEditor.d.ts +17 -1
- package/out/components/editor/CustomEditor.js +16 -0
- package/out/components/editor/DiffEditor.d.ts +16 -0
- package/out/components/editor/DiffEditor.js +16 -0
- package/out/components/editor/Editor.d.ts +18 -2
- package/out/components/editor/Editor.js +17 -1
- package/out/components/editor/EditorAction.d.ts +19 -3
- package/out/components/editor/EditorAction.js +16 -0
- package/out/components/editor/EditorView.d.ts +21 -5
- package/out/components/editor/EditorView.js +28 -7
- package/out/components/editor/SettingsEditor.d.ts +27 -11
- package/out/components/editor/SettingsEditor.js +36 -19
- package/out/components/editor/TextEditor.d.ts +22 -6
- package/out/components/editor/TextEditor.js +31 -13
- package/out/components/editor/WebView.d.ts +18 -2
- package/out/components/editor/WebView.js +18 -2
- package/out/components/menu/ContextMenu.d.ts +18 -2
- package/out/components/menu/ContextMenu.js +18 -2
- package/out/components/menu/MacTitleBar.d.ts +16 -0
- package/out/components/menu/MacTitleBar.js +17 -5
- package/out/components/menu/Menu.d.ts +18 -2
- package/out/components/menu/Menu.js +18 -2
- package/out/components/menu/MenuItem.d.ts +18 -2
- package/out/components/menu/MenuItem.js +17 -1
- package/out/components/menu/TitleBar.d.ts +19 -3
- package/out/components/menu/TitleBar.js +18 -2
- package/out/components/menu/WindowControls.d.ts +18 -2
- package/out/components/menu/WindowControls.js +16 -0
- package/out/components/sidebar/SideBarView.d.ts +18 -2
- package/out/components/sidebar/SideBarView.js +16 -0
- package/out/components/sidebar/ViewContent.d.ts +20 -4
- package/out/components/sidebar/ViewContent.js +17 -2
- package/out/components/sidebar/ViewItem.d.ts +19 -3
- package/out/components/sidebar/ViewItem.js +23 -7
- package/out/components/sidebar/ViewSection.d.ts +19 -3
- package/out/components/sidebar/ViewSection.js +23 -7
- package/out/components/sidebar/ViewTitlePart.d.ts +19 -3
- package/out/components/sidebar/ViewTitlePart.js +16 -0
- package/out/components/sidebar/WelcomeContent.d.ts +19 -3
- package/out/components/sidebar/WelcomeContent.js +17 -1
- package/out/components/sidebar/debug/DebugView.d.ts +19 -3
- package/out/components/sidebar/debug/DebugView.js +16 -0
- package/out/components/sidebar/extensions/ExtensionsViewItem.d.ts +20 -4
- package/out/components/sidebar/extensions/ExtensionsViewItem.js +16 -0
- package/out/components/sidebar/extensions/ExtensionsViewSection.d.ts +18 -2
- package/out/components/sidebar/extensions/ExtensionsViewSection.js +19 -3
- package/out/components/sidebar/scm/NewScmView.d.ts +18 -2
- package/out/components/sidebar/scm/NewScmView.js +30 -14
- package/out/components/sidebar/scm/ScmView.d.ts +21 -5
- package/out/components/sidebar/scm/ScmView.js +24 -8
- package/out/components/sidebar/tree/TreeSection.d.ts +19 -3
- package/out/components/sidebar/tree/TreeSection.js +20 -4
- package/out/components/sidebar/tree/custom/CustomTreeItem.d.ts +19 -3
- package/out/components/sidebar/tree/custom/CustomTreeItem.js +16 -0
- package/out/components/sidebar/tree/custom/CustomTreeSection.d.ts +21 -5
- package/out/components/sidebar/tree/custom/CustomTreeSection.js +18 -2
- package/out/components/sidebar/tree/debug/BreakpointSectionItem.d.ts +20 -4
- package/out/components/sidebar/tree/debug/BreakpointSectionItem.js +17 -1
- package/out/components/sidebar/tree/debug/DebugBreakpointSection.d.ts +20 -4
- package/out/components/sidebar/tree/debug/DebugBreakpointSection.js +16 -0
- package/out/components/sidebar/tree/debug/DebugVariablesSection.d.ts +20 -4
- package/out/components/sidebar/tree/debug/DebugVariablesSection.js +16 -0
- package/out/components/sidebar/tree/debug/SectionBreakpoint.d.ts +17 -1
- package/out/components/sidebar/tree/debug/SectionBreakpoint.js +16 -0
- package/out/components/sidebar/tree/debug/VariableSectionItem.d.ts +20 -3
- package/out/components/sidebar/tree/debug/VariableSectionItem.js +20 -0
- package/out/components/sidebar/tree/default/DefaultTreeItem.d.ts +19 -3
- package/out/components/sidebar/tree/default/DefaultTreeItem.js +16 -0
- package/out/components/sidebar/tree/default/DefaultTreeSection.d.ts +18 -2
- package/out/components/sidebar/tree/default/DefaultTreeSection.js +17 -1
- package/out/components/statusBar/StatusBar.d.ts +19 -3
- package/out/components/statusBar/StatusBar.js +17 -1
- package/out/components/workbench/DebugToolbar.d.ts +17 -1
- package/out/components/workbench/DebugToolbar.js +16 -0
- package/out/components/workbench/Notification.d.ts +19 -3
- package/out/components/workbench/Notification.js +17 -2
- package/out/components/workbench/NotificationsCenter.d.ts +18 -2
- package/out/components/workbench/NotificationsCenter.js +17 -1
- package/out/components/workbench/Workbench.d.ts +28 -12
- package/out/components/workbench/Workbench.js +17 -1
- package/out/components/workbench/input/Input.d.ts +17 -1
- package/out/components/workbench/input/Input.js +29 -20
- package/out/components/workbench/input/InputBox.d.ts +17 -1
- package/out/components/workbench/input/InputBox.js +20 -5
- package/out/components/workbench/input/QuickOpenBox.d.ts +17 -1
- package/out/components/workbench/input/QuickOpenBox.js +18 -3
- package/out/conditions/WaitForAttribute.d.ts +17 -1
- package/out/conditions/WaitForAttribute.js +16 -0
- package/out/errors/NullAttributeError.d.ts +16 -0
- package/out/errors/NullAttributeError.js +16 -0
- package/out/index.d.ts +16 -0
- package/out/index.js +16 -0
- package/out/locators/loader.d.ts +16 -0
- package/out/locators/loader.js +24 -8
- package/out/locators/locators.d.ts +24 -8
- package/out/locators/locators.js +17 -1
- package/package.json +2 -2
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
4
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
5
|
+
* this work for additional information regarding copyright ownership.
|
|
6
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
7
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
2
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
19
|
exports.ArraySettingItem = exports.ArraySetting = exports.LinkSetting = exports.CheckboxSetting = exports.TextSetting = exports.ComboSetting = exports.Setting = exports.SettingsEditor = void 0;
|
|
4
20
|
const Editor_1 = require("./Editor");
|
|
@@ -51,7 +67,7 @@ class SettingsEditor extends Editor_1.Editor {
|
|
|
51
67
|
const count = await this.findElement(SettingsEditor.locators.SettingsEditor.itemCount);
|
|
52
68
|
let textCount = await count.getText();
|
|
53
69
|
await this.getDriver().wait(async function () {
|
|
54
|
-
await new Promise(res => setTimeout(res, 1500));
|
|
70
|
+
await new Promise((res) => setTimeout(res, 1500));
|
|
55
71
|
const text = await count.getText();
|
|
56
72
|
if (text !== textCount) {
|
|
57
73
|
textCount = text;
|
|
@@ -66,7 +82,8 @@ class SettingsEditor extends Editor_1.Editor {
|
|
|
66
82
|
const itemCategory = (await (await item.findElement(SettingsEditor.locators.SettingsEditor.settingCategory)).getText()).replace(':', '');
|
|
67
83
|
const itemTitle = await (await item.findElement(SettingsEditor.locators.SettingsEditor.settingLabel)).getText();
|
|
68
84
|
if (category !== '') {
|
|
69
|
-
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()) {
|
|
70
87
|
continue;
|
|
71
88
|
}
|
|
72
89
|
}
|
|
@@ -239,7 +256,7 @@ class CheckboxSetting extends Setting {
|
|
|
239
256
|
}
|
|
240
257
|
async setValue(value) {
|
|
241
258
|
const checkbox = await this.findElement(SettingsEditor.locators.SettingsEditor.checkboxSetting);
|
|
242
|
-
if (await this.getValue() !== value) {
|
|
259
|
+
if ((await this.getValue()) !== value) {
|
|
243
260
|
await checkbox.click();
|
|
244
261
|
}
|
|
245
262
|
}
|
|
@@ -274,14 +291,14 @@ class ArraySetting extends Setting {
|
|
|
274
291
|
* @deprecated Method 'getValue' is not available for ArraySetting!
|
|
275
292
|
*/
|
|
276
293
|
async getValue() {
|
|
277
|
-
throw new Error(
|
|
294
|
+
throw new Error("Method 'getValue' is not available for ArraySetting!");
|
|
278
295
|
}
|
|
279
296
|
/**
|
|
280
297
|
* @deprecated Method 'setValue' is not available for ArraySetting!
|
|
281
298
|
*/
|
|
282
299
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
283
300
|
async setValue(value) {
|
|
284
|
-
throw new Error(
|
|
301
|
+
throw new Error("Method 'setValue' is not available for ArraySetting!");
|
|
285
302
|
}
|
|
286
303
|
/**
|
|
287
304
|
* Select a row of a setting array of string values
|
|
@@ -335,7 +352,7 @@ class ArraySetting extends Setting {
|
|
|
335
352
|
// click 'Add Item' button
|
|
336
353
|
const button = await this.findElement(SettingsEditor.locators.SettingsEditor.arrayNewRow).findElement(selenium_webdriver_1.By.className('monaco-button'));
|
|
337
354
|
await button.click();
|
|
338
|
-
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
|
|
339
356
|
// get item row switched to 'edit' mode
|
|
340
357
|
const list = await this.getListRootElement();
|
|
341
358
|
const editRow = await list.findElement(SettingsEditor.locators.SettingsEditor.arrayEditRow);
|
|
@@ -352,10 +369,10 @@ class ArraySetting extends Setting {
|
|
|
352
369
|
// select item row
|
|
353
370
|
const toEdit = new ArraySettingItem(row, this);
|
|
354
371
|
await toEdit.select();
|
|
355
|
-
// click 'Edit Item' button
|
|
372
|
+
// click 'Edit Item' button
|
|
356
373
|
const edit = await toEdit.findElement(SettingsEditor.locators.SettingsEditor.arrayBtnConstructor('Edit Item'));
|
|
357
374
|
await edit.click();
|
|
358
|
-
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
|
|
359
376
|
// get item row switched to 'edit' mode
|
|
360
377
|
const list = await this.getListRootElement();
|
|
361
378
|
const editRow = await list.findElement(SettingsEditor.locators.SettingsEditor.arrayEditRow);
|
|
@@ -382,7 +399,7 @@ class ArraySetting extends Setting {
|
|
|
382
399
|
else {
|
|
383
400
|
for (const row of listRows) {
|
|
384
401
|
const li = await row.findElement(SettingsEditor.locators.SettingsEditor.arrayRowValue);
|
|
385
|
-
if (await li.getText() === item) {
|
|
402
|
+
if ((await li.getText()) === item) {
|
|
386
403
|
return row;
|
|
387
404
|
}
|
|
388
405
|
}
|
|
@@ -403,7 +420,7 @@ class ArraySettingItem extends AbstractElement_1.AbstractElement {
|
|
|
403
420
|
*/
|
|
404
421
|
async select() {
|
|
405
422
|
await this.click();
|
|
406
|
-
await new Promise(sleep => setTimeout(sleep, 500));
|
|
423
|
+
await new Promise((sleep) => setTimeout(sleep, 500));
|
|
407
424
|
}
|
|
408
425
|
/**
|
|
409
426
|
* Get item text value
|
|
@@ -428,25 +445,25 @@ class ArraySettingItem extends AbstractElement_1.AbstractElement {
|
|
|
428
445
|
await this.select();
|
|
429
446
|
const remove = await this.findElement(SettingsEditor.locators.SettingsEditor.arrayBtnConstructor('Remove Item'));
|
|
430
447
|
await remove.click();
|
|
431
|
-
await new Promise(sleep => setTimeout(sleep, 500));
|
|
448
|
+
await new Promise((sleep) => setTimeout(sleep, 500));
|
|
432
449
|
}
|
|
433
450
|
/**
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
451
|
+
* Click 'OK' button
|
|
452
|
+
* @description Only when the item is in edit mode
|
|
453
|
+
*/
|
|
437
454
|
async ok() {
|
|
438
455
|
const ok = await this.findElement(SettingsEditor.locators.SettingsEditor.arraySettingItem.btnConstructor('OK'));
|
|
439
456
|
await ok.click();
|
|
440
|
-
await new Promise(sleep => setTimeout(sleep, 500));
|
|
457
|
+
await new Promise((sleep) => setTimeout(sleep, 500));
|
|
441
458
|
}
|
|
442
459
|
/**
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
460
|
+
* Click 'Cancel' button
|
|
461
|
+
* @description Only when the item is in edit mode
|
|
462
|
+
*/
|
|
446
463
|
async cancel() {
|
|
447
464
|
const cancel = await this.findElement(SettingsEditor.locators.SettingsEditor.arraySettingItem.btnConstructor('Cancel'));
|
|
448
465
|
await cancel.click();
|
|
449
|
-
await new Promise(sleep => setTimeout(sleep, 500));
|
|
466
|
+
await new Promise((sleep) => setTimeout(sleep, 500));
|
|
450
467
|
}
|
|
451
468
|
}
|
|
452
469
|
exports.ArraySettingItem = ArraySettingItem;
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { 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';
|
|
7
23
|
export declare class BreakpointError extends Error {
|
|
8
24
|
}
|
|
9
25
|
/**
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
4
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
5
|
+
* this work for additional information regarding copyright ownership.
|
|
6
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
7
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
2
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
19
|
exports.FindWidget = exports.CodeLens = exports.TextEditor = exports.BreakpointError = void 0;
|
|
4
20
|
const __1 = require("../..");
|
|
@@ -83,7 +99,9 @@ class TextEditor extends Editor_1.Editor {
|
|
|
83
99
|
await this.getDriver().wait(selenium_webdriver_1.until.elementLocated(TextEditor.locators.ContentAssist.constructor), 2000);
|
|
84
100
|
}
|
|
85
101
|
const assist = await new __1.ContentAssist(this).wait();
|
|
86
|
-
await this.getDriver().wait(() => {
|
|
102
|
+
await this.getDriver().wait(() => {
|
|
103
|
+
return assist.isLoaded();
|
|
104
|
+
}, 10000);
|
|
87
105
|
return assist;
|
|
88
106
|
}
|
|
89
107
|
else {
|
|
@@ -108,7 +126,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
108
126
|
}
|
|
109
127
|
const inputarea = await this.findElement(TextEditor.locators.Editor.inputArea);
|
|
110
128
|
await inputarea.sendKeys(selenium_webdriver_1.Key.chord(TextEditor.ctlKey, 'a'), selenium_webdriver_1.Key.chord(TextEditor.ctlKey, 'c'));
|
|
111
|
-
await new Promise(res => setTimeout(res, 500));
|
|
129
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
112
130
|
const text = clipboard.readSync();
|
|
113
131
|
await inputarea.sendKeys(selenium_webdriver_1.Key.UP);
|
|
114
132
|
if (originalClipboard.length > 0) {
|
|
@@ -171,7 +189,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
171
189
|
* @returns Promise resolving when the text is typed in
|
|
172
190
|
*/
|
|
173
191
|
async setTextAtLine(line, text) {
|
|
174
|
-
if (line < 1 || line > await this.getNumberOfLines()) {
|
|
192
|
+
if (line < 1 || line > (await this.getNumberOfLines())) {
|
|
175
193
|
throw new Error(`Line number ${line} does not exist`);
|
|
176
194
|
}
|
|
177
195
|
const lines = (await this.getText()).split('\n');
|
|
@@ -225,7 +243,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
225
243
|
}
|
|
226
244
|
actions = actions.keyUp(selenium_webdriver_1.Key.SHIFT);
|
|
227
245
|
await actions.perform();
|
|
228
|
-
await new Promise(res => setTimeout(res, 500));
|
|
246
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
229
247
|
}
|
|
230
248
|
/**
|
|
231
249
|
* Get the text that is currently selected as string
|
|
@@ -251,10 +269,10 @@ class TextEditor extends Editor_1.Editor {
|
|
|
251
269
|
else {
|
|
252
270
|
const inputarea = await this.findElement(TextEditor.locators.Editor.inputArea);
|
|
253
271
|
await inputarea.sendKeys(selenium_webdriver_1.Key.chord(TextEditor.ctlKey, 'c'));
|
|
254
|
-
await new Promise(res => setTimeout(res, 500));
|
|
272
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
255
273
|
await inputarea.sendKeys(selenium_webdriver_1.Key.UP);
|
|
256
274
|
}
|
|
257
|
-
await new Promise(res => setTimeout(res, 500));
|
|
275
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
258
276
|
const text = clipboard.readSync();
|
|
259
277
|
if (originalClipboard.length > 0) {
|
|
260
278
|
clipboard.writeSync(originalClipboard);
|
|
@@ -307,7 +325,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
307
325
|
* @returns Promise resolving when the cursor has reached the given coordinates
|
|
308
326
|
*/
|
|
309
327
|
async moveCursor(line, column) {
|
|
310
|
-
if (line < 1 || line > await this.getNumberOfLines()) {
|
|
328
|
+
if (line < 1 || line > (await this.getNumberOfLines())) {
|
|
311
329
|
throw new Error(`Line number ${line} does not exist`);
|
|
312
330
|
}
|
|
313
331
|
if (column < 1) {
|
|
@@ -378,7 +396,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
378
396
|
return new __1.ContextMenu(await shadowRoot.findElement(selenium_webdriver_1.By.className('monaco-menu-container'))).wait();
|
|
379
397
|
}
|
|
380
398
|
else {
|
|
381
|
-
shadowRoot = await this.getDriver().executeScript('return arguments[0].shadowRoot', shadowRootHost[0]);
|
|
399
|
+
shadowRoot = (await this.getDriver().executeScript('return arguments[0].shadowRoot', shadowRootHost[0]));
|
|
382
400
|
return new __1.ContextMenu(shadowRoot).wait();
|
|
383
401
|
}
|
|
384
402
|
}
|
|
@@ -414,7 +432,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
414
432
|
if (breakPoint.length > 0) {
|
|
415
433
|
if (this.breakPoints.indexOf(line) !== -1) {
|
|
416
434
|
await breakPoint[this.breakPoints.indexOf(line)].click();
|
|
417
|
-
await new Promise(res => setTimeout(res, 200));
|
|
435
|
+
await new Promise((res) => setTimeout(res, 200));
|
|
418
436
|
this.breakPoints.splice(this.breakPoints.indexOf(line), 1);
|
|
419
437
|
return false;
|
|
420
438
|
}
|
|
@@ -422,7 +440,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
422
440
|
const noBreak = await breakpointContainer.findElements(TextEditor.locators.TextEditor.debugHint);
|
|
423
441
|
if (noBreak.length > 0) {
|
|
424
442
|
await noBreak[0].click();
|
|
425
|
-
await new Promise(res => setTimeout(res, 200));
|
|
443
|
+
await new Promise((res) => setTimeout(res, 200));
|
|
426
444
|
this.breakPoints.push(line);
|
|
427
445
|
return true;
|
|
428
446
|
}
|
|
@@ -474,7 +492,7 @@ class TextEditor extends Editor_1.Editor {
|
|
|
474
492
|
*/
|
|
475
493
|
async getCodeLens(indexOrTitle) {
|
|
476
494
|
const lenses = await this.getCodeLenses();
|
|
477
|
-
if (typeof
|
|
495
|
+
if (typeof indexOrTitle === 'string') {
|
|
478
496
|
for (const lens of lenses) {
|
|
479
497
|
const title = await lens.getText();
|
|
480
498
|
const match = title.match(indexOrTitle);
|
|
@@ -510,7 +528,7 @@ class Selection extends ElementWithContextMenu_1.ElementWithContexMenu {
|
|
|
510
528
|
return new __1.ContextMenu(await shadowRoot.findElement(selenium_webdriver_1.By.className('monaco-menu-container'))).wait();
|
|
511
529
|
}
|
|
512
530
|
else {
|
|
513
|
-
shadowRoot = await this.getDriver().executeScript('return arguments[0].shadowRoot', shadowRootHost[0]);
|
|
531
|
+
shadowRoot = (await this.getDriver().executeScript('return arguments[0].shadowRoot', shadowRootHost[0]));
|
|
514
532
|
return new __1.ContextMenu(shadowRoot).wait();
|
|
515
533
|
}
|
|
516
534
|
}
|
|
@@ -544,7 +562,7 @@ class FindWidget extends AbstractElement_1.AbstractElement {
|
|
|
544
562
|
async toggleReplace(replace) {
|
|
545
563
|
const btn = await this.findElement(FindWidget.locators.FindWidget.toggleReplace);
|
|
546
564
|
const klass = await btn.getAttribute('class');
|
|
547
|
-
if (replace && klass.includes('collapsed') || !replace && !klass.includes('collapsed')) {
|
|
565
|
+
if ((replace && klass.includes('collapsed')) || (!replace && !klass.includes('collapsed'))) {
|
|
548
566
|
await btn.sendKeys(selenium_webdriver_1.Key.SPACE);
|
|
549
567
|
const repl = await this.getDriver().wait(selenium_webdriver_1.until.elementLocated(FindWidget.locators.FindWidget.replacePart), 2000);
|
|
550
568
|
if (replace) {
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { WebElement } from 'selenium-webdriver';
|
|
18
|
+
import { Editor } from './Editor';
|
|
3
19
|
/**
|
|
4
20
|
* Page object representing an open editor containing a web view
|
|
5
21
|
*/
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
4
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
5
|
+
* this work for additional information regarding copyright ownership.
|
|
6
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
7
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
2
18
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
19
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
20
|
};
|
|
@@ -24,7 +40,7 @@ class WebViewBase extends Editor_1.Editor {
|
|
|
24
40
|
await this.getDriver().switchTo().window(handle);
|
|
25
41
|
const reference = await this.findElement(WebViewBase.locators.EditorView.webView);
|
|
26
42
|
const containers = await this.getDriver().wait(selenium_webdriver_1.until.elementsLocated(WebViewBase.locators.WebView.container(await reference.getAttribute(WebViewBase.locators.WebView.attribute))), 5000);
|
|
27
|
-
return await containers[0].getDriver().wait(async () => {
|
|
43
|
+
return (await containers[0].getDriver().wait(async () => {
|
|
28
44
|
for (const container of containers) {
|
|
29
45
|
const tries = await container.findElements(WebViewBase.locators.WebView.iframe);
|
|
30
46
|
if (tries.length > 0) {
|
|
@@ -32,7 +48,7 @@ class WebViewBase extends Editor_1.Editor {
|
|
|
32
48
|
}
|
|
33
49
|
}
|
|
34
50
|
return undefined;
|
|
35
|
-
}, 5000);
|
|
51
|
+
}, 5000));
|
|
36
52
|
}
|
|
37
53
|
}
|
|
38
54
|
exports.WebView = (0, WebviewMixin_1.default)(WebViewBase);
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Menu, MenuItem } from '../..';
|
|
18
|
+
import { WebElement } from 'selenium-webdriver';
|
|
3
19
|
/**
|
|
4
20
|
* Object representing a context menu
|
|
5
21
|
*/
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
4
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
5
|
+
* this work for additional information regarding copyright ownership.
|
|
6
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
7
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
2
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
19
|
exports.ContextMenuItem = exports.ContextMenu = void 0;
|
|
4
20
|
const __1 = require("../..");
|
|
@@ -19,7 +35,7 @@ class ContextMenu extends __1.Menu {
|
|
|
19
35
|
try {
|
|
20
36
|
const items = await this.getItems();
|
|
21
37
|
for (const item of items) {
|
|
22
|
-
if (await item.getLabel() === name) {
|
|
38
|
+
if ((await item.getLabel()) === name) {
|
|
23
39
|
return item;
|
|
24
40
|
}
|
|
25
41
|
}
|
|
@@ -100,7 +116,7 @@ class ContextMenuItem extends __1.MenuItem {
|
|
|
100
116
|
}
|
|
101
117
|
async select() {
|
|
102
118
|
await this.click();
|
|
103
|
-
await new Promise(res => setTimeout(res, 500));
|
|
119
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
104
120
|
if (await this.isNesting()) {
|
|
105
121
|
return await new ContextMenu(this).wait();
|
|
106
122
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
1
17
|
/**
|
|
2
18
|
* Handler object for macOS based title bar
|
|
3
19
|
*/
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
4
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
5
|
+
* this work for additional information regarding copyright ownership.
|
|
6
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
7
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
2
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
19
|
exports.MacTitleBar = void 0;
|
|
4
20
|
const child_process_1 = require("child_process");
|
|
@@ -18,11 +34,7 @@ class MacTitleBar {
|
|
|
18
34
|
*/
|
|
19
35
|
static select(...items) {
|
|
20
36
|
let menuCounter = 0;
|
|
21
|
-
const commands = [
|
|
22
|
-
`tell application "System Events"`,
|
|
23
|
-
`tell process "Code"`,
|
|
24
|
-
`tell menu bar item "${items[0]}" of menu bar 1`
|
|
25
|
-
];
|
|
37
|
+
const commands = [`tell application "System Events"`, `tell process "Code"`, `tell menu bar item "${items[0]}" of menu bar 1`];
|
|
26
38
|
for (let i = 1; i < items.length - 1; i++) {
|
|
27
39
|
commands.push(`tell menu item "${items[i]}" of menu 1`);
|
|
28
40
|
++menuCounter;
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { AbstractElement } from '../AbstractElement';
|
|
18
|
+
import { MenuItem } from './MenuItem';
|
|
3
19
|
/**
|
|
4
20
|
* Abstract element representing a menu
|
|
5
21
|
*/
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
4
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
5
|
+
* this work for additional information regarding copyright ownership.
|
|
6
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
7
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
2
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
19
|
exports.Menu = void 0;
|
|
4
20
|
const AbstractElement_1 = require("../AbstractElement");
|
|
@@ -13,7 +29,7 @@ class Menu extends AbstractElement_1.AbstractElement {
|
|
|
13
29
|
*/
|
|
14
30
|
async hasItem(name) {
|
|
15
31
|
const item = await this.getItem(name);
|
|
16
|
-
return !!item &&
|
|
32
|
+
return !!item && item.isDisplayed();
|
|
17
33
|
}
|
|
18
34
|
/**
|
|
19
35
|
* Recursively select an item with a given path.
|
|
@@ -37,7 +53,7 @@ class Menu extends AbstractElement_1.AbstractElement {
|
|
|
37
53
|
return parent;
|
|
38
54
|
}
|
|
39
55
|
await Menu.driver.wait(async function () {
|
|
40
|
-
return await item.isDisplayed() && await item.isEnabled();
|
|
56
|
+
return (await item.isDisplayed()) && (await item.isEnabled());
|
|
41
57
|
});
|
|
42
58
|
const submenu = await item.select();
|
|
43
59
|
if (submenu) {
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { AbstractElement } from '../AbstractElement';
|
|
18
|
+
import { Menu } from './Menu';
|
|
3
19
|
/**
|
|
4
20
|
* Abstract element representing a menu item
|
|
5
21
|
*/
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
4
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
5
|
+
* this work for additional information regarding copyright ownership.
|
|
6
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
7
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
8
|
+
* the License. You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
2
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
19
|
exports.MenuItem = void 0;
|
|
4
20
|
const AbstractElement_1 = require("../AbstractElement");
|
|
@@ -16,7 +32,7 @@ class MenuItem extends AbstractElement_1.AbstractElement {
|
|
|
16
32
|
*/
|
|
17
33
|
async select() {
|
|
18
34
|
await this.click();
|
|
19
|
-
await new Promise(res => setTimeout(res, 500));
|
|
35
|
+
await new Promise((res) => setTimeout(res, 500));
|
|
20
36
|
return undefined;
|
|
21
37
|
}
|
|
22
38
|
/**
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
* (the "License", destination); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { WindowControls, ContextMenu } from '../..';
|
|
18
|
+
import { Menu } from './Menu';
|
|
19
|
+
import { MenuItem } from './MenuItem';
|
|
4
20
|
/**
|
|
5
21
|
* Page object representing the custom VS Code title bar
|
|
6
22
|
*/
|