monaco-page-objects
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -106,4 +106,10 @@ "use strict"; | ||
try { | ||
const tab = tabContainer.findElement(BottomBarPanel.locators.BottomBarPanel.tab(title)); | ||
yield tab.click(); | ||
const tabs = yield tabContainer.findElements(BottomBarPanel.locators.BottomBarPanel.tab(title)); | ||
if (tabs.length > 0) { | ||
yield tabs[0].click(); | ||
} | ||
else { | ||
const label = yield tabContainer.findElement(selenium_webdriver_1.By.xpath(`.//a[starts-with(@aria-label, '${title}')]`)); | ||
yield label.click(); | ||
} | ||
} | ||
@@ -110,0 +116,0 @@ catch (err) { |
@@ -49,7 +49,8 @@ import { BottomBarPanel, ContentAssist } from "../.."; | ||
/** | ||
* Execute command in the internal terminal | ||
* Execute command in the internal terminal and wait for results | ||
* @param command text of the command | ||
* @returns Promise resolving when the command is filled in and enter is pressed | ||
* @param timeout optional maximum time to wait for completion in milliseconds, 0 for unlimited | ||
* @returns Promise resolving when the command is finished | ||
*/ | ||
executeCommand(command: string): Promise<void>; | ||
executeCommand(command: string, timeout?: number): Promise<void>; | ||
/** | ||
@@ -56,0 +57,0 @@ * Get all text from the internal terminal |
@@ -104,10 +104,27 @@ "use strict"; | ||
/** | ||
* Execute command in the internal terminal | ||
* Execute command in the internal terminal and wait for results | ||
* @param command text of the command | ||
* @returns Promise resolving when the command is filled in and enter is pressed | ||
* @param timeout optional maximum time to wait for completion in milliseconds, 0 for unlimited | ||
* @returns Promise resolving when the command is finished | ||
*/ | ||
executeCommand(command) { | ||
executeCommand(command, timeout = 0) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const input = yield this.findElement(TerminalView.locators.TerminalView.textArea); | ||
try { | ||
yield input.clear(); | ||
} | ||
catch (err) { | ||
// try clearing, ignore if not available | ||
} | ||
yield input.sendKeys(command, selenium_webdriver_1.Key.ENTER); | ||
let timer = 0; | ||
let style = yield input.getCssValue('left'); | ||
do { | ||
if (timeout > 0 && timer > timeout) { | ||
throw new Error(`Timeout of ${timeout}ms exceeded`); | ||
} | ||
yield new Promise(res => setTimeout(res, 500)); | ||
timer += 500; | ||
style = yield input.getCssValue('left'); | ||
} while (style === '0px'); | ||
}); | ||
@@ -114,0 +131,0 @@ } |
@@ -273,3 +273,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new Error('Value not available in settings editor.'); | ||
throw new Error('Method getValue is not available for LinkSetting'); | ||
}); | ||
@@ -279,3 +279,3 @@ } | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new Error('Value not available in settings editor.'); | ||
throw new Error('Method setValue is not available for LinkSetting'); | ||
}); | ||
@@ -282,0 +282,0 @@ } |
@@ -494,3 +494,4 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.clickButton('Next match', 'find'); | ||
const name = TextEditor.versionInfo.version < '1.59.0' ? 'Next match' : 'Next Match'; | ||
yield this.clickButton(name, 'find'); | ||
}); | ||
@@ -503,3 +504,4 @@ } | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.clickButton('Previous match', 'find'); | ||
const name = TextEditor.versionInfo.version < '1.59.0' ? 'Previous match' : 'Previous Match'; | ||
yield this.clickButton(name, 'find'); | ||
}); | ||
@@ -506,0 +508,0 @@ } |
@@ -37,4 +37,9 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const version = yield this.findElement(ExtensionsViewItem.locators.ExtensionsViewItem.version); | ||
return version.getText(); | ||
const version = yield this.findElements(ExtensionsViewItem.locators.ExtensionsViewItem.version); | ||
if (version.length > 0) { | ||
return version[0].getText(); | ||
} | ||
const label = yield this.getAttribute('aria-label'); | ||
const ver = label.split(',')[1].trim(); | ||
return ver; | ||
}); | ||
@@ -41,0 +46,0 @@ } |
{ | ||
"name": "monaco-page-objects", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "Page Objects for Monaco Editor", | ||
@@ -33,15 +33,15 @@ "main": "out/index.js", | ||
"@types/clone-deep": "^4.0.1", | ||
"@types/fs-extra": "^9.0.1", | ||
"@types/fs-extra": "^9.0.12", | ||
"@types/node": "^14.11.2", | ||
"@types/selenium-webdriver": "^3.0.15", | ||
"rimraf": "^3.0.0", | ||
"typedoc": "^0.19.2", | ||
"typescript": "4.0.3" | ||
"typedoc": "^0.21.4", | ||
"typescript": "4.3.5" | ||
}, | ||
"dependencies": { | ||
"clipboardy": "^2.0.0", | ||
"clipboardy": "^2.3.0", | ||
"clone-deep": "^4.0.1", | ||
"compare-versions": "^3.5.1", | ||
"fs-extra": "^9.0.1", | ||
"ts-essentials": "^7.0.0" | ||
"fs-extra": "^10.0.0", | ||
"ts-essentials": "^7.0.2" | ||
}, | ||
@@ -48,0 +48,0 @@ "peerDependencies": { |
346223
8617
+ Addedfs-extra@10.1.0(transitive)
- Removedat-least-node@1.0.0(transitive)
- Removedfs-extra@9.1.0(transitive)
Updatedclipboardy@^2.3.0
Updatedfs-extra@^10.0.0
Updatedts-essentials@^7.0.2