@redhat-developer/page-objects 1.1.1 → 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.
Files changed (94) hide show
  1. package/out/components/AbstractElement.d.ts +2 -2
  2. package/out/components/AbstractElement.js +2 -2
  3. package/out/components/ElementWithContextMenu.d.ts +2 -2
  4. package/out/components/WebviewMixin.d.ts +2 -2
  5. package/out/components/activityBar/ActionsControl.d.ts +3 -3
  6. package/out/components/activityBar/ActivityBar.d.ts +2 -2
  7. package/out/components/activityBar/ViewControl.d.ts +3 -3
  8. package/out/components/bottomBar/AbstractViews.d.ts +4 -4
  9. package/out/components/bottomBar/AbstractViews.js +8 -7
  10. package/out/components/bottomBar/BottomBarPanel.d.ts +2 -2
  11. package/out/components/bottomBar/BottomBarPanel.js +2 -3
  12. package/out/components/bottomBar/ProblemsView.d.ts +3 -3
  13. package/out/components/bottomBar/ProblemsView.js +7 -5
  14. package/out/components/bottomBar/Views.d.ts +3 -3
  15. package/out/components/bottomBar/Views.js +1 -1
  16. package/out/components/bottomBar/WebviewView.d.ts +2 -2
  17. package/out/components/dialog/ModalDialog.d.ts +2 -2
  18. package/out/components/dialog/ModalDialog.js +1 -1
  19. package/out/components/editor/ContentAssist.d.ts +1 -1
  20. package/out/components/editor/ContentAssist.js +6 -5
  21. package/out/components/editor/CustomEditor.d.ts +1 -1
  22. package/out/components/editor/Editor.d.ts +2 -2
  23. package/out/components/editor/Editor.js +1 -1
  24. package/out/components/editor/EditorAction.d.ts +3 -3
  25. package/out/components/editor/EditorView.d.ts +5 -5
  26. package/out/components/editor/EditorView.js +12 -7
  27. package/out/components/editor/SettingsEditor.d.ts +11 -11
  28. package/out/components/editor/SettingsEditor.js +20 -19
  29. package/out/components/editor/TextEditor.d.ts +6 -6
  30. package/out/components/editor/TextEditor.js +15 -13
  31. package/out/components/editor/WebView.d.ts +2 -2
  32. package/out/components/editor/WebView.js +2 -2
  33. package/out/components/menu/ContextMenu.d.ts +2 -2
  34. package/out/components/menu/ContextMenu.js +2 -2
  35. package/out/components/menu/MacTitleBar.js +1 -5
  36. package/out/components/menu/Menu.d.ts +2 -2
  37. package/out/components/menu/Menu.js +2 -2
  38. package/out/components/menu/MenuItem.d.ts +2 -2
  39. package/out/components/menu/MenuItem.js +1 -1
  40. package/out/components/menu/TitleBar.d.ts +3 -3
  41. package/out/components/menu/TitleBar.js +2 -2
  42. package/out/components/menu/WindowControls.d.ts +2 -2
  43. package/out/components/sidebar/SideBarView.d.ts +2 -2
  44. package/out/components/sidebar/ViewContent.d.ts +4 -4
  45. package/out/components/sidebar/ViewContent.js +1 -2
  46. package/out/components/sidebar/ViewItem.d.ts +3 -3
  47. package/out/components/sidebar/ViewItem.js +7 -7
  48. package/out/components/sidebar/ViewSection.d.ts +3 -3
  49. package/out/components/sidebar/ViewSection.js +7 -7
  50. package/out/components/sidebar/ViewTitlePart.d.ts +3 -3
  51. package/out/components/sidebar/WelcomeContent.d.ts +3 -3
  52. package/out/components/sidebar/WelcomeContent.js +1 -1
  53. package/out/components/sidebar/debug/DebugView.d.ts +3 -3
  54. package/out/components/sidebar/extensions/ExtensionsViewItem.d.ts +4 -4
  55. package/out/components/sidebar/extensions/ExtensionsViewSection.d.ts +2 -2
  56. package/out/components/sidebar/extensions/ExtensionsViewSection.js +3 -3
  57. package/out/components/sidebar/scm/NewScmView.d.ts +2 -2
  58. package/out/components/sidebar/scm/NewScmView.js +14 -14
  59. package/out/components/sidebar/scm/ScmView.d.ts +5 -5
  60. package/out/components/sidebar/scm/ScmView.js +8 -8
  61. package/out/components/sidebar/tree/TreeSection.d.ts +3 -3
  62. package/out/components/sidebar/tree/TreeSection.js +4 -4
  63. package/out/components/sidebar/tree/custom/CustomTreeItem.d.ts +3 -3
  64. package/out/components/sidebar/tree/custom/CustomTreeSection.d.ts +5 -5
  65. package/out/components/sidebar/tree/custom/CustomTreeSection.js +2 -2
  66. package/out/components/sidebar/tree/debug/BreakpointSectionItem.d.ts +4 -4
  67. package/out/components/sidebar/tree/debug/BreakpointSectionItem.js +1 -1
  68. package/out/components/sidebar/tree/debug/DebugBreakpointSection.d.ts +4 -4
  69. package/out/components/sidebar/tree/debug/DebugVariablesSection.d.ts +4 -4
  70. package/out/components/sidebar/tree/debug/SectionBreakpoint.d.ts +1 -1
  71. package/out/components/sidebar/tree/debug/VariableSectionItem.d.ts +3 -3
  72. package/out/components/sidebar/tree/default/DefaultTreeItem.d.ts +3 -3
  73. package/out/components/sidebar/tree/default/DefaultTreeSection.d.ts +2 -2
  74. package/out/components/sidebar/tree/default/DefaultTreeSection.js +1 -1
  75. package/out/components/statusBar/StatusBar.d.ts +3 -3
  76. package/out/components/statusBar/StatusBar.js +1 -1
  77. package/out/components/workbench/DebugToolbar.d.ts +1 -1
  78. package/out/components/workbench/Notification.d.ts +3 -3
  79. package/out/components/workbench/Notification.js +1 -2
  80. package/out/components/workbench/NotificationsCenter.d.ts +2 -2
  81. package/out/components/workbench/NotificationsCenter.js +1 -1
  82. package/out/components/workbench/Workbench.d.ts +12 -12
  83. package/out/components/workbench/Workbench.js +1 -1
  84. package/out/components/workbench/input/Input.d.ts +1 -1
  85. package/out/components/workbench/input/Input.js +13 -20
  86. package/out/components/workbench/input/InputBox.d.ts +1 -1
  87. package/out/components/workbench/input/InputBox.js +4 -5
  88. package/out/components/workbench/input/QuickOpenBox.d.ts +1 -1
  89. package/out/components/workbench/input/QuickOpenBox.js +2 -3
  90. package/out/conditions/WaitForAttribute.d.ts +1 -1
  91. package/out/locators/loader.js +8 -8
  92. package/out/locators/locators.d.ts +8 -8
  93. package/out/locators/locators.js +1 -1
  94. package/package.json +2 -2
