@redhat-developer/page-objects 1.0.0

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.
Files changed (127) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +5 -0
  3. package/out/components/AbstractElement.d.ts +35 -0
  4. package/out/components/AbstractElement.js +69 -0
  5. package/out/components/ElementWithContextMenu.d.ts +11 -0
  6. package/out/components/ElementWithContextMenu.js +38 -0
  7. package/out/components/WebviewMixin.d.ts +29 -0
  8. package/out/components/WebviewMixin.js +70 -0
  9. package/out/components/activityBar/ActionsControl.d.ts +18 -0
  10. package/out/components/activityBar/ActionsControl.js +27 -0
  11. package/out/components/activityBar/ActivityBar.d.ts +30 -0
  12. package/out/components/activityBar/ActivityBar.js +71 -0
  13. package/out/components/activityBar/ViewControl.d.ts +23 -0
  14. package/out/components/activityBar/ViewControl.js +56 -0
  15. package/out/components/bottomBar/AbstractViews.d.ts +38 -0
  16. package/out/components/bottomBar/AbstractViews.js +88 -0
  17. package/out/components/bottomBar/BottomBarPanel.d.ts +47 -0
  18. package/out/components/bottomBar/BottomBarPanel.js +123 -0
  19. package/out/components/bottomBar/ProblemsView.d.ts +88 -0
  20. package/out/components/bottomBar/ProblemsView.js +149 -0
  21. package/out/components/bottomBar/Views.d.ts +75 -0
  22. package/out/components/bottomBar/Views.js +195 -0
  23. package/out/components/bottomBar/WebviewView.d.ts +12 -0
  24. package/out/components/bottomBar/WebviewView.js +21 -0
  25. package/out/components/dialog/ModalDialog.d.ts +32 -0
  26. package/out/components/dialog/ModalDialog.js +56 -0
  27. package/out/components/editor/Breakpoint.d.ts +18 -0
  28. package/out/components/editor/Breakpoint.js +38 -0
  29. package/out/components/editor/ContentAssist.d.ts +34 -0
  30. package/out/components/editor/ContentAssist.js +94 -0
  31. package/out/components/editor/CustomEditor.d.ts +26 -0
  32. package/out/components/editor/CustomEditor.js +45 -0
  33. package/out/components/editor/DiffEditor.d.ts +19 -0
  34. package/out/components/editor/DiffEditor.js +31 -0
  35. package/out/components/editor/Editor.d.ts +17 -0
  36. package/out/components/editor/Editor.js +29 -0
  37. package/out/components/editor/EditorAction.d.ts +10 -0
  38. package/out/components/editor/EditorAction.js +17 -0
  39. package/out/components/editor/EditorView.d.ts +153 -0
  40. package/out/components/editor/EditorView.js +350 -0
  41. package/out/components/editor/SettingsEditor.d.ts +121 -0
  42. package/out/components/editor/SettingsEditor.js +278 -0
  43. package/out/components/editor/TextEditor.d.ts +265 -0
  44. package/out/components/editor/TextEditor.js +707 -0
  45. package/out/components/editor/WebView.d.ts +11 -0
  46. package/out/components/editor/WebView.js +38 -0
  47. package/out/components/menu/ContextMenu.d.ts +37 -0
  48. package/out/components/menu/ContextMenu.js +123 -0
  49. package/out/components/menu/MacTitleBar.d.ts +16 -0
  50. package/out/components/menu/MacTitleBar.js +41 -0
  51. package/out/components/menu/Menu.d.ts +38 -0
  52. package/out/components/menu/Menu.js +53 -0
  53. package/out/components/menu/MenuItem.d.ts +24 -0
  54. package/out/components/menu/MenuItem.js +36 -0
  55. package/out/components/menu/TitleBar.d.ts +36 -0
  56. package/out/components/menu/TitleBar.js +78 -0
  57. package/out/components/menu/WindowControls.d.ts +28 -0
  58. package/out/components/menu/WindowControls.js +59 -0
  59. package/out/components/sidebar/SideBarView.d.ts +18 -0
  60. package/out/components/sidebar/SideBarView.js +29 -0
  61. package/out/components/sidebar/ViewContent.d.ts +57 -0
  62. package/out/components/sidebar/ViewContent.js +76 -0
  63. package/out/components/sidebar/ViewItem.d.ts +97 -0
  64. package/out/components/sidebar/ViewItem.js +192 -0
  65. package/out/components/sidebar/ViewSection.d.ts +98 -0
  66. package/out/components/sidebar/ViewSection.js +164 -0
  67. package/out/components/sidebar/ViewTitlePart.d.ts +35 -0
  68. package/out/components/sidebar/ViewTitlePart.js +59 -0
  69. package/out/components/sidebar/WelcomeContent.d.ts +47 -0
  70. package/out/components/sidebar/WelcomeContent.js +72 -0
  71. package/out/components/sidebar/debug/DebugView.d.ts +33 -0
  72. package/out/components/sidebar/debug/DebugView.js +70 -0
  73. package/out/components/sidebar/extensions/ExtensionsViewItem.d.ts +48 -0
  74. package/out/components/sidebar/extensions/ExtensionsViewItem.js +93 -0
  75. package/out/components/sidebar/extensions/ExtensionsViewSection.d.ts +33 -0
  76. package/out/components/sidebar/extensions/ExtensionsViewSection.js +117 -0
  77. package/out/components/sidebar/scm/NewScmView.d.ts +34 -0
  78. package/out/components/sidebar/scm/NewScmView.js +155 -0
  79. package/out/components/sidebar/scm/ScmView.d.ts +110 -0
  80. package/out/components/sidebar/scm/ScmView.js +275 -0
  81. package/out/components/sidebar/tree/TreeSection.d.ts +14 -0
  82. package/out/components/sidebar/tree/TreeSection.js +55 -0
  83. package/out/components/sidebar/tree/custom/CustomTreeItem.d.ts +15 -0
  84. package/out/components/sidebar/tree/custom/CustomTreeItem.js +36 -0
  85. package/out/components/sidebar/tree/custom/CustomTreeSection.d.ts +26 -0
  86. package/out/components/sidebar/tree/custom/CustomTreeSection.js +66 -0
  87. package/out/components/sidebar/tree/debug/BreakpointSectionItem.d.ts +33 -0
  88. package/out/components/sidebar/tree/debug/BreakpointSectionItem.js +63 -0
  89. package/out/components/sidebar/tree/debug/DebugBreakpointSection.d.ts +7 -0
  90. package/out/components/sidebar/tree/debug/DebugBreakpointSection.js +12 -0
  91. package/out/components/sidebar/tree/debug/DebugVariablesSection.d.ts +7 -0
  92. package/out/components/sidebar/tree/debug/DebugVariablesSection.js +12 -0
  93. package/out/components/sidebar/tree/debug/SectionBreakpoint.d.ts +3 -0
  94. package/out/components/sidebar/tree/debug/SectionBreakpoint.js +8 -0
  95. package/out/components/sidebar/tree/debug/VariableSectionItem.d.ts +33 -0
  96. package/out/components/sidebar/tree/debug/VariableSectionItem.js +60 -0
  97. package/out/components/sidebar/tree/default/DefaultTreeItem.d.ts +14 -0
  98. package/out/components/sidebar/tree/default/DefaultTreeItem.js +39 -0
  99. package/out/components/sidebar/tree/default/DefaultTreeSection.d.ts +9 -0
  100. package/out/components/sidebar/tree/default/DefaultTreeSection.js +44 -0
  101. package/out/components/statusBar/StatusBar.d.ts +96 -0
  102. package/out/components/statusBar/StatusBar.js +159 -0
  103. package/out/components/workbench/DebugToolbar.d.ts +52 -0
  104. package/out/components/workbench/DebugToolbar.js +93 -0
  105. package/out/components/workbench/Notification.d.ts +78 -0
  106. package/out/components/workbench/Notification.js +134 -0
  107. package/out/components/workbench/NotificationsCenter.d.ts +27 -0
  108. package/out/components/workbench/NotificationsCenter.js +57 -0
  109. package/out/components/workbench/Workbench.d.ts +69 -0
  110. package/out/components/workbench/Workbench.js +135 -0
  111. package/out/components/workbench/input/Input.d.ts +107 -0
  112. package/out/components/workbench/input/Input.js +249 -0
  113. package/out/components/workbench/input/InputBox.d.ts +30 -0
  114. package/out/components/workbench/input/InputBox.js +75 -0
  115. package/out/components/workbench/input/QuickOpenBox.d.ts +15 -0
  116. package/out/components/workbench/input/QuickOpenBox.js +41 -0
  117. package/out/conditions/WaitForAttribute.d.ts +8 -0
  118. package/out/conditions/WaitForAttribute.js +17 -0
  119. package/out/errors/NullAttributeError.d.ts +3 -0
  120. package/out/errors/NullAttributeError.js +11 -0
  121. package/out/index.d.ts +67 -0
  122. package/out/index.js +95 -0
  123. package/out/locators/loader.d.ts +20 -0
  124. package/out/locators/loader.js +108 -0
  125. package/out/locators/locators.d.ts +463 -0
  126. package/out/locators/locators.js +52 -0
  127. package/package.json +48 -0
