@redhat-developer/page-objects 1.5.0 → 1.6.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.
@@ -0,0 +1,46 @@
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 { ExtensionEditorView, WebView } from '../..';
18
+ export declare class ExtensionEditorDetailsSection extends ExtensionEditorView {
19
+ /**
20
+ * Get all categories of extension.
21
+ * @returns Promise resolving categories of extension.
22
+ */
23
+ getCategories(): Promise<string[]>;
24
+ /**
25
+ * Get all resources of extension.
26
+ * @returns Promise resolving resources of extension.
27
+ */
28
+ getResources(): Promise<string[]>;
29
+ /**
30
+ * Get content of More Info section.
31
+ * @returns Promise resolving content of 'More Info' section.
32
+ */
33
+ getMoreInfo(): Promise<{
34
+ [key: string]: string;
35
+ }>;
36
+ /**
37
+ * Get value of specific attribute from 'More Info' section.
38
+ * @param key Name of attribute.
39
+ * @returns Promise resolving value for specified attribute.
40
+ */
41
+ getMoreInfoItem(key: string): Promise<string>;
42
+ /**
43
+ * Blocked by https://github.com/redhat-developer/vscode-extension-tester/issues/1492
44
+ */
45
+ getReadme(): Promise<WebView>;
46
+ }
@@ -0,0 +1,83 @@
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
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.ExtensionEditorDetailsSection = void 0;
20
+ const __1 = require("../..");
21
+ class ExtensionEditorDetailsSection extends __1.ExtensionEditorView {
22
+ /**
23
+ * Get all categories of extension.
24
+ * @returns Promise resolving categories of extension.
25
+ */
26
+ async getCategories() {
27
+ const categories = [];
28
+ const container = await this.findElement(ExtensionEditorDetailsSection.locators.ExtensionEditorDetailsSection.categoriesContainer);
29
+ const categoriesInContainer = await container.findElements(ExtensionEditorDetailsSection.locators.ExtensionEditorDetailsSection.category);
30
+ for (const cat of categoriesInContainer) {
31
+ categories.push(await cat.getText());
32
+ }
33
+ return categories;
34
+ }
35
+ /**
36
+ * Get all resources of extension.
37
+ * @returns Promise resolving resources of extension.
38
+ */
39
+ async getResources() {
40
+ const resources = [];
41
+ const container = await this.findElement(ExtensionEditorDetailsSection.locators.ExtensionEditorDetailsSection.resourcesContainer);
42
+ const resourcesInContainer = await container.findElements(ExtensionEditorDetailsSection.locators.ExtensionEditorDetailsSection.resource);
43
+ for (const res of resourcesInContainer) {
44
+ resources.push(await res.getText());
45
+ }
46
+ return resources;
47
+ }
48
+ /**
49
+ * Get content of More Info section.
50
+ * @returns Promise resolving content of 'More Info' section.
51
+ */
52
+ async getMoreInfo() {
53
+ const moreInfo = {};
54
+ const container = await this.findElement(ExtensionEditorDetailsSection.locators.ExtensionEditorDetailsSection.moreInfoContainer);
55
+ const moreInfoInContainer = await container.findElements(ExtensionEditorDetailsSection.locators.ExtensionEditorDetailsSection.moreInfo);
56
+ for (const entry of moreInfoInContainer) {
57
+ const elmnts = await entry.findElements(ExtensionEditorDetailsSection.locators.ExtensionEditorDetailsSection.moreInfoElements);
58
+ const name = await (await elmnts.at(0))?.getText();
59
+ const value = await (await elmnts.at(1))?.getText();
60
+ if (name !== undefined && value !== undefined) {
61
+ moreInfo[name] = value;
62
+ }
63
+ }
64
+ return moreInfo;
65
+ }
66
+ /**
67
+ * Get value of specific attribute from 'More Info' section.
68
+ * @param key Name of attribute.
69
+ * @returns Promise resolving value for specified attribute.
70
+ */
71
+ async getMoreInfoItem(key) {
72
+ const moreInfo = await this.getMoreInfo();
73
+ return moreInfo[key];
74
+ }
75
+ /**
76
+ * Blocked by https://github.com/redhat-developer/vscode-extension-tester/issues/1492
77
+ */
78
+ async getReadme() {
79
+ throw Error('Not implemented yet.');
80
+ }
81
+ }
82
+ exports.ExtensionEditorDetailsSection = ExtensionEditorDetailsSection;
83
+ //# sourceMappingURL=ExtensionEditorDetailsSection.js.map
@@ -0,0 +1,61 @@
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 { Editor, EditorGroup, EditorView } from '../..';
18
+ export declare class ExtensionEditorView extends Editor {
19
+ constructor(view?: EditorView | EditorGroup);
20
+ /**
21
+ * Get name of extension.
22
+ * @returns Promise resolving name of extension.
23
+ */
24
+ getName(): Promise<string>;
25
+ /**
26
+ * Get version of extension.
27
+ * @returns Promise resolving version of extension.
28
+ */
29
+ getVersion(): Promise<string>;
30
+ /**
31
+ * Get publisher of extension.
32
+ * @returns Promise resolving publisher of extension.
33
+ */
34
+ getPublisher(): Promise<string>;
35
+ /**
36
+ * Get description of extension.
37
+ * @returns Promise description name of opened extension.
38
+ */
39
+ getDescription(): Promise<string>;
40
+ /**
41
+ * Get count of extension.
42
+ * @returns Promise resolving count of opened extension.
43
+ */
44
+ getCount(): Promise<string>;
45
+ /**
46
+ * Get available tabs.
47
+ * @returns Promise resolving tabs of opened extension.
48
+ */
49
+ getTabs(): Promise<string[]>;
50
+ /**
51
+ * Switch to different tab.
52
+ * @param tabName Name of required tab to be switched on.
53
+ * @returns Promise resolving to true if tabs were switched successfully, false otherwise.
54
+ */
55
+ switchToTab(tabName: string): Promise<boolean>;
56
+ /**
57
+ * Get name of opened tab.
58
+ * @returns Promise resolving name of opened tab.
59
+ */
60
+ getActiveTab(): Promise<string>;
61
+ }
@@ -0,0 +1,100 @@
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
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.ExtensionEditorView = void 0;
20
+ const __1 = require("../..");
21
+ class ExtensionEditorView extends __1.Editor {
22
+ constructor(view = new __1.EditorView()) {
23
+ super(view, ExtensionEditorView.locators.ExtensionEditorView.constructor);
24
+ }
25
+ /**
26
+ * Get name of extension.
27
+ * @returns Promise resolving name of extension.
28
+ */
29
+ async getName() {
30
+ const name = await this.findElement(ExtensionEditorView.locators.ExtensionEditorView.name);
31
+ return await name?.getText();
32
+ }
33
+ /**
34
+ * Get version of extension.
35
+ * @returns Promise resolving version of extension.
36
+ */
37
+ async getVersion() {
38
+ const name = await this.findElement(ExtensionEditorView.locators.ExtensionEditorView.version);
39
+ return await name?.getText();
40
+ }
41
+ /**
42
+ * Get publisher of extension.
43
+ * @returns Promise resolving publisher of extension.
44
+ */
45
+ async getPublisher() {
46
+ const name = await this.findElement(ExtensionEditorView.locators.ExtensionEditorView.publisher);
47
+ return await name?.getText();
48
+ }
49
+ /**
50
+ * Get description of extension.
51
+ * @returns Promise description name of opened extension.
52
+ */
53
+ async getDescription() {
54
+ const name = await this.findElement(ExtensionEditorView.locators.ExtensionEditorView.description);
55
+ return await name?.getText();
56
+ }
57
+ /**
58
+ * Get count of extension.
59
+ * @returns Promise resolving count of opened extension.
60
+ */
61
+ async getCount() {
62
+ const count = await this.findElement(ExtensionEditorView.locators.ExtensionEditorView.count);
63
+ return await count?.getText();
64
+ }
65
+ /**
66
+ * Get available tabs.
67
+ * @returns Promise resolving tabs of opened extension.
68
+ */
69
+ async getTabs() {
70
+ const tabs = [];
71
+ const navbar = await this.findElement(ExtensionEditorView.locators.ExtensionEditorView.navbar);
72
+ const els = await navbar.findElements(ExtensionEditorView.locators.ExtensionEditorView.tab);
73
+ for (const element of els) {
74
+ tabs.push(await element.getText());
75
+ }
76
+ return tabs;
77
+ }
78
+ /**
79
+ * Switch to different tab.
80
+ * @param tabName Name of required tab to be switched on.
81
+ * @returns Promise resolving to true if tabs were switched successfully, false otherwise.
82
+ */
83
+ async switchToTab(tabName) {
84
+ const navbar = await this.findElement(ExtensionEditorView.locators.ExtensionEditorView.navbar);
85
+ const requiredTab = await navbar.findElement(ExtensionEditorView.locators.ExtensionEditorView.specificTab(tabName));
86
+ await requiredTab.click();
87
+ return (await this.getActiveTab()).toLowerCase() === tabName.toLowerCase();
88
+ }
89
+ /**
90
+ * Get name of opened tab.
91
+ * @returns Promise resolving name of opened tab.
92
+ */
93
+ async getActiveTab() {
94
+ const navbar = await this.findElement(ExtensionEditorView.locators.ExtensionEditorView.navbar);
95
+ const features = await navbar.findElement(ExtensionEditorView.locators.ExtensionEditorView.activeTab);
96
+ return await features.getText();
97
+ }
98
+ }
99
+ exports.ExtensionEditorView = ExtensionEditorView;
100
+ //# sourceMappingURL=ExtensionEditorView.js.map
@@ -31,7 +31,7 @@ export declare class DebugToolbar extends AbstractElement {
31
31
  /**
32
32
  * Wait for the execution to pause at the next breakpoint
33
33
  */
34
- waitForBreakPoint(timeout?: undefined): Promise<void>;
34
+ waitForBreakPoint(timeout?: number): Promise<void>;
35
35
  /**
36
36
  * Click Continue
37
37
  */
@@ -41,7 +41,7 @@ class DebugToolbar extends AbstractElement_1.AbstractElement {
41
41
  /**
42
42
  * Wait for the execution to pause at the next breakpoint
43
43
  */
44
- async waitForBreakPoint(timeout = undefined) {
44
+ async waitForBreakPoint(timeout = 10_000) {
45
45
  let btn = await this.getDriver().wait(selenium_webdriver_1.until.elementLocated(DebugToolbar.locators.DebugToolbar.button('continue')));
46
46
  await this.getDriver().wait(async () => {
47
47
  try {
package/out/index.d.ts CHANGED
@@ -64,6 +64,8 @@ export * from './components/editor/DiffEditor';
64
64
  export * from './components/editor/WebView';
65
65
  export * from './components/editor/ContentAssist';
66
66
  export * from './components/editor/CustomEditor';
67
+ export * from './components/editor/ExtensionEditorView';
68
+ export * from './components/editor/ExtensionEditorDetailsSection';
67
69
  export { Notification, NotificationType } from './components/workbench/Notification';
68
70
  export * from './components/workbench/NotificationsCenter';
69
71
  export * from './components/workbench/input/Input';
package/out/index.js CHANGED
@@ -86,6 +86,8 @@ __exportStar(require("./components/editor/DiffEditor"), exports);
86
86
  __exportStar(require("./components/editor/WebView"), exports);
87
87
  __exportStar(require("./components/editor/ContentAssist"), exports);
88
88
  __exportStar(require("./components/editor/CustomEditor"), exports);
89
+ __exportStar(require("./components/editor/ExtensionEditorView"), exports);
90
+ __exportStar(require("./components/editor/ExtensionEditorDetailsSection"), exports);
89
91
  var Notification_1 = require("./components/workbench/Notification");
90
92
  Object.defineProperty(exports, "Notification", { enumerable: true, get: function () { return Notification_1.Notification; } });
91
93
  Object.defineProperty(exports, "NotificationType", { enumerable: true, get: function () { return Notification_1.NotificationType; } });
@@ -205,6 +205,27 @@ export interface Locators {
205
205
  container: (id: string) => By;
206
206
  attribute: string;
207
207
  };
208
+ ExtensionEditorView: {
209
+ constructor: By;
210
+ name: By;
211
+ version: By;
212
+ publisher: By;
213
+ description: By;
214
+ count: By;
215
+ navbar: By;
216
+ tab: By;
217
+ activeTab: By;
218
+ specificTab: (tabname: string) => By;
219
+ };
220
+ ExtensionEditorDetailsSection: {
221
+ categoriesContainer: By;
222
+ category: By;
223
+ resourcesContainer: By;
224
+ resource: By;
225
+ moreInfoContainer: By;
226
+ moreInfo: By;
227
+ moreInfoElements: By;
228
+ };
208
229
  ContextMenu: {
209
230
  contextView: By;
210
231
  constructor: By;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redhat-developer/page-objects",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
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",
@@ -47,5 +47,5 @@
47
47
  "selenium-webdriver": ">=4.6.1",
48
48
  "typescript": ">=4.6.2"
49
49
  },
50
- "gitHead": "1e2ae6db75e1f18fbc65cae5f4945200a9d93d8d"
50
+ "gitHead": "0cc4673eeebfed276b29e6a16ccda8738bca3102"
51
51
  }