@eclipse-che/che-e2e 7.73.0-dev-1397a5e → 7.73.0-dev-ed57855
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/configs/inversify.config.ts +6 -6
- package/configs/inversify.types.ts +27 -27
- package/configs/mocharc.ts +21 -21
- package/constants/APITestConstants.ts +39 -38
- package/constants/BaseTestConstants.ts +46 -43
- package/constants/ChromeDriverConstants.ts +29 -29
- package/constants/FactoryTestConstants.ts +30 -30
- package/constants/MonacoConstants.ts +10 -10
- package/constants/OAuthConstants.ts +46 -46
- package/constants/ReporterConstants.ts +28 -28
- package/constants/TimeoutConstants.ts +101 -101
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +1 -1
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/APITestConstants.js +2 -2
- package/dist/constants/APITestConstants.js.map +1 -1
- package/dist/constants/BaseTestConstants.js +2 -1
- package/dist/constants/BaseTestConstants.js.map +1 -1
- package/dist/constants/ChromeDriverConstants.js +1 -1
- package/dist/constants/ChromeDriverConstants.js.map +1 -1
- package/dist/constants/FactoryTestConstants.js +1 -1
- package/dist/constants/FactoryTestConstants.js.map +1 -1
- package/dist/constants/MonacoConstants.js +1 -1
- package/dist/constants/MonacoConstants.js.map +1 -1
- package/dist/constants/OAuthConstants.js +1 -1
- package/dist/constants/OAuthConstants.js.map +1 -1
- package/dist/constants/ReporterConstants.js +1 -1
- package/dist/constants/ReporterConstants.js.map +1 -1
- package/dist/constants/TimeoutConstants.js.map +1 -1
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +8 -8
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +11 -11
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +14 -14
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +8 -8
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +17 -17
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js +5 -5
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpLoginPage.js +10 -10
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +2 -2
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js +6 -6
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +2 -2
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpApplicationPage.js +2 -2
- package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js +5 -5
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js +11 -11
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
- package/dist/specs/MochaHooks.js +1 -1
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +7 -3
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +7 -5
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/api/PodOverridesAPI.spec.js +2 -1
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +9 -5
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +7 -3
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +6 -2
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +3 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +3 -1
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +4 -2
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +4 -2
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +6 -2
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +3 -3
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +54 -74
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +10 -10
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +2 -2
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +7 -7
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +81 -81
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +38 -35
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +19 -10
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/ShellExecutor.js.map +1 -1
- package/dist/utils/StringUtil.js +2 -2
- package/dist/utils/StringUtil.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +13 -11
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/workspace/ApiUrlResolver.js +3 -3
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
- package/dist/utils/workspace/TestWorkspaceUtil.js +20 -16
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
- package/driver/ChromeDriver.ts +44 -44
- package/driver/IDriver.ts +1 -1
- package/package.json +1 -1
- package/pageobjects/dashboard/CreateWorkspace.ts +52 -52
- package/pageobjects/dashboard/Dashboard.ts +72 -72
- package/pageobjects/dashboard/Workspaces.ts +138 -139
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +92 -93
- package/pageobjects/git-providers/OauthPage.ts +136 -136
- package/pageobjects/ide/CheCodeLocatorLoader.ts +40 -40
- package/pageobjects/login/interfaces/ICheLoginPage.ts +1 -1
- package/pageobjects/login/interfaces/IOcpLoginPage.ts +1 -1
- package/pageobjects/login/kubernetes/DexLoginPage.ts +27 -27
- package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +11 -11
- package/pageobjects/login/openshift/OcpLoginPage.ts +50 -50
- package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +21 -21
- package/pageobjects/login/openshift/OcpUserLoginPage.ts +14 -14
- package/pageobjects/login/openshift/RedHatLoginPage.ts +44 -41
- package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +23 -23
- package/pageobjects/openshift/OcpApplicationPage.ts +16 -16
- package/pageobjects/openshift/OcpImportFromGitPage.ts +54 -54
- package/pageobjects/openshift/OcpMainPage.ts +64 -64
- package/resources/pod-overrides-airgap.yaml +37 -0
- package/specs/MochaHooks.ts +44 -44
- package/specs/SmokeTest.spec.ts +35 -31
- package/specs/api/ContainerOverridesAPI.spec.ts +23 -23
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +93 -91
- package/specs/api/EmptyWorkspaceAPI.spec.ts +50 -50
- package/specs/api/PodOverridesAPI.spec.ts +30 -29
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +29 -25
- package/specs/dashboard-samples/Quarkus.spec.ts +31 -27
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +156 -152
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +62 -64
- package/specs/factory/Factory.spec.ts +149 -147
- package/specs/factory/NoSetupRepoFactory.spec.ts +188 -186
- package/specs/factory/RefusedOAuthFactory.spec.ts +182 -180
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +52 -48
- package/tests-library/LoginTests.ts +29 -29
- package/tests-library/ProjectAndFileTests.ts +13 -13
- package/tests-library/WorkspaceHandlingTests.ts +84 -103
- package/utils/BrowserTabsUtil.ts +69 -69
- package/utils/CheReporter.ts +4 -6
- package/utils/DevWorkspaceConfigurationHelper.ts +58 -58
- package/utils/DevfilesRegistryHelper.ts +51 -51
- package/utils/DriverHelper.ts +599 -600
- package/utils/KubernetesCommandLineToolsExecutor.ts +166 -158
- package/utils/Logger.ts +98 -67
- package/utils/ScreenCatcher.ts +42 -42
- package/utils/ShellExecutor.ts +10 -10
- package/utils/StringUtil.ts +29 -29
- package/utils/request-handlers/CheApiRequestHandler.ts +84 -82
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +18 -18
- package/utils/request-handlers/headers/IAuthorizationHeaderHandler.ts +1 -1
- package/utils/workspace/ApiUrlResolver.ts +23 -23
- package/utils/workspace/ITestWorkspaceUtil.ts +29 -29
- package/utils/workspace/TestWorkspaceUtil.ts +120 -116
- package/utils/workspace/WorkspaceStatus.ts +3 -3
|
@@ -20,90 +20,90 @@ import { e2eContainer } from '../../configs/inversify.config';
|
|
|
20
20
|
@injectable()
|
|
21
21
|
export class OcpMainPage {
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
private static getRoleLocator(role: string): By {
|
|
32
|
-
return By.xpath(`//a//*[text()="${role}"]`);
|
|
33
|
-
}
|
|
23
|
+
private static readonly MAIN_PAGE_HEADER_LOCATOR: By = By.id('page-main-header');
|
|
24
|
+
private static readonly SELECT_ROLE_BUTTON_LOCATOR: By = By.xpath('//*[@data-test-id="perspective-switcher-toggle"]');
|
|
25
|
+
private static readonly ADD_BUTTON_LOCATOR: By = By.xpath('//*[@data-test-id="+Add-header"]');
|
|
26
|
+
private static readonly IMPORT_FROM_GIT_ITEM_LOCATOR: By = By.xpath('//*[@data-test="item import-from-git"]');
|
|
27
|
+
private static readonly SELECT_PROJECT_DROPDOWN_LOCATOR: By = By.xpath('//div[@class="co-namespace-dropdown"]//button');
|
|
28
|
+
private static readonly PROJECT_FILTER_INPUT_LOCATOR: By = By.xpath('//*[@data-test="dropdown-text-filter"]');
|
|
29
|
+
private static readonly SKIP_TOUR_BUTTON_LOCATOR: By = By.xpath('//*[text()="Skip tour"]');
|
|
34
30
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
private static getRoleLocator(role: string): By {
|
|
32
|
+
return By.xpath(`//a//*[text()="${role}"]`);
|
|
33
|
+
}
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
private static getProjectDropdownItemLocator(projectName: string): By {
|
|
36
|
+
return By.xpath(`//button//*[text()="${projectName}"]`);
|
|
37
|
+
}
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
constructor(
|
|
40
|
+
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
async waitOpenMainPage(): Promise<void> {
|
|
43
|
+
Logger.debug();
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
await this.driverHelper.waitVisibility(OcpMainPage.MAIN_PAGE_HEADER_LOCATOR, TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
46
|
+
}
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
async clickOnSelectRoleButton(): Promise<void> {
|
|
49
|
+
Logger.debug();
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
await this.driverHelper.waitAndClick(OcpMainPage.SELECT_ROLE_BUTTON_LOCATOR);
|
|
52
|
+
}
|
|
56
53
|
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
async clickAddToProjectButton(): Promise<void> {
|
|
55
|
+
Logger.debug();
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
await this.driverHelper.waitAndClick(OcpMainPage.ADD_BUTTON_LOCATOR);
|
|
58
|
+
}
|
|
62
59
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
await this.clickOnSelectRoleButton();
|
|
66
|
-
await this.selectRole('Developer');
|
|
67
|
-
await this.tryToSkipWebTour();
|
|
68
|
-
}
|
|
60
|
+
async selectDeveloperRole(): Promise<void> {
|
|
61
|
+
Logger.debug();
|
|
69
62
|
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
await this.waitOpenMainPage();
|
|
64
|
+
await this.tryToSkipWebTour();
|
|
65
|
+
await this.clickOnSelectRoleButton();
|
|
66
|
+
await this.selectRole('Developer');
|
|
67
|
+
await this.tryToSkipWebTour();
|
|
68
|
+
}
|
|
72
69
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
70
|
+
async selectImportFromGitMethod(): Promise<OcpImportFromGitPage> {
|
|
71
|
+
Logger.debug();
|
|
76
72
|
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
await this.driverHelper.waitAndClick(OcpMainPage.IMPORT_FROM_GIT_ITEM_LOCATOR);
|
|
74
|
+
return e2eContainer.get(CLASSES.OcpImportFromGitPage);
|
|
75
|
+
}
|
|
79
76
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
77
|
+
async openImportFromGitPage(): Promise<OcpImportFromGitPage> {
|
|
78
|
+
Logger.debug();
|
|
83
79
|
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
await this.clickAddToProjectButton();
|
|
81
|
+
return await this.selectImportFromGitMethod();
|
|
82
|
+
}
|
|
86
83
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
await this.driverHelper.waitAndClick(OcpMainPage.getProjectDropdownItemLocator(projectName));
|
|
90
|
-
}
|
|
84
|
+
async selectProject(projectName: string): Promise<void> {
|
|
85
|
+
Logger.debug();
|
|
91
86
|
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
await this.driverHelper.waitAndClick(OcpMainPage.SELECT_PROJECT_DROPDOWN_LOCATOR);
|
|
88
|
+
await this.driverHelper.enterValue(OcpMainPage.PROJECT_FILTER_INPUT_LOCATOR, projectName);
|
|
89
|
+
await this.driverHelper.waitAndClick(OcpMainPage.getProjectDropdownItemLocator(projectName));
|
|
90
|
+
}
|
|
94
91
|
|
|
95
|
-
|
|
96
|
-
}
|
|
92
|
+
private async selectRole(role: string): Promise<void> {
|
|
93
|
+
Logger.debug(`selecting role ${role}`);
|
|
94
|
+
|
|
95
|
+
await this.driverHelper.waitAndClick(OcpMainPage.getRoleLocator(role));
|
|
96
|
+
}
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
private async tryToSkipWebTour(): Promise<void> {
|
|
99
|
+
Logger.debug();
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
if (await this.driverHelper.isVisible(OcpMainPage.SKIP_TOUR_BUTTON_LOCATOR)) {
|
|
102
|
+
await this.driverHelper.waitAndClick(OcpMainPage.SKIP_TOUR_BUTTON_LOCATOR);
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
104
|
+
Logger.debug(`welcome tour modal dialog was located and skipped`);
|
|
105
|
+
} else {
|
|
106
|
+
Logger.debug(`welcome tour modal dialog was not located`);
|
|
108
107
|
}
|
|
108
|
+
}
|
|
109
109
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
kind: DevWorkspace
|
|
2
|
+
apiVersion: workspace.devfile.io/v1alpha2
|
|
3
|
+
metadata:
|
|
4
|
+
name: code-latest-pod-overrides
|
|
5
|
+
spec:
|
|
6
|
+
started: true
|
|
7
|
+
template:
|
|
8
|
+
attributes:
|
|
9
|
+
pod-overrides:
|
|
10
|
+
metadata:
|
|
11
|
+
annotations:
|
|
12
|
+
io.openshift.userns: "true"
|
|
13
|
+
io.kubernetes.cri-o.userns-mode: "auto:size=65536;map-to-root=true" # <-- user namespace
|
|
14
|
+
openshift.io/scc: container-build
|
|
15
|
+
spec:
|
|
16
|
+
runtimeClassName: kata
|
|
17
|
+
schedulerName: stork
|
|
18
|
+
projects:
|
|
19
|
+
- name: web-nodejs-sample
|
|
20
|
+
git:
|
|
21
|
+
remotes:
|
|
22
|
+
origin: "https://github.com/che-samples/web-nodejs-sample.git"
|
|
23
|
+
commands:
|
|
24
|
+
- id: say-hello
|
|
25
|
+
exec:
|
|
26
|
+
component: che-code-runtime-description
|
|
27
|
+
commandLine: echo "Hello from $(pwd)"
|
|
28
|
+
workingDir: ${PROJECT_SOURCE}/app
|
|
29
|
+
contributions:
|
|
30
|
+
- name: che-code
|
|
31
|
+
uri: http://plugin-registry.openshift-devspaces.svc.cluster.local:8080/v3/plugins/che-incubator/che-code/latest/devfile.yaml
|
|
32
|
+
components:
|
|
33
|
+
- name: che-code-runtime-description
|
|
34
|
+
container:
|
|
35
|
+
env:
|
|
36
|
+
- name: CODE_HOST
|
|
37
|
+
value: 0.0.0.0
|
package/specs/MochaHooks.ts
CHANGED
|
@@ -28,51 +28,51 @@ const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUt
|
|
|
28
28
|
let latestWorkspace: string = '';
|
|
29
29
|
|
|
30
30
|
export function registerRunningWorkspace(workspaceName: string): void {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
Logger.debug(`with workspaceName:${workspaceName}`);
|
|
32
|
+
latestWorkspace = workspaceName;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
exports.mochaHooks = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
36
|
+
beforeAll: [
|
|
37
|
+
async function enableRequestInterceptor(): Promise<void> {
|
|
38
|
+
if (BaseTestConstants.TS_SELENIUM_REQUEST_INTERCEPTOR) {
|
|
39
|
+
CheApiRequestHandler.enableRequestInterceptor();
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
async function enableResponseInterceptor(): Promise<void> {
|
|
43
|
+
if (BaseTestConstants.TS_SELENIUM_RESPONSE_INTERCEPTOR) {
|
|
44
|
+
CheApiRequestHandler.enableResponseInterceptor();
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
async function initMonacoPageObjects(): Promise<void> {
|
|
48
|
+
// init vscode-extension-tester monaco-page-objects
|
|
49
|
+
monacoPageObjects.initPageObjects(MonacoConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_USE_VERSION, MonacoConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION, vscodeExtensionTesterLocators.getLocatorsPath(), driverHelper.getDriver(), 'google-chrome');
|
|
50
|
+
},
|
|
51
|
+
async function prolongTimeoutConstantsInDebugMode(): Promise<void> {
|
|
52
|
+
if (BaseTestConstants.TS_DEBUG_MODE) {
|
|
53
|
+
for (let [timeout, seconds] of Object.entries(TimeoutConstants)) {
|
|
54
|
+
Object.defineProperty(TimeoutConstants, timeout, { value: seconds as number * 100 });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
afterEach: [
|
|
60
|
+
// stop and remove running workspace
|
|
61
|
+
async function(this: Mocha.Context): Promise<void> {
|
|
62
|
+
if (this.currentTest?.state === 'failed') {
|
|
63
|
+
if (BaseTestConstants.DELETE_WORKSPACE_ON_FAILED_TEST) {
|
|
64
|
+
Logger.info('Property DELETE_WORKSPACE_ON_FAILED_TEST is true - trying to stop and delete running workspace with API.');
|
|
65
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(latestWorkspace);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
afterAll: [
|
|
71
|
+
async function stopTheDriver(): Promise<void> {
|
|
72
|
+
if (!BaseTestConstants.TS_DEBUG_MODE && ChromeDriverConstants.TS_USE_WEB_DRIVER_FOR_TEST) {
|
|
73
|
+
await driverHelper.getDriver().quit();
|
|
74
|
+
Logger.info('Chrome driver session stopped.');
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
]
|
|
78
78
|
};
|
package/specs/SmokeTest.spec.ts
CHANGED
|
@@ -26,36 +26,40 @@ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.
|
|
|
26
26
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
27
27
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
28
28
|
|
|
29
|
-
suite(`The SmokeTest userstory`, async function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
test('Register running workspace', async () => {
|
|
37
|
-
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
38
|
-
});
|
|
39
|
-
test('Wait workspace readiness', async function (): Promise<void> {
|
|
40
|
-
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
41
|
-
});
|
|
42
|
-
test('Check a project folder has been created', async function (): Promise<void> {
|
|
43
|
-
const projectName: string = FactoryTestConstants.TS_SELENIUM_PROJECT_NAME || StringUtil.getProjectNameFromGitUrl(factoryUrl);
|
|
44
|
-
projectSection = await new SideBarView().getContent().getSection(projectName);
|
|
45
|
-
Logger.debug(`new SideBarView().getContent().getSection: get ${projectName}`);
|
|
46
|
-
});
|
|
47
|
-
test('Check the project files was imported', async function (): Promise<void> {
|
|
48
|
-
Logger.debug(`projectSection.findItem: find ${BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME}`);
|
|
49
|
-
const isFileImported: ViewItem | undefined = await projectSection.findItem(BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME);
|
|
50
|
-
expect(isFileImported).not.eqls(undefined);
|
|
51
|
-
});
|
|
52
|
-
test('Stop the workspace', async function (): Promise<void> {
|
|
53
|
-
await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
54
|
-
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
55
|
-
});
|
|
56
|
-
test('Delete the workspace', async function (): Promise<void> {
|
|
57
|
-
await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
58
|
-
});
|
|
59
|
-
loginTests.logoutFromChe();
|
|
29
|
+
suite(`The SmokeTest userstory`, async function(): Promise<void> {
|
|
30
|
+
const factoryUrl: string = FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL || 'https://github.com/che-incubator/quarkus-api-example.git';
|
|
31
|
+
let projectSection: ViewSection;
|
|
32
|
+
suite(`Create workspace from factory:${factoryUrl}`, async function(): Promise<void> {
|
|
33
|
+
loginTests.loginIntoChe();
|
|
34
|
+
test(`Create and open new workspace from factory:${factoryUrl}`, async function(): Promise<void> {
|
|
35
|
+
await workspaceHandlingTests.createAndOpenWorkspaceFromGitRepository(factoryUrl);
|
|
60
36
|
});
|
|
37
|
+
test('Obtain workspace name from workspace loader page', async function(): Promise<void> {
|
|
38
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
39
|
+
});
|
|
40
|
+
test('Register running workspace', async function(): Promise<void> {
|
|
41
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
42
|
+
});
|
|
43
|
+
test('Wait workspace readiness', async function(): Promise<void> {
|
|
44
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
45
|
+
});
|
|
46
|
+
test('Check a project folder has been created', async function(): Promise<void> {
|
|
47
|
+
const projectName: string = FactoryTestConstants.TS_SELENIUM_PROJECT_NAME || StringUtil.getProjectNameFromGitUrl(factoryUrl);
|
|
48
|
+
projectSection = await new SideBarView().getContent().getSection(projectName);
|
|
49
|
+
Logger.debug(`new SideBarView().getContent().getSection: get ${projectName}`);
|
|
50
|
+
});
|
|
51
|
+
test('Check the project files was imported', async function(): Promise<void> {
|
|
52
|
+
Logger.debug(`projectSection.findItem: find ${BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME}`);
|
|
53
|
+
const isFileImported: ViewItem | undefined = await projectSection.findItem(BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME);
|
|
54
|
+
expect(isFileImported).not.eqls(undefined);
|
|
55
|
+
});
|
|
56
|
+
test('Stop the workspace', async function(): Promise<void> {
|
|
57
|
+
await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
58
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
59
|
+
});
|
|
60
|
+
test('Delete the workspace', async function(): Promise<void> {
|
|
61
|
+
await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
62
|
+
});
|
|
63
|
+
loginTests.logoutFromChe();
|
|
64
|
+
});
|
|
61
65
|
});
|
|
@@ -5,34 +5,34 @@ import YAML from 'yaml';
|
|
|
5
5
|
import { expect } from 'chai';
|
|
6
6
|
import { ShellExecutor } from '../../utils/ShellExecutor';
|
|
7
7
|
|
|
8
|
-
suite(`Test defining container overrides via attribute.`, async function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
suite(`Test defining container overrides via attribute.`, async function(): Promise<void> {
|
|
9
|
+
const pathToSampleFile: string = path.resolve('resources/container-overrides.yaml');
|
|
10
|
+
const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name;
|
|
11
|
+
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(workspaceName);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
suiteSetup('Login into OC client', function(): void {
|
|
14
|
+
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
15
|
+
});
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
suiteTeardown('Delete DevWorkspace', function(): void {
|
|
18
|
+
kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
|
|
19
|
+
});
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
test('Apply container-overrides sample as DevWorkspace with OC client', function(): void {
|
|
22
|
+
kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsFile(pathToSampleFile);
|
|
23
|
+
ShellExecutor.wait(5);
|
|
24
|
+
});
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
26
|
+
test('Check that fields are overridden in the Deployment for DevWorkspace', function(): void {
|
|
27
|
+
const devWorkspaceFullYamlOutput: any = YAML.parse(kubernetesCommandLineToolsExecutor.getDevWorkspaceYamlConfiguration());
|
|
28
|
+
expect(devWorkspaceFullYamlOutput.spec.template.components[0].attributes['container-overrides']).eqls({
|
|
29
|
+
resources: {
|
|
30
|
+
limits: {
|
|
31
|
+
'nvidia.com/gpu': '1'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
35
34
|
});
|
|
35
|
+
});
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
|
|
@@ -4,7 +4,7 @@ import { ShellString } from 'shelljs';
|
|
|
4
4
|
import { expect } from 'chai';
|
|
5
5
|
import { DevfileContext } from '@eclipse-che/che-devworkspace-generator/lib/api/devfile-context';
|
|
6
6
|
import { StringUtil } from '../../utils/StringUtil';
|
|
7
|
-
import { DevfilesRegistryHelper } from '../../utils/DevfilesRegistryHelper';
|
|
7
|
+
// import { DevfilesRegistryHelper } from '../../utils/DevfilesRegistryHelper';
|
|
8
8
|
import { Logger } from '../../utils/Logger';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -12,95 +12,97 @@ import { Logger } from '../../utils/Logger';
|
|
|
12
12
|
* info: https://mochajs.org/#delayed-root-suite
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
(async function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
devWorkspaceName = devfileContext?.devWorkspace?.metadata?.name;
|
|
39
|
-
|
|
40
|
-
kubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(devWorkspaceName);
|
|
41
|
-
containerTerminal = new KubernetesCommandLineToolsExecutor.ContainerTerminal(kubernetesCommandLineToolsExecutor);
|
|
42
|
-
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
test('Collect build commands from the devfile', async function (): Promise<void> {
|
|
46
|
-
if (devfileContext.devfile.commands === undefined) {
|
|
47
|
-
Logger.info(`Devfile does not contains any commands.`);
|
|
48
|
-
} else {
|
|
49
|
-
devfileContext.devfile.commands.forEach((command: any) => {
|
|
50
|
-
if (command.exec?.group?.kind === 'build') {
|
|
51
|
-
Logger.debug(`Build command found: ${command.exec.commandLine}`);
|
|
52
|
-
devfilesBuildCommands.push(command);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
test('Create DevWorkspace', async function (): Promise<void> {
|
|
59
|
-
const devWorkspaceConfigurationYamlString: string = await devWorkspaceConfigurationHelper.getDevWorkspaceConfigurationYamlAsString(devfileContext);
|
|
60
|
-
const applyOutput: ShellString = kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsStringOutput(devWorkspaceConfigurationYamlString);
|
|
61
|
-
|
|
62
|
-
expect(applyOutput.stdout)
|
|
63
|
-
.contains('devworkspacetemplate')
|
|
64
|
-
.and.contains('devworkspace')
|
|
65
|
-
.and.contains.oneOf(['created', 'configured']);
|
|
66
|
-
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
test('Wait until DevWorkspace has status "ready"', async function (): Promise<void> {
|
|
70
|
-
expect(kubernetesCommandLineToolsExecutor.waitDevWorkspace().stdout).contains('condition met');
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
test('Check if project was created', function (): void {
|
|
74
|
-
clonedProjectName = StringUtil.getProjectNameFromGitUrl(devfileSample.link);
|
|
75
|
-
expect(containerTerminal.ls().stdout).includes(clonedProjectName);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
test('Check if project files are imported', function (): void {
|
|
79
|
-
containerWorkDir = containerTerminal.pwd().stdout.replace('\n', '');
|
|
80
|
-
expect(containerTerminal.ls(`${containerWorkDir}/${clonedProjectName}`).stdout).includes(`devfile.yaml`);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
test(`Check if build commands returns success`, function (): void {
|
|
84
|
-
if (devfilesBuildCommands.length === 0) {
|
|
85
|
-
Logger.info(`Devfile does not contains build commands.`);
|
|
86
|
-
} else {
|
|
87
|
-
devfilesBuildCommands.forEach((command) => {
|
|
88
|
-
Logger.info(`command.exec: ${JSON.stringify(command.exec)}`);
|
|
89
|
-
|
|
90
|
-
const commandString: string = StringUtil.updateCommandEnvsToShStyle(`cd ${command.exec.workingDir} && ${command.exec.commandLine}`);
|
|
91
|
-
Logger.info(`Full build command to be executed: ${commandString}`);
|
|
92
|
-
|
|
93
|
-
const output: ShellString = containerTerminal.executeCommand(commandString, command.exec.component);
|
|
94
|
-
expect(output.code).eqls(0);
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
test('Delete DevWorkspace', async function (): Promise<void> {
|
|
100
|
-
kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
|
|
101
|
-
});
|
|
15
|
+
(async function(): Promise<void> {
|
|
16
|
+
|
|
17
|
+
// todo: skipped while don`t use to avoid sending useless requests
|
|
18
|
+
// const devfilesRegistryHelper: DevfilesRegistryHelper = new DevfilesRegistryHelper();
|
|
19
|
+
const devfileSamples: any = [];
|
|
20
|
+
// devfileSamples = await devfilesRegistryHelper.collectPathsToDevfilesFromRegistry();
|
|
21
|
+
|
|
22
|
+
for (const devfileSample of devfileSamples) {
|
|
23
|
+
suite.skip(`Devfile acceptance test suite for ${devfileSample.name}`, async function(): Promise<void> {
|
|
24
|
+
this.bail(false);
|
|
25
|
+
this.timeout(1500000); // 25 minutes because build of Quarkus sample takes 20+ minutes
|
|
26
|
+
let devWorkspaceConfigurationHelper: DevWorkspaceConfigurationHelper;
|
|
27
|
+
let kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor;
|
|
28
|
+
let containerTerminal: KubernetesCommandLineToolsExecutor.ContainerTerminal;
|
|
29
|
+
let devfileContext: DevfileContext;
|
|
30
|
+
let devWorkspaceName: string | undefined;
|
|
31
|
+
let clonedProjectName: string;
|
|
32
|
+
let containerWorkDir: string;
|
|
33
|
+
let devfilesBuildCommands: any[] = [];
|
|
34
|
+
|
|
35
|
+
test('Get DevWorkspace configuration', async function(): Promise<void> {
|
|
36
|
+
devWorkspaceConfigurationHelper = new DevWorkspaceConfigurationHelper({
|
|
37
|
+
devfileUrl: devfileSample.link
|
|
102
38
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
39
|
+
devfileContext = await devWorkspaceConfigurationHelper.generateDevfileContext();
|
|
40
|
+
devWorkspaceName = devfileContext?.devWorkspace?.metadata?.name;
|
|
41
|
+
|
|
42
|
+
kubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(devWorkspaceName);
|
|
43
|
+
containerTerminal = new KubernetesCommandLineToolsExecutor.ContainerTerminal(kubernetesCommandLineToolsExecutor);
|
|
44
|
+
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('Collect build commands from the devfile', async function(): Promise<void> {
|
|
48
|
+
if (devfileContext.devfile.commands === undefined) {
|
|
49
|
+
Logger.info(`Devfile does not contains any commands.`);
|
|
50
|
+
} else {
|
|
51
|
+
devfileContext.devfile.commands.forEach((command: any) => {
|
|
52
|
+
if (command.exec?.group?.kind === 'build') {
|
|
53
|
+
Logger.debug(`Build command found: ${command.exec.commandLine}`);
|
|
54
|
+
devfilesBuildCommands.push(command);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('Create DevWorkspace', async function(): Promise<void> {
|
|
61
|
+
const devWorkspaceConfigurationYamlString: string = await devWorkspaceConfigurationHelper.getDevWorkspaceConfigurationYamlAsString(devfileContext);
|
|
62
|
+
const applyOutput: ShellString = kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsStringOutput(devWorkspaceConfigurationYamlString);
|
|
63
|
+
|
|
64
|
+
expect(applyOutput.stdout)
|
|
65
|
+
.contains('devworkspacetemplate')
|
|
66
|
+
.and.contains('devworkspace')
|
|
67
|
+
.and.contains.oneOf(['created', 'configured']);
|
|
68
|
+
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('Wait until DevWorkspace has status "ready"', async function(): Promise<void> {
|
|
72
|
+
expect(kubernetesCommandLineToolsExecutor.waitDevWorkspace().stdout).contains('condition met');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('Check if project was created', function(): void {
|
|
76
|
+
clonedProjectName = StringUtil.getProjectNameFromGitUrl(devfileSample.link);
|
|
77
|
+
expect(containerTerminal.ls().stdout).includes(clonedProjectName);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test('Check if project files are imported', function(): void {
|
|
81
|
+
containerWorkDir = containerTerminal.pwd().stdout.replace('\n', '');
|
|
82
|
+
expect(containerTerminal.ls(`${containerWorkDir}/${clonedProjectName}`).stdout).includes(`devfile.yaml`);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test(`Check if build commands returns success`, function(): void {
|
|
86
|
+
if (devfilesBuildCommands.length === 0) {
|
|
87
|
+
Logger.info(`Devfile does not contains build commands.`);
|
|
88
|
+
} else {
|
|
89
|
+
devfilesBuildCommands.forEach((command) => {
|
|
90
|
+
Logger.info(`command.exec: ${JSON.stringify(command.exec)}`);
|
|
91
|
+
|
|
92
|
+
const commandString: string = StringUtil.updateCommandEnvsToShStyle(`cd ${command.exec.workingDir} && ${command.exec.commandLine}`);
|
|
93
|
+
Logger.info(`Full build command to be executed: ${commandString}`);
|
|
94
|
+
|
|
95
|
+
const output: ShellString = containerTerminal.executeCommand(commandString, command.exec.component);
|
|
96
|
+
expect(output.code).eqls(0);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test('Delete DevWorkspace', async function(): Promise<void> {
|
|
102
|
+
kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
run();
|
|
106
108
|
})();
|