@@ -0,0 +1,463 @@
1
+ import { By, WebElement } from "selenium-webdriver";
2
+ import { PartialDeep } from 'type-fest';
3
+ import { ViewSection } from "../components/sidebar/ViewSection";
4
+ type WebElementFunction<E extends WebElement, T> = (element: E) => T | PromiseLike<T>;
5
+ type LocatorAwareWebElementFunction<T> = (element: WebElement, locator: Locators) => T | PromiseLike<T>;
6
+ /**
7
+ * Type definitions for all used locators
8
+ */
9
+ export interface Locators {
10
+ AbstractElement: {
11
+ enabled: WebElementFunction<WebElement, boolean>;
12
+ selected: WebElementFunction<WebElement, boolean>;
13
+ };
14
+ ActivityBar: {
15
+ constructor: By;
16
+ viewContainer: By;
17
+ label: string;
18
+ actionsContainer: By;
19
+ actionItem: By;
20
+ };
21
+ ViewControl: {
22
+ attribute: string;
23
+ klass: string;
24
+ scmId: By;
25
+ debugId: By;
26
+ badge: By;
27
+ };
28
+ BottomBarPanel: {
29
+ constructor: By;
30
+ problemsTab: string;
31
+ outputTab: string;
32
+ debugTab: string;
33
+ terminalTab: string;
34
+ maximize: string;
35
+ restore: string;
36
+ close: string;
37
+ tabContainer: By;
38
+ tab: (title: string) => By;
39
+ actions: By;
40
+ globalActions: By;
41
+ action: (label: string) => By;
42
+ closeAction: By;
43
+ };
44
+ BottomBarViews: {
45
+ actionsContainer: (label: string) => By;
46
+ channelOption: By;
47
+ channelCombo: By;
48
+ channelText: By;
49
+ channelRow: By;
50
+ textArea: By;
51
+ clearText: By;
52
+ };
53
+ ProblemsView: {
54
+ constructor: By;
55
+ markersFilter: By;
56
+ input: By;
57
+ collapseAll: By;
58
+ markerRow: By;
59
+ rowLabel: string;
60
+ label: By;
61
+ markerTwistie: By;
62
+ changeCount: By;
63
+ };
64
+ TerminalView: {
65
+ constructor: By;
66
+ actionsLabel: string;
67
+ textArea: By;
68
+ killTerminal: By;
69
+ newTerminal: By;
70
+ tabList: By;
71
+ singleTab: By;
72
+ selectedRow: By;
73
+ row: By;
74
+ newCommand: string;
75
+ };
76
+ DebugConsoleView: {
77
+ constructor: By;
78
+ };
79
+ OutputView: {
80
+ constructor: By;
81
+ actionsLabel: string;
82
+ optionByName: (name: string) => By;
83
+ };
84
+ WebviewView: {
85
+ iframe: By;
86
+ };
87
+ EditorView: {
88
+ constructor: By;
89
+ editorGroup: By;
90
+ settingsEditor: By;
91
+ webView: By;
92
+ diffEditor: By;
93
+ tab: By;
94
+ closeTab: By;
95
+ tabTitle: string;
96
+ tabSeparator: string;
97
+ tabLabel: string;
98
+ actionContainer: By;
99
+ actionItem: By;
100
+ attribute: string;
101
+ };
102
+ Editor: {
103
+ constructor: By;
104
+ inputArea: By;
105
+ title: By;
106
+ };
107
+ TextEditor: {
108
+ activeTab: By;
109
+ breakpoint: {
110
+ pauseSelector: By;
111
+ generalSelector: By;
112
+ properties: {
113
+ enabled: WebElementFunction<WebElement, boolean>;
114
+ line: {
115
+ selector: By;
116
+ number: WebElementFunction<WebElement, number>;
117
+ };
118
+ paused: WebElementFunction<WebElement, boolean>;
119
+ };
120
+ };
121
+ editorContainer: By;
122
+ dataUri: string;
123
+ formatDoc: string;
124
+ marginArea: By;
125
+ lineNumber: (line: number) => By;
126
+ lineOverlay: (line: number) => By;
127
+ debugHint: By;
128
+ selection: By;
129
+ findWidget: By;
130
+ };
131
+ FindWidget: {
132
+ toggleReplace: By;
133
+ replacePart: By;
134
+ findPart: By;
135
+ matchCount: By;
136
+ input: By;
137
+ content: By;
138
+ button: (title: string) => By;
139
+ checkbox: (title: string) => By;
140
+ };
141
+ ContentAssist: {
142
+ constructor: By;
143
+ message: By;
144
+ itemRows: By;
145
+ itemRow: By;
146
+ itemLabel: By;
147
+ itemText: By;
148
+ itemList: By;
149
+ firstItem: By;
150
+ };
151
+ SettingsEditor: {
152
+ title: string;
153
+ itemRow: By;
154
+ header: By;
155
+ tabs: By;
156
+ actions: By;
157
+ action: (label: string) => By;
158
+ settingConstructor: (title: string, category: string) => By;
159
+ settingDesctiption: By;
160
+ settingLabel: By;
161
+ settingCategory: By;
162
+ comboSetting: By;
163
+ comboOption: By;
164
+ comboValue: string;
165
+ textSetting: By;
166
+ checkboxSetting: By;
167
+ checkboxChecked: string;
168
+ linkButton: By;
169
+ itemCount: By;
170
+ };
171
+ DiffEditor: {
172
+ originalEditor: By;
173
+ modifiedEditor: By;
174
+ };
175
+ WebView: {
176
+ iframe: By;
177
+ activeFrame: By;
178
+ container: (id: string) => By;
179
+ attribute: string;
180
+ };
181
+ ContextMenu: {
182
+ contextView: By;
183
+ constructor: By;
184
+ itemConstructor: (label: string) => By;
185
+ itemElement: By;
186
+ itemLabel: By;
187
+ itemText: string;
188
+ itemNesting: By;
189
+ viewBlock: By;
190
+ };
191
+ TitleBar: {
192
+ constructor: By;
193
+ itemConstructor: (label: string) => By;
194
+ itemElement: By;
195
+ itemLabel: string;
196
+ title: By;
197
+ };
198
+ WindowControls: {
199
+ constructor: By;
200
+ minimize: By;
201
+ maximize: By;
202
+ restore: By;
203
+ close: By;
204
+ };
205
+ SideBarView: {
206
+ constructor: By;
207
+ };
208
+ ViewTitlePart: {
209
+ constructor: By;
210
+ title: By;
211
+ action: By;
212
+ actionLabel: string;
213
+ actionConstructor: (title: string) => By;
214
+ };
215
+ ViewContent: {
216
+ constructor: By;
217
+ progress: By;
218
+ section: By;
219
+ defaultView: By;
220
+ extensionsView: By;
221
+ };
222
+ ViewSection: {
223
+ title: By;
224
+ titleText: string;
225
+ header: By;
226
+ headerExpanded: string;
227
+ actions: By;
228
+ actionConstructor: (label: string) => By;
229
+ button: By;
230
+ buttonLabel: string;
231
+ level: string;
232
+ index: string;
233
+ welcomeContent: By;
234
+ };
235
+ TreeItem: {
236
+ actions: By;
237
+ actionLabel: By;
238
+ actionTitle: string;
239
+ twistie: By;
240
+ };
241
+ DefaultTreeSection: {
242
+ itemRow: By;
243
+ itemLabel: string;
244
+ rowContainer: By;
245
+ rowWithLabel: (label: string) => By;
246
+ lastRow: By;
247
+ type: {
248
+ default: LocatorAwareWebElementFunction<boolean>;
249
+ marketplace: {
250
+ extension: LocatorAwareWebElementFunction<boolean>;
251
+ };
252
+ };
253
+ };
254
+ DefaultTreeItem: {
255
+ ctor: (label: string) => By;
256
+ twistie: By;
257
+ tooltip: By;
258
+ labelAttribute: string;
259
+ };
260
+ CustomTreeSection: {
261
+ itemRow: By;
262
+ itemLabel: By;
263
+ rowContainer: By;
264
+ rowWithLabel: (label: string) => By;
265
+ };
266
+ CustomTreeItem: {
267
+ constructor: (label: string) => By;
268
+ expandedAttr: string;
269
+ expandedValue: string;
270
+ tooltipAttribute: string;
271
+ description: By;
272
+ };
273
+ DebugBreakpointSection: {
274
+ predicate: WebElementFunction<ViewSection, boolean>;
275
+ };
276
+ BreakpointSectionItem: {
277
+ breakpoint: {
278
+ constructor: By;
279
+ };
280
+ breakpointCheckbox: {
281
+ constructor: By;
282
+ value: WebElementFunction<WebElement, boolean>;
283
+ };
284
+ label: {
285
+ constructor: By;
286
+ value: WebElementFunction<WebElement, string>;
287
+ };
288
+ filePath: {
289
+ constructor: By;
290
+ value: WebElementFunction<WebElement, string>;
291
+ };
292
+ lineNumber: {
293
+ constructor: By;
294
+ value: WebElementFunction<WebElement, string>;
295
+ };
296
+ };
297
+ DebugVariableSection: {
298
+ predicate: WebElementFunction<ViewSection, boolean>;
299
+ };
300
+ VariableSectionItem: {
301
+ label: WebElementFunction<WebElement, string>;
302
+ name: {
303
+ constructor: By;
304
+ value: WebElementFunction<WebElement, string>;
305
+ tooltip: WebElementFunction<WebElement, string>;
306
+ };
307
+ value: {
308
+ constructor: By;
309
+ value: WebElementFunction<WebElement, string>;
310
+ tooltip: WebElementFunction<WebElement, string>;
311
+ };
312
+ };
313
+ ExtensionsViewSection: {
314
+ items: By;
315
+ itemRow: By;
316
+ itemTitle: By;
317
+ searchBox: By;
318
+ textContainer: By;
319
+ textField: By;
320
+ };
321
+ ExtensionsViewItem: {
322
+ version: By;
323
+ author: By;
324
+ description: By;
325
+ install: By;
326
+ manage: By;
327
+ };
328
+ ScmView: {
329
+ providerHeader: By;
330
+ providerRelative: By;
331
+ initButton: By;
332
+ providerTitle: By;
333
+ providerType: By;
334
+ action: By;
335
+ actionConstructor: (title: string) => By;
336
+ actionLabel: string;
337
+ inputField: By;
338
+ changeItem: By;
339
+ changeName: By;
340
+ changeCount: By;
341
+ changeLabel: By;
342
+ changeDesc: By;
343
+ resource: By;
344
+ changes: By;
345
+ stagedChanges: By;
346
+ expand: By;
347
+ more: By;
348
+ multiMore: By;
349
+ multiScmProvider: By;
350
+ singleScmProvider: By;
351
+ multiProviderItem: By;
352
+ itemLevel: (level: number) => By;
353
+ itemIndex: (index: number) => By;
354
+ };
355
+ DebugView: {
356
+ launchCombo: By;
357
+ launchSelect: By;
358
+ launchOption: By;
359
+ optionByName: (name: string) => By;
360
+ startButton: By;
361
+ };
362
+ DebugToolbar: {
363
+ ctor: By;
364
+ button: (title: string) => By;
365
+ };
366
+ StatusBar: {
367
+ constructor: By;
368
+ language: By;
369
+ lines: By;
370
+ encoding: By;
371
+ indent: By;
372
+ selection: By;
373
+ notifications: By;
374
+ bell: By;
375
+ item: By;
376
+ itemTitle: string;
377
+ };
378
+ Workbench: {
379
+ constructor: By;
380
+ notificationContainer: By;
381
+ notificationItem: By;
382
+ };
383
+ Notification: {
384
+ message: By;
385
+ icon: By;
386
+ source: By;
387
+ progress: By;
388
+ dismiss: By;
389
+ expand: By;
390
+ actions: By;
391
+ action: By;
392
+ actionLabel: {
393
+ value: WebElementFunction<WebElement, string>;
394
+ };
395
+ standalone: (id: string) => By;
396
+ standaloneContainer: By;
397
+ center: (index: number) => By;
398
+ buttonConstructor: (title: string) => By;
399
+ };
400
+ NotificationsCenter: {
401
+ constructor: By;
402
+ close: By;
403
+ clear: By;
404
+ row: By;
405
+ };
406
+ Input: {
407
+ inputBox: By;
408
+ input: By;
409
+ quickPickIndex: (index: number) => By;
410
+ quickPickPosition: (index: number) => By;
411
+ quickPickLabel: By;
412
+ quickPickDescription: By;
413
+ quickPickSelectAll: By;
414
+ titleBar: By;
415
+ title: By;
416
+ backButton: By;
417
+ multiSelectIndex: (index: number) => By;
418
+ };
419
+ InputBox: {
420
+ constructor: By;
421
+ message: By;
422
+ progress: By;
423
+ quickList: By;
424
+ rows: By;
425
+ row: By;
426
+ };
427
+ QuickOpenBox: {
428
+ constructor: By;
429
+ progress: By;
430
+ quickList: By;
431
+ row: By;
432
+ };
433
+ Dialog: {
434
+ constructor: By;
435
+ message: By;
436
+ details: By;
437
+ buttonContainer: By;
438
+ button: By;
439
+ closeButton: By;
440
+ buttonLabel: {
441
+ value: WebElementFunction<WebElement, string>;
442
+ };
443
+ };
444
+ WelcomeContent: {
445
+ button: By;
446
+ text: By;
447
+ buttonOrText: By;
448
+ };
449
+ }
450
+ /**
451
+ * Definition for locator diff object
452
+ */
453
+ export interface LocatorDiff {
454
+ locators: PartialDeep<Locators>;
455
+ extras?: Object;
456
+ }
457
+ export declare function hasAttribute(attr: string, value?: string, locator?: By): ((el: WebElement) => Promise<boolean>);
458
+ export declare function hasClass(classOrPredicate: string | ((klass: string) => boolean), locator?: By): ((el: WebElement) => Promise<boolean>);
459
+ export declare function hasNotClass(klass: string, locator?: By): ((el: WebElement) => Promise<boolean>);
460
+ export declare function hasElement(locatorSelector: ((l: Locators) => By)): ((el: WebElement, locators: Locators) => Promise<boolean>);
461
+ export declare function fromAttribute(attribute: string, locator?: By): ((el: WebElement) => Promise<string>);
462
+ export declare function fromText(locator?: By): ((el: WebElement) => Promise<string>);
463
+ export {};
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fromText = exports.fromAttribute = exports.hasElement = exports.hasNotClass = exports.hasClass = exports.hasAttribute = void 0;
4
+ function hasAttribute(attr, value, locator) {
5
+ return async (el) => {
6
+ el = locator ? el.findElement(locator) : el;
7
+ const attrValue = await el.getAttribute(attr);
8
+ if (value === undefined) {
9
+ return attrValue !== null;
10
+ }
11
+ return attrValue === value;
12
+ };
13
+ }
14
+ exports.hasAttribute = hasAttribute;
15
+ function hasClass(classOrPredicate, locator) {
16
+ return async (el) => {
17
+ el = locator ? el.findElement(locator) : el;
18
+ const klasses = await el.getAttribute('class');
19
+ const segments = klasses?.split(/\s+/g);
20
+ const predicate = typeof classOrPredicate === 'string' ? ((klass) => klass === classOrPredicate) : (classOrPredicate);
21
+ return segments.find(predicate) !== undefined;
22
+ };
23
+ }
24
+ exports.hasClass = hasClass;
25
+ function hasNotClass(klass, locator) {
26
+ return async (el) => {
27
+ el = locator ? el.findElement(locator) : el;
28
+ return !(await hasClass(klass).call(undefined, el));
29
+ };
30
+ }
31
+ exports.hasNotClass = hasNotClass;
32
+ function hasElement(locatorSelector) {
33
+ return async (el, locators) => {
34
+ return (await el.findElements(locatorSelector(locators))).length > 0;
35
+ };
36
+ }
37
+ exports.hasElement = hasElement;
38
+ function fromAttribute(attribute, locator) {
39
+ return async (el) => {
40
+ el = locator ? el.findElement(locator) : el;
41
+ return el.getAttribute(attribute);
42
+ };
43
+ }
44
+ exports.fromAttribute = fromAttribute;
45
+ function fromText(locator) {
46
+ return async (el) => {
47
+ el = locator ? el.findElement(locator) : el;
48
+ return el.getText();
49
+ };
50
+ }
51
+ exports.fromText = fromText;
52
+ //# sourceMappingURL=locators.js.map
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@redhat-developer/page-objects",
3
+ "version": "1.0.0",
4
+ "description": "Page Object API implementation for a VS Code editor used by ExTester framework.",
5
+ "main": "out/index.js",
6
+ "types": "out/index.d.ts",
7
+ "files": [
8
+ "out/**/*.js",
9
+ "out/**/*.d.ts"
10
+ ],
11
+ "scripts": {
12
+ "prepack": "npm run build",
13
+ "build": "npm run clean && tsc",
14
+ "clean": "rimraf out"
15
+ },
16
+ "author": "Red Hat",
17
+ "license": "Apache-2.0",
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/redhat-developer/vscode-extension-tester.git",
24
+ "directory": "packages/page-objects"
25
+ },
26
+ "keywords": [
27
+ "webdriver",
28
+ "selenium-webdriver",
29
+ "selenium",
30
+ "test",
31
+ "vscode",
32
+ "extension",
33
+ "extester",
34
+ "vscode-extension-tester",
35
+ "ui-test"
36
+ ],
37
+ "dependencies": {
38
+ "clipboardy": "^4.0.0",
39
+ "clone-deep": "^4.0.1",
40
+ "compare-versions": "^6.1.0",
41
+ "fs-extra": "^11.2.0"
42
+ },
43
+ "peerDependencies": {
44
+ "selenium-webdriver": ">=4.6.1",
45
+ "typescript": ">=4.6.2"
46
+ },
47
+ "gitHead": "287f2645f6b4a1ae6fae55c1c9fdcec6bde594ff"
48
+ }