@eclipse-che/che-e2e 7.76.0-next-e6e37f6 → 7.76.0-next-c26a986
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.
- package/dist/pageobjects/dashboard/Dashboard.js +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +4 -16
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +7 -6
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +6 -8
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +3 -4
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +8 -8
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +7 -11
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +7 -9
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.js +6 -7
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.js.map +1 -1
- package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js +2 -12
- package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js.map +1 -1
- package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js +10 -9
- package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +44 -1
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/package.json +2 -2
- package/pageobjects/dashboard/Dashboard.ts +1 -1
- package/specs/SmokeTest.spec.ts +8 -9
- package/specs/dashboard-samples/Quarkus.spec.ts +13 -7
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +6 -8
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +10 -4
- package/specs/factory/Factory.spec.ts +9 -11
- package/specs/factory/NoSetupRepoFactory.spec.ts +7 -13
- package/specs/factory/RefusedOAuthFactory.spec.ts +7 -11
- package/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.ts +13 -7
- package/specs/miscellaneous/KubedockPodmanTest.spec.ts +3 -3
- package/specs/miscellaneous/WorkspaceWithParent.spec.ts +15 -10
- package/tests-library/ProjectAndFileTests.ts +58 -2
|
@@ -15,7 +15,7 @@ import { CLASSES } from '../configs/inversify.types';
|
|
|
15
15
|
import { Logger } from '../utils/Logger';
|
|
16
16
|
import { TIMEOUT_CONSTANTS } from '../constants/TIMEOUT_CONSTANTS';
|
|
17
17
|
import { CheCodeLocatorLoader } from '../pageobjects/ide/CheCodeLocatorLoader';
|
|
18
|
-
import { Workbench } from 'monaco-page-objects';
|
|
18
|
+
import { SideBarView, ViewContent, ViewItem, ViewSection, Workbench } from 'monaco-page-objects';
|
|
19
19
|
|
|
20
20
|
@injectable()
|
|
21
21
|
export class ProjectAndFileTests {
|
|
@@ -45,13 +45,16 @@ export class ProjectAndFileTests {
|
|
|
45
45
|
async performTrustAuthorDialog(): Promise<void> {
|
|
46
46
|
Logger.debug();
|
|
47
47
|
// sometimes the trust dialog does not appear at first time, for avoiding this problem we send click event for activating
|
|
48
|
-
|
|
48
|
+
const workbench: Workbench = new Workbench();
|
|
49
|
+
await workbench.click();
|
|
50
|
+
|
|
49
51
|
await this.driverHelper.waitAndClick(
|
|
50
52
|
this.cheCodeLocatorLoader.webCheCodeLocators.WelcomeContent.button,
|
|
51
53
|
TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT
|
|
52
54
|
);
|
|
53
55
|
|
|
54
56
|
try {
|
|
57
|
+
await workbench.click();
|
|
55
58
|
await this.driverHelper.waitAndClick(
|
|
56
59
|
this.cheCodeLocatorLoader.webCheCodeLocators.WelcomeContent.button,
|
|
57
60
|
TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT
|
|
@@ -60,4 +63,57 @@ export class ProjectAndFileTests {
|
|
|
60
63
|
Logger.info('Second welcome content dialog box was not shown');
|
|
61
64
|
}
|
|
62
65
|
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* find an ViewSection with project tree.
|
|
69
|
+
* @returns Promise resolving to ViewSection object
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
async getProjectViewSession(): Promise<ViewSection> {
|
|
73
|
+
Logger.debug();
|
|
74
|
+
|
|
75
|
+
await this.driverHelper.waitVisibility(
|
|
76
|
+
this.cheCodeLocatorLoader.webCheCodeLocators.DefaultTreeSection.itemRow,
|
|
77
|
+
TIMEOUT_CONSTANTS.TS_EXPAND_PROJECT_TREE_ITEM_TIMEOUT
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const viewContent: ViewContent = new SideBarView().getContent();
|
|
81
|
+
const [projectSection]: ViewSection[] = await viewContent.getSections();
|
|
82
|
+
return projectSection;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* find an item in this view section by label. Does not perform recursive search through the whole tree.
|
|
87
|
+
* Does however scroll through all the expanded content. Will find items beyond the current scroll range.
|
|
88
|
+
* @param projectSection ViewSection with project tree files.
|
|
89
|
+
* @param label Label of the item to search for.
|
|
90
|
+
* @param itemLevel Shows how deep the algorithm should look into expanded folders to find item,
|
|
91
|
+
* default - 2 means first level is project directory and files inside it is the second level, unlimited 0
|
|
92
|
+
* @returns Promise resolving to ViewItem object is such item exists, undefined otherwise
|
|
93
|
+
*/
|
|
94
|
+
async getProjectTreeItem(projectSection: ViewSection, label: string, itemLevel: number = 2): Promise<ViewItem | undefined> {
|
|
95
|
+
Logger.debug(`${label}`);
|
|
96
|
+
|
|
97
|
+
let projectTreeItem: ViewItem | undefined;
|
|
98
|
+
await this.driverHelper.waitVisibility(
|
|
99
|
+
this.cheCodeLocatorLoader.webCheCodeLocators.ScmView.itemLevel(itemLevel),
|
|
100
|
+
TIMEOUT_CONSTANTS.TS_EXPAND_PROJECT_TREE_ITEM_TIMEOUT
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
try {
|
|
104
|
+
projectTreeItem = await projectSection.findItem(label, itemLevel);
|
|
105
|
+
if (!projectTreeItem) {
|
|
106
|
+
try {
|
|
107
|
+
await projectSection.collapse();
|
|
108
|
+
projectTreeItem = await projectSection.findItem(label, itemLevel);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
Logger.warn(JSON.stringify(e));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
} catch (e) {
|
|
114
|
+
Logger.warn(JSON.stringify(e));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return projectTreeItem;
|
|
118
|
+
}
|
|
63
119
|
}
|