@redhat-developer/locators
Version:
Pluggable Page Objects locators for an ExTester framework.
582 lines • 31.8 kB
JavaScript
;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License", destination); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.locators = void 0;
const page_objects_1 = require("@redhat-developer/page-objects");
const selenium_webdriver_1 = require("selenium-webdriver");
const abstractElement = {
AbstractElement: {
enabled: (0, page_objects_1.hasNotClass)('disabled'),
selected: (0, page_objects_1.hasAttribute)('aria-selected', 'true'),
tag: selenium_webdriver_1.By.css('html'),
},
};
const activityBar = {
ActivityBar: {
constructor: selenium_webdriver_1.By.id('workbench.parts.activitybar'),
viewContainer: selenium_webdriver_1.By.xpath(`.//ul[@aria-label='Active View Switcher']`),
label: 'aria-label',
actionsContainer: selenium_webdriver_1.By.xpath(`.//ul[@aria-label='Manage']`),
actionItem: selenium_webdriver_1.By.className('action-item'),
},
ViewControl: {
attribute: 'class',
klass: 'checked',
scmId: selenium_webdriver_1.By.id('workbench.view.scm'),
debugId: selenium_webdriver_1.By.id('workbench.view.debug'),
badge: selenium_webdriver_1.By.className('badge'),
},
};
const bottomBar = {
BottomBarPanel: {
constructor: selenium_webdriver_1.By.id('workbench.parts.panel'),
problemsTab: 'Problems',
outputTab: 'Output',
debugTab: 'Debug Console',
terminalTab: 'Terminal',
maximize: 'Maximize Panel Size',
restore: 'Restore Panel Size',
close: 'Close Panel',
tabContainer: selenium_webdriver_1.By.className('panel-switcher-container'),
tab: (title) => selenium_webdriver_1.By.xpath(`.//li[starts-with(@title, '${title}')]`),
actions: selenium_webdriver_1.By.className('title-actions'),
globalActions: selenium_webdriver_1.By.className('title-actions'),
action: (label) => selenium_webdriver_1.By.xpath(`.//a[starts-with(@title, '${label}')]`),
closeAction: selenium_webdriver_1.By.className('codicon-panel-close'),
openTabElement: (title) => selenium_webdriver_1.By.xpath(`.//a[starts-with(@aria-label, '${title}')]`),
},
BottomBarViews: {
actionsContainer: (label) => selenium_webdriver_1.By.xpath(`.//ul[@aria-label='${label}']`),
channelOption: selenium_webdriver_1.By.css('option'),
channelCombo: selenium_webdriver_1.By.css('select'),
channelText: selenium_webdriver_1.By.className('option-text'),
channelRow: selenium_webdriver_1.By.className('monaco-list-row'),
textArea: selenium_webdriver_1.By.css('textarea'),
clearText: selenium_webdriver_1.By.className('clear-output'),
},
ProblemsView: {
constructor: selenium_webdriver_1.By.id('workbench.panel.markers'),
markersFilter: selenium_webdriver_1.By.className('markers-panel-action-filter'),
input: selenium_webdriver_1.By.css('input'),
collapseAll: selenium_webdriver_1.By.className('collapse-all'),
markerRow: selenium_webdriver_1.By.className('monaco-list-row'),
rowLabel: 'aria-label',
label: selenium_webdriver_1.By.className('monaco-highlighted-label'),
markerTwistie: selenium_webdriver_1.By.className('monaco-tl-twistie'),
changeCount: selenium_webdriver_1.By.className('monaco-count-badge'),
},
TerminalView: {
constructor: selenium_webdriver_1.By.id('workbench.panel.terminal'),
actionsLabel: 'Terminal actions',
textArea: selenium_webdriver_1.By.className('xterm-helper-textarea'),
killTerminal: selenium_webdriver_1.By.xpath(`.//a[@title='Kill Terminal']`),
newTerminal: selenium_webdriver_1.By.xpath(`.//a[starts-with(@title,'New Terminal')]`),
tabList: selenium_webdriver_1.By.className('tabs-list'),
singleTab: selenium_webdriver_1.By.className('single-terminal-tab'),
selectedRow: selenium_webdriver_1.By.className('monaco-list-row selected'),
row: selenium_webdriver_1.By.className('monaco-list-row'),
newCommand: 'terminal: create new integrated terminal',
},
DebugConsoleView: {
constructor: selenium_webdriver_1.By.id('workbench.panel.repl'),
},
OutputView: {
constructor: selenium_webdriver_1.By.id('workbench.panel.output'),
actionsLabel: 'Output actions',
optionByName: (name) => selenium_webdriver_1.By.xpath(`.//option[@value='${name}']`),
currentChannelAttribute: 'title',
},
WebviewView: {
iframe: selenium_webdriver_1.By.xpath(`//div[not(@class)]/iframe[@class='webview ready' and not(@data-parent-flow-to-element-id)]`),
},
};
const editor = {
EditorView: {
constructor: selenium_webdriver_1.By.id('workbench.parts.editor'),
editorGroup: selenium_webdriver_1.By.className('editor-group-container'),
settingsEditor: selenium_webdriver_1.By.id('workbench.editor.settings2'),
webView: selenium_webdriver_1.By.id('WebviewEditor'),
diffEditor: selenium_webdriver_1.By.className('monaco-diff-editor'),
tab: selenium_webdriver_1.By.className('tab'),
closeTab: selenium_webdriver_1.By.className('tab-close'),
tabTitle: 'title',
tabSeparator: ', tab',
tabLabel: 'aria-label',
actionContainer: selenium_webdriver_1.By.className('editor-actions'),
actionItem: selenium_webdriver_1.By.className('action-label'),
attribute: 'title',
dropdown: 'aria-haspopup',
},
Editor: {
constructor: selenium_webdriver_1.By.className('editor-instance'),
inputArea: selenium_webdriver_1.By.className('inputarea'),
title: selenium_webdriver_1.By.className('label-name'),
},
TextEditor: {
activeTab: selenium_webdriver_1.By.css('div.tab.active'),
breakpoint: {
pauseSelector: selenium_webdriver_1.By.className('codicon-debug-stackframe'),
generalSelector: selenium_webdriver_1.By.className('codicon-debug-breakpoint'),
properties: {
enabled: (0, page_objects_1.hasNotClass)('codicon-debug-breakpoint-unverified'),
line: {
selector: selenium_webdriver_1.By.className('line-numbers'),
number: (line) => line.getText().then((line) => Number.parseInt(line)),
},
paused: (0, page_objects_1.hasClass)('codicon-debug-stackframe'),
},
},
editorContainer: selenium_webdriver_1.By.className('monaco-editor'),
dataUri: 'data-uri',
formatDoc: 'Format Document',
marginArea: selenium_webdriver_1.By.className('margin-view-overlays'),
lineNumber: (line) => selenium_webdriver_1.By.xpath(`.//div[contains(@class, 'line-numbers') and text() = '${line}']`),
lineOverlay: (line) => selenium_webdriver_1.By.xpath(`.//div[contains(@class, 'line-numbers') and text() = '${line}']/..`),
debugHint: selenium_webdriver_1.By.className('codicon-debug-hint'),
selection: selenium_webdriver_1.By.className('cslr selected-text top-left-radius bottom-left-radius top-right-radius bottom-right-radius'),
findWidget: selenium_webdriver_1.By.className('find-widget'),
shadowRootHost: selenium_webdriver_1.By.className('shadow-root-host'),
monacoMenuContainer: selenium_webdriver_1.By.className('monaco-menu-container'),
glyphMarginWidget: selenium_webdriver_1.By.className('glyph-margin-widgets'),
lineElement: (styleTopAttr) => selenium_webdriver_1.By.xpath(`.//div[contains(@style, "${styleTopAttr}")]`),
contentWidgets: selenium_webdriver_1.By.className('contentWidgets'),
contentWidgetsElements: selenium_webdriver_1.By.xpath(`.//span[contains(@widgetid, 'codelens.widget')]/a[@id]`),
elementLevelBack: selenium_webdriver_1.By.xpath('./..'),
},
FindWidget: {
toggleReplace: selenium_webdriver_1.By.xpath(`.//div[@title="Toggle Replace mode"]`),
replacePart: selenium_webdriver_1.By.className('replace-part'),
findPart: selenium_webdriver_1.By.className('find-part'),
matchCount: selenium_webdriver_1.By.className('matchesCount'),
input: selenium_webdriver_1.By.css('textarea'),
content: selenium_webdriver_1.By.className('mirror'),
button: (title) => selenium_webdriver_1.By.xpath(`.//div[@role='button' and starts-with(@title, "${title}")]`),
checkbox: (title) => selenium_webdriver_1.By.xpath(`.//div[@role='checkbox' and starts-with(@title, "${title}")]`),
nextMatch: 'Next match',
previousMatch: 'Previous match',
closePart: 'find',
},
ContentAssist: {
constructor: selenium_webdriver_1.By.className('suggest-widget'),
message: selenium_webdriver_1.By.className('message'),
itemRows: selenium_webdriver_1.By.className('monaco-list-rows'),
itemRow: selenium_webdriver_1.By.className('monaco-list-row'),
itemLabel: selenium_webdriver_1.By.className('label-name'),
itemText: selenium_webdriver_1.By.xpath(`./span/span`),
itemList: selenium_webdriver_1.By.className('monaco-list'),
firstItem: selenium_webdriver_1.By.xpath(`.//div[@data-index='0']`),
},
SettingsEditor: {
title: 'Settings',
itemRow: selenium_webdriver_1.By.className('monaco-list-row'),
header: selenium_webdriver_1.By.className('settings-header'),
tabs: selenium_webdriver_1.By.className('settings-tabs-widget'),
actions: selenium_webdriver_1.By.className('actions-container'),
action: (label) => selenium_webdriver_1.By.xpath(`.//a[@title='${label}']`),
settingConstructor: (title, category) => selenium_webdriver_1.By.xpath(`.//div[@class='monaco-tl-row' and .//span/text()='${title}' and .//span/text()='${category}: ']`),
settingDescription: selenium_webdriver_1.By.className('setting-item-description'),
settingLabel: selenium_webdriver_1.By.className('setting-item-label'),
settingCategory: selenium_webdriver_1.By.className('setting-item-category'),
comboSetting: selenium_webdriver_1.By.css('select'),
comboOption: selenium_webdriver_1.By.css('option'),
comboValue: 'value',
textSetting: selenium_webdriver_1.By.css('input'),
checkboxSetting: selenium_webdriver_1.By.className('setting-value-checkbox'),
checkboxChecked: 'aria-checked',
linkButton: selenium_webdriver_1.By.className('edit-in-settings-button'),
itemCount: selenium_webdriver_1.By.className('settings-count-widget'),
arraySetting: selenium_webdriver_1.By.className('setting-item-control'),
arrayRoot: selenium_webdriver_1.By.xpath(`.//div[@role='list' and contains(@class, 'setting-list-widget')]`),
arrayRow: selenium_webdriver_1.By.className('setting-list-row'),
arrayRowValue: selenium_webdriver_1.By.className('setting-list-value'),
arrayNewRow: selenium_webdriver_1.By.className('setting-list-new-row'),
arrayEditRow: selenium_webdriver_1.By.className('setting-list-edit-row'),
arrayBtnConstructor: (label) => selenium_webdriver_1.By.xpath(`.//a[contains(@role, 'button') and @aria-label='${label}']`),
arraySettingItem: {
btnConstructor: (label) => selenium_webdriver_1.By.xpath(`.//a[contains(@role, 'button') and text()='${label}']`),
},
button: selenium_webdriver_1.By.className('monaco-button'),
},
DiffEditor: {
originalEditor: selenium_webdriver_1.By.className('original-in-monaco-diff-editor'),
modifiedEditor: selenium_webdriver_1.By.className('modified-in-monaco-diff-editor'),
},
WebView: {
iframe: selenium_webdriver_1.By.css(`iframe[class='webview ready']`),
activeFrame: selenium_webdriver_1.By.id('active-frame'),
},
ExtensionEditorView: {
constructor: selenium_webdriver_1.By.className('extension-editor'),
name: selenium_webdriver_1.By.className('name'),
version: selenium_webdriver_1.By.className('version'),
publisher: selenium_webdriver_1.By.className('publisher-name'),
description: selenium_webdriver_1.By.className('description'),
count: selenium_webdriver_1.By.className('count'),
navbar: selenium_webdriver_1.By.className('navbar'),
tab: selenium_webdriver_1.By.className('action-label'),
activeTab: selenium_webdriver_1.By.xpath(`.//a[starts-with(@class, 'action-label checked')]`),
specificTab: (tabname) => selenium_webdriver_1.By.xpath(`.//a[starts-with(@class, 'action-label') and text()='${tabname}']`),
},
ExtensionEditorDetailsSection: {
categoriesContainer: selenium_webdriver_1.By.className('categories'),
category: selenium_webdriver_1.By.className('category'),
resourcesContainer: selenium_webdriver_1.By.className('resources'),
resource: selenium_webdriver_1.By.className('resource'),
moreInfoContainer: selenium_webdriver_1.By.className('more-info'),
moreInfo: selenium_webdriver_1.By.className('more-info-entry'),
moreInfoElements: selenium_webdriver_1.By.xpath('./*'),
readmeContent: selenium_webdriver_1.By.css('body'),
},
EditorAction: {
shadowRootHost: selenium_webdriver_1.By.className('shadow-root-host'),
monacoMenuContainer: selenium_webdriver_1.By.className('monaco-menu-container'),
},
};
const menu = {
ContextMenu: {
contextView: selenium_webdriver_1.By.className('context-view'),
constructor: selenium_webdriver_1.By.className('monaco-menu-container'),
itemConstructor: (label) => selenium_webdriver_1.By.xpath(`.//li[a/span/@aria-label="${label}"]`),
itemElement: selenium_webdriver_1.By.className('action-item'),
itemLabel: selenium_webdriver_1.By.className('action-label'),
itemText: 'aria-label',
itemNesting: selenium_webdriver_1.By.className('submenu-indicator'),
viewBlock: selenium_webdriver_1.By.className('context-view-block'),
shadowRootHost: selenium_webdriver_1.By.className('shadow-root-host'),
},
TitleBar: {
constructor: selenium_webdriver_1.By.id('workbench.parts.titlebar'),
itemConstructor: (label) => selenium_webdriver_1.By.xpath(`.//div[@aria-label="${label}"]`),
itemElement: selenium_webdriver_1.By.className('menubar-menu-button'),
itemLabel: 'aria-label',
title: selenium_webdriver_1.By.className('window-title'),
},
WindowControls: {
constructor: selenium_webdriver_1.By.className('window-controls-container'),
minimize: selenium_webdriver_1.By.className('window-minimize'),
maximize: selenium_webdriver_1.By.className('window-maximize'),
restore: selenium_webdriver_1.By.className('window-unmaximize'),
close: selenium_webdriver_1.By.className('window-close'),
},
};
const sideBar = {
SideBarView: {
constructor: selenium_webdriver_1.By.id('workbench.parts.sidebar'),
},
ViewTitlePart: {
constructor: selenium_webdriver_1.By.className('composite title'),
title: selenium_webdriver_1.By.css('h2'),
action: selenium_webdriver_1.By.className(`action-label`),
actionLabel: 'title',
actionConstructor: (title) => selenium_webdriver_1.By.xpath(`.//a[@title='${title}']`),
},
ViewContent: {
constructor: selenium_webdriver_1.By.className('content'),
progress: selenium_webdriver_1.By.className('monaco-progress-container'),
section: selenium_webdriver_1.By.className('split-view-view'),
defaultView: selenium_webdriver_1.By.className('explorer-folders-view'),
extensionsView: selenium_webdriver_1.By.className('extensions-list'),
},
ViewSection: {
title: selenium_webdriver_1.By.className('title'),
titleText: 'textContent',
header: selenium_webdriver_1.By.className('panel-header'),
headerExpanded: 'aria-expanded',
headerCollapseExpandButton: selenium_webdriver_1.By.className('twisty-container'),
actions: selenium_webdriver_1.By.className('actions'),
actionConstructor: (label) => selenium_webdriver_1.By.xpath(`.//a[contains(@class, 'action-label') and @role='button' and @title='${label}']`),
button: selenium_webdriver_1.By.xpath(`.//a[@role='button']`),
buttonLabel: 'title',
level: 'aria-level',
index: 'data-index',
welcomeContent: selenium_webdriver_1.By.className('welcome-view'),
shadowRootHost: selenium_webdriver_1.By.className('shadow-root-host'),
monacoMenuContainer: selenium_webdriver_1.By.className('monaco-menu-container'),
},
TreeItem: {
actions: selenium_webdriver_1.By.className('actions-container'),
actionLabel: selenium_webdriver_1.By.className('action-label'),
actionTitle: 'title',
twistie: selenium_webdriver_1.By.className('monaco-tl-twistie'),
},
DefaultTreeSection: {
itemRow: selenium_webdriver_1.By.className('monaco-list-row'),
itemLabel: 'aria-label',
rowContainer: selenium_webdriver_1.By.className('monaco-list'),
rowWithLabel: (label) => selenium_webdriver_1.By.xpath(`.//div[@role='treeitem' and @aria-label='${label}']`),
lastRow: selenium_webdriver_1.By.xpath(`.//div[@data-last-element='true']`),
type: {
default: (0, page_objects_1.hasElement)((locators) => locators.ViewContent.defaultView),
marketplace: {
extension: (0, page_objects_1.hasElement)((locators) => locators.ViewContent.extensionsView),
},
},
},
DefaultTreeItem: {
ctor: (label) => selenium_webdriver_1.By.xpath(`.//div[@role='treeitem' and @aria-label='${label}']`),
twistie: selenium_webdriver_1.By.className('monaco-tl-twistie'),
tooltip: selenium_webdriver_1.By.className('explorer-item'),
labelAttribute: 'title',
},
CustomTreeSection: {
itemRow: selenium_webdriver_1.By.className('monaco-list-row'),
itemLabel: selenium_webdriver_1.By.className('monaco-highlighted-label'),
rowContainer: selenium_webdriver_1.By.className('monaco-list'),
rowWithLabel: (label) => selenium_webdriver_1.By.xpath(`.//span[text()='${label}']`),
},
CustomTreeItem: {
constructor: (label) => selenium_webdriver_1.By.xpath(`.//div[@role='treeitem' and .//span[text()='${label}']]`),
tooltipAttribute: 'aria-label',
expandedAttr: 'aria-expanded',
expandedValue: 'true',
description: selenium_webdriver_1.By.className('label-description'),
},
DebugBreakpointSection: {
predicate: async (section) => (await section.getTitle()).toLowerCase() === 'breakpoints',
},
BreakpointSectionItem: {
breakpoint: {
constructor: selenium_webdriver_1.By.className('codicon'),
},
breakpointCheckbox: {
constructor: selenium_webdriver_1.By.css('input[type=checkbox'),
value: (el) => el.isSelected(),
},
label: {
constructor: selenium_webdriver_1.By.className('name'),
value: (0, page_objects_1.fromText)(),
},
filePath: {
constructor: selenium_webdriver_1.By.className('file-path'),
value: (0, page_objects_1.fromText)(),
},
lineNumber: {
constructor: selenium_webdriver_1.By.className('line-number'),
value: (0, page_objects_1.fromText)(),
},
},
DebugVariableSection: {
predicate: async (section) => (await section.getTitle()).toLowerCase() === 'variables',
},
VariableSectionItem: {
label: (0, page_objects_1.fromText)(selenium_webdriver_1.By.className('monaco-highlighted-label')),
name: {
constructor: selenium_webdriver_1.By.className('name'),
value: (0, page_objects_1.fromText)(),
tooltip: (0, page_objects_1.fromAttribute)('title', selenium_webdriver_1.By.className('monaco-highlighted-label')),
},
value: {
constructor: selenium_webdriver_1.By.className('value'),
value: (0, page_objects_1.fromText)(),
tooltip: (0, page_objects_1.fromAttribute)('title'),
},
},
DebugCallStackSection: {
predicate: async (section) => (await section.getTitle()).toLowerCase() === 'call stack',
},
CallStackItem: {
label: selenium_webdriver_1.By.className('monaco-highlighted-label'),
text: selenium_webdriver_1.By.className('state label monaco-count-badge long'),
},
WatchSection: {
predicate: async (section) => (await section.getTitle()).toLowerCase() === 'watch',
input: selenium_webdriver_1.By.css('input'),
addExpression: 'Add Expression',
refresh: 'Refresh',
removeAll: 'Remove All Expressions',
collapseAll: 'Collapse All',
},
WatchSectionItem: {
label: selenium_webdriver_1.By.className('monaco-highlighted-label'),
value: selenium_webdriver_1.By.xpath(`.//*[contains(@class, 'value ') and starts-with(@class, 'value ')]`),
remove: 'Remove Expression',
},
ExtensionsViewSection: {
items: selenium_webdriver_1.By.className('monaco-list-rows'),
itemRow: selenium_webdriver_1.By.className('monaco-list-row'),
itemTitle: selenium_webdriver_1.By.className('name'),
searchBox: selenium_webdriver_1.By.className('inputarea'),
textContainer: selenium_webdriver_1.By.className('view-line'),
textField: selenium_webdriver_1.By.className('mtk1'),
},
ExtensionsViewItem: {
version: selenium_webdriver_1.By.className('version'),
author: selenium_webdriver_1.By.className('author'),
description: selenium_webdriver_1.By.className('description'),
install: selenium_webdriver_1.By.className('install'),
manage: selenium_webdriver_1.By.className('manage'),
},
ScmView: {
providerHeader: selenium_webdriver_1.By.css(`div[class*='panel-header scm-provider']`),
providerRelative: selenium_webdriver_1.By.xpath(`./..`),
initButton: selenium_webdriver_1.By.xpath(`.//a[text()='Initialize Repository']`),
providerTitle: selenium_webdriver_1.By.className('title'),
providerType: selenium_webdriver_1.By.className('type'),
action: selenium_webdriver_1.By.className('action-label'),
actionConstructor: (title) => selenium_webdriver_1.By.xpath(`.//a[@title='${title}']`),
actionLabel: 'title',
inputField: selenium_webdriver_1.By.css('textarea'),
changeItem: selenium_webdriver_1.By.xpath(`.//div[@role='treeitem']`),
changeName: selenium_webdriver_1.By.className('name'),
changeCount: selenium_webdriver_1.By.className('monaco-count-badge'),
changeLabel: selenium_webdriver_1.By.className('label-name'),
changeDesc: selenium_webdriver_1.By.className('label-description'),
resource: selenium_webdriver_1.By.className('resource'),
changes: selenium_webdriver_1.By.xpath(`.//div[@role="treeitem" and .//div/text()="CHANGES"]`),
stagedChanges: selenium_webdriver_1.By.xpath(`.//div[@role="treeitem" and .//div/text()="STAGED CHANGES"]`),
expand: selenium_webdriver_1.By.className('monaco-tl-twistie'),
more: selenium_webdriver_1.By.className('toolbar-toggle-more'),
multiMore: selenium_webdriver_1.By.className('codicon-toolbar-more'),
multiScmProvider: selenium_webdriver_1.By.className('scm-provider'),
singleScmProvider: selenium_webdriver_1.By.className(`scm-view`),
multiProviderItem: selenium_webdriver_1.By.xpath(`.//div[@role='treeitem' and @aria-level='1']`),
itemLevel: (level) => selenium_webdriver_1.By.xpath(`.//div[@role='treeitem' and @aria-level='${level}']`),
itemIndex: (index) => selenium_webdriver_1.By.xpath(`.//div[@role='treeitem' and @data-index='${index}']`),
shadowRootHost: selenium_webdriver_1.By.className('shadow-root-host'),
monacoMenuContainer: selenium_webdriver_1.By.className('monaco-menu-container'),
sourceControlSection: selenium_webdriver_1.By.xpath(`.//div[@aria-label='Source Control Section']`),
},
DebugView: {
launchCombo: selenium_webdriver_1.By.className('start-debug-action-item'),
launchSelect: selenium_webdriver_1.By.css('select'),
launchSelectAttribute: 'title',
launchOption: selenium_webdriver_1.By.css('option'),
optionByName: (name) => selenium_webdriver_1.By.xpath(`.//option[@value='${name}']`),
startButton: selenium_webdriver_1.By.className('codicon-debug-start'),
},
};
const statusBar = {
StatusBar: {
constructor: selenium_webdriver_1.By.id('workbench.parts.statusbar'),
language: selenium_webdriver_1.By.id('status.editor.mode'),
lines: selenium_webdriver_1.By.id('status.editor.eol'),
encoding: selenium_webdriver_1.By.id('status.editor.encoding'),
indent: selenium_webdriver_1.By.id('status.editor.indentation'),
selection: selenium_webdriver_1.By.id('status.editor.selection'),
notifications: selenium_webdriver_1.By.className('notifications-center'),
bell: selenium_webdriver_1.By.id('status.notifications'),
item: selenium_webdriver_1.By.className('statusbar-item'),
itemTitle: 'aria-label',
aTag: selenium_webdriver_1.By.css('a'),
},
};
const workbench = {
Workbench: {
constructor: selenium_webdriver_1.By.className('monaco-workbench'),
notificationContainer: selenium_webdriver_1.By.className('notification-toast-container'),
notificationItem: selenium_webdriver_1.By.className('monaco-list-row'),
},
Notification: {
message: selenium_webdriver_1.By.className('notification-list-item-message'),
icon: selenium_webdriver_1.By.className('notification-list-item-icon'),
source: selenium_webdriver_1.By.className('notification-list-item-source'),
progress: selenium_webdriver_1.By.className('monaco-progress-container'),
dismiss: selenium_webdriver_1.By.className('clear-notification-action'),
expand: selenium_webdriver_1.By.className('codicon-notifications-expand'),
actions: selenium_webdriver_1.By.className('notification-list-item-buttons-container'),
action: selenium_webdriver_1.By.className('monaco-button'),
actionLabel: {
value: (0, page_objects_1.fromAttribute)('title'),
},
standalone: (id) => selenium_webdriver_1.By.xpath(`.//div[contains(@class, 'monaco-list-row') and @id='${id}']`),
standaloneContainer: selenium_webdriver_1.By.className('notifications-toasts'),
center: (index) => selenium_webdriver_1.By.xpath(`.//div[contains(@class, 'monaco-list-row') and @data-index='${index}']`),
buttonConstructor: (title) => selenium_webdriver_1.By.xpath(`.//a[@role='button' and @title='${title}']`),
},
NotificationsCenter: {
constructor: selenium_webdriver_1.By.className('notifications-center'),
close: selenium_webdriver_1.By.className('hide-all-notifications-action'),
clear: selenium_webdriver_1.By.className('clear-all-notifications-action'),
row: selenium_webdriver_1.By.className('monaco-list-row'),
},
DebugToolbar: {
ctor: selenium_webdriver_1.By.className('debug-toolbar'),
button: (title) => selenium_webdriver_1.By.className(`codicon-debug-${title}`),
},
};
const input = {
Input: {
inputBox: selenium_webdriver_1.By.className('monaco-inputbox'),
input: selenium_webdriver_1.By.className('input'),
quickPickIndex: (index) => selenium_webdriver_1.By.xpath(`.//div[@role='treeitem' and @data-index='${index}']`),
quickPickPosition: (index) => selenium_webdriver_1.By.xpath(`.//div[@role='treeitem' and @aria-posinset='${index}']`),
quickPickLabel: selenium_webdriver_1.By.className('label-name'),
quickPickDescription: selenium_webdriver_1.By.className('label-description'),
quickPickSelectAll: selenium_webdriver_1.By.className('quick-input-check-all'),
quickPickIsSelected: 'aria-checked',
titleBar: selenium_webdriver_1.By.className('quick-input-titlebar'),
title: selenium_webdriver_1.By.className('quick-input-title'),
backButton: selenium_webdriver_1.By.className('codicon-quick-input-back'),
multiSelectIndex: (index) => selenium_webdriver_1.By.xpath(`.//div[@role='treeitem' and @data-index='${index}']`),
button: selenium_webdriver_1.By.xpath(`.//a[@role='button']`),
buttonLabel: 'title',
},
InputBox: {
constructor: selenium_webdriver_1.By.className('quick-input-widget'),
message: selenium_webdriver_1.By.className('quick-input-message'),
progress: selenium_webdriver_1.By.className('quick-input-progress'),
quickList: selenium_webdriver_1.By.className('quick-input-list'),
rows: selenium_webdriver_1.By.className('monaco-list-rows'),
row: selenium_webdriver_1.By.className('monaco-list-row'),
},
QuickOpenBox: {
constructor: selenium_webdriver_1.By.className('monaco-quick-open-widget'),
progress: selenium_webdriver_1.By.className('monaco-progress-container'),
quickList: selenium_webdriver_1.By.className('quick-open-tree'),
row: selenium_webdriver_1.By.xpath(`.//div[@role='treeitem']`),
},
};
const dialog = {
Dialog: {
constructor: selenium_webdriver_1.By.className('monaco-dialog-box'),
message: selenium_webdriver_1.By.className('dialog-message-text'),
details: selenium_webdriver_1.By.className('dialog-message-detail'),
buttonContainer: selenium_webdriver_1.By.className('dialog-buttons-row'),
button: selenium_webdriver_1.By.className('monaco-text-button'),
closeButton: selenium_webdriver_1.By.className('codicon-dialog-close'),
buttonLabel: {
value: (0, page_objects_1.fromAttribute)('title'),
},
},
};
const welcomeContentButtonSelector = ".//a[@class='monaco-button monaco-text-button']";
const welcomeContentTextSelector = './/p';
const welcome = {
WelcomeContent: {
button: selenium_webdriver_1.By.xpath(welcomeContentButtonSelector),
buttonOrText: selenium_webdriver_1.By.xpath(`${welcomeContentButtonSelector} | ${welcomeContentTextSelector}`),
text: selenium_webdriver_1.By.xpath(welcomeContentTextSelector),
},
};
/**
* All available locators for vscode version 1.37.0
*/
exports.locators = {
...abstractElement,
...activityBar,
...bottomBar,
...editor,
...menu,
...sideBar,
...statusBar,
...workbench,
...input,
...dialog,
...welcome,
};
//# sourceMappingURL=1.37.0.js.map