@@ -29,8 +29,7 @@ class Input extends AbstractElement_1.AbstractElement {
29
29
  * @returns Promise resolving to text of the input field
30
30
  */
31
31
  async getText() {
32
- const input = await this.findElement(Input.locators.Input.inputBox)
33
- .findElement(Input.locators.Input.input);
32
+ const input = await this.findElement(Input.locators.Input.inputBox).findElement(Input.locators.Input.input);
34
33
  return await input.getAttribute('value');
35
34
  }
36
35
  /**
@@ -48,10 +47,9 @@ class Input extends AbstractElement_1.AbstractElement {
48
47
  // workaround issue https://github.com/redhat-developer/vscode-extension-tester/issues/835
49
48
  // do not fail if clipboard is empty
50
49
  }
51
- const input = await this.findElement(Input.locators.Input.inputBox)
52
- .findElement(Input.locators.Input.input);
50
+ const input = await this.findElement(Input.locators.Input.inputBox).findElement(Input.locators.Input.input);
53
51
  await this.clear();
54
- await new Promise(res => setTimeout(res, 200));
52
+ await new Promise((res) => setTimeout(res, 200));
55
53
  if ((await this.getText()).length > 0) {
56
54
  await input.sendKeys(selenium_webdriver_1.Key.END, selenium_webdriver_1.Key.chord(selenium_webdriver_1.Key.SHIFT, selenium_webdriver_1.Key.HOME));
57
55
  }
@@ -71,16 +69,14 @@ class Input extends AbstractElement_1.AbstractElement {
71
69
  * @returns Promise resolving to input placeholder
72
70
  */
73
71
  async getPlaceHolder() {
74
- return await this.findElement(Input.locators.Input.inputBox)
75
- .findElement(Input.locators.Input.input).getAttribute('placeholder');
72
+ return await this.findElement(Input.locators.Input.inputBox).findElement(Input.locators.Input.input).getAttribute('placeholder');
76
73
  }
77
74
  /**
78
75
  * Confirm the input field by pressing Enter
79
76
  * @returns Promise resolving when the input is confirmed
80
77
  */
81
78
  async confirm() {
82
- const input = await this.findElement(Input.locators.Input.inputBox)
83
- .findElement(Input.locators.Input.input);
79
+ const input = await this.findElement(Input.locators.Input.inputBox).findElement(Input.locators.Input.input);
84
80
  await input.click();
85
81
  await input.sendKeys(selenium_webdriver_1.Key.ENTER);
86
82
  }
@@ -89,8 +85,7 @@ class Input extends AbstractElement_1.AbstractElement {
89
85
  * @returns Promise resolving when the input is cancelled
90
86
  */
91
87
  async cancel() {
92
- const input = await this.findElement(Input.locators.Input.inputBox)
93
- .findElement(Input.locators.Input.input);
88
+ const input = await this.findElement(Input.locators.Input.inputBox).findElement(Input.locators.Input.input);
94
89
  await input.sendKeys(selenium_webdriver_1.Key.ESCAPE);
95
90
  }
96
91
  /**
@@ -98,8 +93,7 @@ class Input extends AbstractElement_1.AbstractElement {
98
93
  * @returns Promise resolving when the field is cleared
99
94
  */
100
95
  async clear() {
101
- const input = await this.findElement(Input.locators.Input.inputBox)
102
- .findElement(Input.locators.Input.input);
96
+ const input = await this.findElement(Input.locators.Input.inputBox).findElement(Input.locators.Input.input);
103
97
  // VS Code 1.40 breaks the default clear method, use select all + back space instead
104
98
  await input.sendKeys(selenium_webdriver_1.Key.END, selenium_webdriver_1.Key.chord(selenium_webdriver_1.Key.SHIFT, selenium_webdriver_1.Key.HOME), selenium_webdriver_1.Key.BACK_SPACE);
105
99
  if ((await input.getAttribute('value')).length > 0) {
@@ -136,7 +130,7 @@ class Input extends AbstractElement_1.AbstractElement {
136
130
  if (!checkboxes) {
137
131
  return;
138
132
  }
139
- if (!await checkboxes[0].isSelected()) {
133
+ if (!(await checkboxes[0].isSelected())) {
140
134
  await checkboxes[0].click();
141
135
  }
142
136
  if (state === false) {
@@ -149,8 +143,7 @@ class Input extends AbstractElement_1.AbstractElement {
149
143
  * @returns Promise resolvnig to QuickPickItem if found, to undefined otherwise
150
144
  */
151
145
  async findQuickPick(indexOrText) {
152
- const input = await this.findElement(Input.locators.Input.inputBox)
153
- .findElement(Input.locators.Input.input);
146
+ const input = await this.findElement(Input.locators.Input.inputBox).findElement(Input.locators.Input.input);
154
147
  const first = await this.findElements(Input.locators.Input.quickPickPosition(1));
155
148
  if (first.length < 1) {
156
149
  await this.resetPosition();
@@ -163,7 +156,7 @@ class Input extends AbstractElement_1.AbstractElement {
163
156
  if (lastRow.length > 0) {
164
157
  endReached = true;
165
158
  }
166
- else if (await pick.getAttribute('aria-posinset') === await pick.getAttribute('aria-setsize')) {
159
+ else if ((await pick.getAttribute('aria-posinset')) === (await pick.getAttribute('aria-setsize'))) {
167
160
  endReached = true;
168
161
  }
169
162
  if (typeof indexOrText === 'string') {
@@ -188,7 +181,7 @@ class Input extends AbstractElement_1.AbstractElement {
188
181
  */
189
182
  async getTitle() {
190
183
  const titleBar = await this.findElements(Input.locators.Input.titleBar);
191
- if (titleBar.length > 0 && await titleBar[0].isDisplayed()) {
184
+ if (titleBar.length > 0 && (await titleBar[0].isDisplayed())) {
192
185
  return (await titleBar[0].findElement(Input.locators.Input.title)).getText();
193
186
  }
194
187
  }
@@ -198,9 +191,9 @@ class Input extends AbstractElement_1.AbstractElement {
198
191
  */
199
192
  async back() {
200
193
  const titleBar = await this.findElements(Input.locators.Input.titleBar);
201
- if (titleBar.length > 0 && await titleBar[0].isDisplayed()) {
194
+ if (titleBar.length > 0 && (await titleBar[0].isDisplayed())) {
202
195
  const backBtn = await titleBar[0].findElements(Input.locators.Input.backButton);
203
- if (backBtn.length > 0 && await backBtn[0].isEnabled()) {
196
+ if (backBtn.length > 0 && (await backBtn[0].isEnabled())) {
204
197
  await backBtn[0].click();
205
198
  return true;
206
199
  }
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { Input, QuickPickItem } from "../../..";
17
+ import { Input, QuickPickItem } from '../../..';
18
18
  /**
19
19
  * Plain input box variation of the input page object
20
20
  */
@@ -42,8 +42,7 @@ class InputBox extends __1.Input {
42
42
  return await this.findElement(InputBox.locators.InputBox.message).getText();
43
43
  }
44
44
  async hasProgress() {
45
- const klass = await this.findElement(InputBox.locators.InputBox.progress)
46
- .getAttribute('class');
45
+ const klass = await this.findElement(InputBox.locators.InputBox.progress).getAttribute('class');
47
46
  return klass.indexOf('done') < 0;
48
47
  }
49
48
  async getQuickPicks() {
@@ -53,7 +52,7 @@ class InputBox extends __1.Input {
53
52
  .findElements(InputBox.locators.InputBox.row);
54
53
  for (const element of elements) {
55
54
  if (await element.isDisplayed()) {
56
- picks.push(await new __1.QuickPickItem(+await element.getAttribute('data-index'), this).wait());
55
+ picks.push(await new __1.QuickPickItem(+(await element.getAttribute('data-index')), this).wait());
57
56
  }
58
57
  }
59
58
  return picks;
@@ -65,7 +64,7 @@ class InputBox extends __1.Input {
65
64
  .findElements(InputBox.locators.InputBox.row);
66
65
  for (const element of elements) {
67
66
  if (await element.isDisplayed()) {
68
- picks.push(await new __1.QuickPickItem(+await element.getAttribute('data-index'), this, true).wait());
67
+ picks.push(await new __1.QuickPickItem(+(await element.getAttribute('data-index')), this, true).wait());
69
68
  }
70
69
  }
71
70
  return picks;
@@ -84,7 +83,7 @@ class InputBox extends __1.Input {
84
83
  */
85
84
  async isPassword() {
86
85
  const input = await this.findElement(InputBox.locators.Input.input);
87
- return await input.getAttribute('type') === 'password';
86
+ return (await input.getAttribute('type')) === 'password';
88
87
  }
89
88
  }
90
89
  exports.InputBox = InputBox;
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { Input, QuickPickItem } from "../../..";
17
+ import { Input, QuickPickItem } from '../../..';
18
18
  /**
19
19
  * @deprecated as of VS Code 1.44.0, quick open box has been replaced with input box
20
20
  * The quick open box variation of the input
@@ -36,8 +36,7 @@ class QuickOpenBox extends __1.Input {
36
36
  return new QuickOpenBox().wait();
37
37
  }
38
38
  async hasProgress() {
39
- const klass = await this.findElement(QuickOpenBox.locators.QuickOpenBox.progress)
40
- .getAttribute('class');
39
+ const klass = await this.findElement(QuickOpenBox.locators.QuickOpenBox.progress).getAttribute('class');
41
40
  return klass.indexOf('done') < 0;
42
41
  }
43
42
  async getQuickPicks() {
@@ -45,7 +44,7 @@ class QuickOpenBox extends __1.Input {
45
44
  const tree = await this.getDriver().wait(selenium_webdriver_1.until.elementLocated(QuickOpenBox.locators.QuickOpenBox.quickList), 1000);
46
45
  const elements = await tree.findElements(QuickOpenBox.locators.QuickOpenBox.row);
47
46
  for (const element of elements) {
48
- const index = +await element.getAttribute('aria-posinset');
47
+ const index = +(await element.getAttribute('aria-posinset'));
49
48
  if (await element.isDisplayed()) {
50
49
  picks.push(await new __1.QuickPickItem(index, this).wait());
51
50
  }
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { WebElement } from "selenium-webdriver";
17
+ import { WebElement } from 'selenium-webdriver';
18
18
  /**
19
19
  * Condition to wait until an element's attribute has a specified value
20
20
  * @param element WebElement to check
@@ -74,21 +74,21 @@ class LocatorLoader {
74
74
  * @returns object containing all locators
75
75
  */
76
76
  loadLocators() {
77
- let versions = fs.readdirSync(this.baseFolder)
77
+ let versions = fs
78
+ .readdirSync(this.baseFolder)
78
79
  .filter((file) => file.endsWith('.js'))
79
80
  .map((file) => path.basename(file, '.js'));
80
81
  if ((0, compare_versions_1.compareVersions)(this.baseVersion, this.version) === 0) {
81
82
  return this.locators;
82
83
  }
83
84
  if ((0, compare_versions_1.compareVersions)(this.baseVersion, this.version) < 0) {
84
- versions = versions.filter((ver) => (0, compare_versions_1.compareVersions)(this.baseVersion, ver) < 0 &&
85
- (0, compare_versions_1.compareVersions)(ver, this.version) <= 0)
86
- .sort(compare_versions_1.compareVersions);
85
+ versions = versions.filter((ver) => (0, compare_versions_1.compareVersions)(this.baseVersion, ver) < 0 && (0, compare_versions_1.compareVersions)(ver, this.version) <= 0).sort(compare_versions_1.compareVersions);
87
86
  }
88
87
  else {
89
- versions = versions.filter((ver) => (0, compare_versions_1.compareVersions)(this.baseVersion, ver) > 0 &&
90
- (0, compare_versions_1.compareVersions)(ver, this.version) >= 0)
91
- .sort(compare_versions_1.compareVersions).reverse();
88
+ versions = versions
89
+ .filter((ver) => (0, compare_versions_1.compareVersions)(this.baseVersion, ver) > 0 && (0, compare_versions_1.compareVersions)(ver, this.version) >= 0)
90
+ .sort(compare_versions_1.compareVersions)
91
+ .reverse();
92
92
  }
93
93
  for (const version of versions) {
94
94
  const diff = require(path.join(this.baseFolder, version)).diff;
@@ -112,7 +112,7 @@ function merge(target, obj) {
112
112
  }
113
113
  const oldVal = obj[key];
114
114
  const newVal = target[key];
115
- if (typeof (newVal) === 'object' && typeof (oldVal) === 'object') {
115
+ if (typeof newVal === 'object' && typeof oldVal === 'object') {
116
116
  target[key] = merge(newVal, oldVal);
117
117
  }
118
118
  else {
@@ -14,9 +14,9 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { By, WebElement } from "selenium-webdriver";
17
+ import { By, WebElement } from 'selenium-webdriver';
18
18
  import { PartialDeep } from 'type-fest';
19
- import { ViewSection } from "../components/sidebar/ViewSection";
19
+ import { ViewSection } from '../components/sidebar/ViewSection';
20
20
  type WebElementFunction<E extends WebElement, T> = (element: E) => T | PromiseLike<T>;
21
21
  type LocatorAwareWebElementFunction<T> = (element: WebElement, locator: Locators) => T | PromiseLike<T>;
22
22
  /**
@@ -480,10 +480,10 @@ export interface LocatorDiff {
480
480
  locators: PartialDeep<Locators>;
481
481
  extras?: object;
482
482
  }
483
- export declare function hasAttribute(attr: string, value?: string, locator?: By): ((el: WebElement) => Promise<boolean>);
484
- export declare function hasClass(classOrPredicate: string | ((klass: string) => boolean), locator?: By): ((el: WebElement) => Promise<boolean>);
485
- export declare function hasNotClass(klass: string, locator?: By): ((el: WebElement) => Promise<boolean>);
486
- export declare function hasElement(locatorSelector: ((l: Locators) => By)): ((el: WebElement, locators: Locators) => Promise<boolean>);
487
- export declare function fromAttribute(attribute: string, locator?: By): ((el: WebElement) => Promise<string>);
488
- export declare function fromText(locator?: By): ((el: WebElement) => Promise<string>);
483
+ export declare function hasAttribute(attr: string, value?: string, locator?: By): (el: WebElement) => Promise<boolean>;
484
+ export declare function hasClass(classOrPredicate: string | ((klass: string) => boolean), locator?: By): (el: WebElement) => Promise<boolean>;
485
+ export declare function hasNotClass(klass: string, locator?: By): (el: WebElement) => Promise<boolean>;
486
+ export declare function hasElement(locatorSelector: (l: Locators) => By): (el: WebElement, locators: Locators) => Promise<boolean>;
487
+ export declare function fromAttribute(attribute: string, locator?: By): (el: WebElement) => Promise<string>;
488
+ export declare function fromText(locator?: By): (el: WebElement) => Promise<string>;
489
489
  export {};
@@ -33,7 +33,7 @@ function hasClass(classOrPredicate, locator) {
33
33
  el = locator ? el.findElement(locator) : el;
34
34
  const klasses = await el.getAttribute('class');
35
35
  const segments = klasses?.split(/\s+/g);
36
- const predicate = typeof classOrPredicate === 'string' ? ((klass) => klass === classOrPredicate) : (classOrPredicate);
36
+ const predicate = typeof classOrPredicate === 'string' ? (klass) => klass === classOrPredicate : classOrPredicate;
37
37
  return segments.find(predicate) !== undefined;
38
38
  };
39
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redhat-developer/page-objects",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Page Object API implementation for a VS Code editor used by ExTester framework.",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",
@@ -46,5 +46,5 @@
46
46
  "selenium-webdriver": ">=4.6.1",
47
47
  "typescript": ">=4.6.2"
48
48
  },
49
- "gitHead": "09544612fb1a36c75ae7e7aa90f57085b813b83e"
49
+ "gitHead": "2c16a5cf8b74b7c4e5424a3878aa97b5840e995a"
50
50
  }