@eclipse-che/che-e2e 7.66.0-dev-5e8a484 → 7.66.0-dev-37c09e5
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 +10 -4
- package/configs/inversify.types.ts +3 -0
- package/dist/configs/inversify.config.js +7 -3
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +3 -0
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/pageobjects/openshift/OcpApplicationPage.js +60 -0
- package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -0
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js +91 -0
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -0
- package/dist/pageobjects/openshift/OcpLoginPage.js +3 -3
- package/dist/pageobjects/openshift/OcpLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js +91 -0
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -0
- package/dist/specs/api/ContainerOverridesAPI.spec.js +36 -0
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -0
- package/dist/specs/api/PodOverridesAPI.spec.js +42 -0
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -0
- package/dist/specs/dashboard-samples/RecomendedExtentions.spec.js +1 -1
- package/dist/specs/dashboard-samples/RecomendedExtentions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +74 -0
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -0
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js +19 -11
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +3 -0
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +5 -1
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/DriverHelper.js +29 -3
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +49 -4
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/ShellExecutor.js +3 -0
- package/dist/utils/ShellExecutor.js.map +1 -1
- package/index.ts +3 -0
- package/package.json +3 -2
- package/pageobjects/openshift/OcpApplicationPage.ts +42 -0
- package/pageobjects/openshift/OcpImportFromGitPage.ts +87 -0
- package/pageobjects/openshift/OcpLoginPage.ts +3 -3
- package/pageobjects/openshift/OcpMainPage.ts +87 -0
- package/resources/container-overrides.yaml +28 -0
- package/resources/pod-overrides.yaml +37 -0
- package/specs/api/ContainerOverridesAPI.spec.ts +37 -0
- package/specs/api/PodOverridesAPI.spec.ts +43 -0
- package/specs/dashboard-samples/RecomendedExtentions.spec.ts +1 -1
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +97 -0
- package/specs/factory/Factory.spec.ts +1 -1
- package/specs/factory/NoSetupRepoFactory.spec.ts +1 -1
- package/specs/factory/RefusedOAuthFactory.spec.ts +1 -1
- package/tests-library/LoginTests.ts +17 -8
- package/tests-library/ProjectAndFileTests.ts +3 -0
- package/utils/BrowserTabsUtil.ts +5 -3
- package/utils/DriverHelper.ts +36 -4
- package/utils/KubernetesCommandLineToolsExecutor.ts +36 -5
- package/utils/ShellExecutor.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShellExecutor.js","sourceRoot":"","sources":["../../utils/ShellExecutor.ts"],"names":[],"mappings":";;;AAAA,qCAAkD;AAElD,MAAa,aAAa;
|
|
1
|
+
{"version":3,"file":"ShellExecutor.js","sourceRoot":"","sources":["../../utils/ShellExecutor.ts"],"names":[],"mappings":";;;AAAA,qCAAkD;AAElD,MAAa,aAAa;IAEtB,IAAI,CAAC,OAAe;QAChB,IAAI,CAAC,WAAW,CAAC,SAAS,OAAO,GAAG,CAAC,CAAC;IAC1C,CAAC;IAES,WAAW,CAAC,OAAe;QACjC,cAAI,CAAC,OAAO,CAAC,CAAC;QACd,OAAO,cAAI,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;CACJ;AAVD,sCAUC"}
|
package/index.ts
CHANGED
|
@@ -33,7 +33,10 @@ export * from './pageobjects/login/OcpUserLoginPage';
|
|
|
33
33
|
export * from './pageobjects/login/RedHatLoginPage';
|
|
34
34
|
export * from './pageobjects/login/RegularUserOcpCheLoginPage';
|
|
35
35
|
export * from './pageobjects/openshift/CheLoginPage';
|
|
36
|
+
export * from './pageobjects/openshift/OcpApplicationPage';
|
|
37
|
+
export * from './pageobjects/openshift/OcpImportFromGitPage';
|
|
36
38
|
export * from './pageobjects/openshift/OcpLoginPage';
|
|
39
|
+
export * from './pageobjects/openshift/OcpMainPage';
|
|
37
40
|
export * from './tests-library/LoginTests';
|
|
38
41
|
export * from './tests-library/ProjectAndFileTests';
|
|
39
42
|
export * from './tests-library/WorkspaceHandlingTests';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-che/che-e2e",
|
|
3
|
-
"version": "7.66.0-dev-
|
|
3
|
+
"version": "7.66.0-dev-37c09e5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"ts-node": "^10.9.1",
|
|
36
36
|
"tslint": "^6.1.3",
|
|
37
37
|
"typescript": "3.9.9",
|
|
38
|
-
"vscode-extension-tester-locators": "3.1.0"
|
|
38
|
+
"vscode-extension-tester-locators": "3.1.0",
|
|
39
|
+
"yaml": "^2.2.2"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
42
|
"@eclipse-che/api": "latest",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* Copyright (c) 2019-2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import 'reflect-metadata';
|
|
11
|
+
import { inject, injectable } from 'inversify';
|
|
12
|
+
import { DriverHelper } from '../../utils/DriverHelper';
|
|
13
|
+
import { CLASSES } from '../../configs/inversify.types';
|
|
14
|
+
import { By } from 'selenium-webdriver';
|
|
15
|
+
import { Logger } from '../../utils/Logger';
|
|
16
|
+
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
17
|
+
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
18
|
+
|
|
19
|
+
@injectable()
|
|
20
|
+
export class OcpApplicationPage {
|
|
21
|
+
|
|
22
|
+
private static readonly APPLICATION_ICON_LOCATOR: By = By.xpath('//*[@data-test-id="base-node-handler"]');
|
|
23
|
+
private static readonly EDIT_SOURCE_CODE_ICON_LOCATOR: By = By.xpath('//*[@aria-label="Edit source code"]');
|
|
24
|
+
|
|
25
|
+
constructor(
|
|
26
|
+
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper,
|
|
27
|
+
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil) {
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async waitApplicationIcon(): Promise<void> {
|
|
31
|
+
Logger.debug(`${this.constructor.name}.${this.waitApplicationIcon.name}`);
|
|
32
|
+
|
|
33
|
+
await this.driverHelper.waitPresence(OcpApplicationPage.APPLICATION_ICON_LOCATOR, TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async waitAndOpenEditSourceCodeIcon(): Promise<void> {
|
|
37
|
+
Logger.debug(`${this.constructor.name}.${this.waitAndOpenEditSourceCodeIcon.name}`);
|
|
38
|
+
const parentGUID: string = await this.browserTabsUtil.getCurrentWindowHandle();
|
|
39
|
+
await this.driverHelper.waitAndClick(OcpApplicationPage.EDIT_SOURCE_CODE_ICON_LOCATOR);
|
|
40
|
+
await this.browserTabsUtil.waitAndSwitchToAnotherWindow(parentGUID, TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* Copyright (c) 2019-2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import 'reflect-metadata';
|
|
11
|
+
import { inject, injectable } from 'inversify';
|
|
12
|
+
import { DriverHelper } from '../../utils/DriverHelper';
|
|
13
|
+
import { CLASSES } from '../../configs/inversify.types';
|
|
14
|
+
import { By } from 'selenium-webdriver';
|
|
15
|
+
import { Logger } from '../../utils/Logger';
|
|
16
|
+
import { OcpApplicationPage } from './OcpApplicationPage';
|
|
17
|
+
import { e2eContainer } from '../../configs/inversify.config';
|
|
18
|
+
|
|
19
|
+
@injectable()
|
|
20
|
+
export class OcpImportFromGitPage {
|
|
21
|
+
|
|
22
|
+
private static readonly GIT_URL_INPUT_LOCATOR: By = By.id('form-input-git-url-field');
|
|
23
|
+
private static readonly SHOW_ADVANCED_GIT_OPTIONS_LINK_LOCATOR: By = By.xpath('//*[text()="Show advanced Git options"]//ancestor::button');
|
|
24
|
+
private static readonly HIDE_ADVANCED_GIT_OPTIONS_LOCATOR: By = By.xpath('//*[text()="Hide advanced Git options"]');
|
|
25
|
+
private static readonly GIT_REFERENCE_INPUT_LOCATOR: By = By.id('form-input-git-ref-field');
|
|
26
|
+
private static readonly EDIT_IMPORT_STRATEGY_LINK_LOCATOR: By = By.xpath('//*[text()="Edit Import Strategy"]//ancestor::button');
|
|
27
|
+
private static readonly BUILDER_IMAGE_STRATEGY_ITEM_LOCATOR: By = By.xpath('//*[text()="Builder Image"]//parent::div//parent::div');
|
|
28
|
+
private static readonly ADD_LABEL_LINK_LOCATOR: By = By.xpath('//button[text()="Labels"]');
|
|
29
|
+
private static readonly ADD_LABEL_INPUT_LOCATOR: By = By.id('form-selector-labels-field');
|
|
30
|
+
private static readonly SUBMIT_BUTTON_LOCATOR: By = By.xpath('//*[@data-test-id="submit-button"]');
|
|
31
|
+
|
|
32
|
+
constructor(
|
|
33
|
+
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) {
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async enterGitRepoUrl(gitRepoUrl: string): Promise<void> {
|
|
37
|
+
Logger.debug(`${this.constructor.name}.${this.enterGitRepoUrl.name} "${gitRepoUrl}"`);
|
|
38
|
+
|
|
39
|
+
await this.driverHelper.enterValue(OcpImportFromGitPage.GIT_URL_INPUT_LOCATOR, gitRepoUrl);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async clickOnAdvancedOptionsButton(): Promise<void> {
|
|
43
|
+
Logger.debug(`${this.constructor.name}.${this.clickOnAdvancedOptionsButton.name}`);
|
|
44
|
+
|
|
45
|
+
if (!(await this.driverHelper.isVisible(OcpImportFromGitPage.HIDE_ADVANCED_GIT_OPTIONS_LOCATOR))) {
|
|
46
|
+
await this.driverHelper.waitAndClick(OcpImportFromGitPage.SHOW_ADVANCED_GIT_OPTIONS_LINK_LOCATOR);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async enterGitReference(gitReference: string): Promise<void> {
|
|
51
|
+
Logger.debug(`${this.constructor.name}.${this.enterGitReference.name} "${gitReference}"`);
|
|
52
|
+
|
|
53
|
+
await this.driverHelper.enterValue(OcpImportFromGitPage.GIT_REFERENCE_INPUT_LOCATOR, gitReference);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async selectBuilderImageImportStrategy(): Promise<void> {
|
|
57
|
+
Logger.debug(`${this.constructor.name}.${this.selectBuilderImageImportStrategy.name}`);
|
|
58
|
+
|
|
59
|
+
await this.driverHelper.scrollToAndClick(OcpImportFromGitPage.EDIT_IMPORT_STRATEGY_LINK_LOCATOR);
|
|
60
|
+
await this.driverHelper.scrollToAndClick(OcpImportFromGitPage.BUILDER_IMAGE_STRATEGY_ITEM_LOCATOR);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async addLabel(label: string): Promise<void> {
|
|
64
|
+
Logger.debug(`${this.constructor.name}.${this.addLabel.name} "${label}"`);
|
|
65
|
+
|
|
66
|
+
await this.driverHelper.scrollToAndClick(OcpImportFromGitPage.ADD_LABEL_LINK_LOCATOR);
|
|
67
|
+
await this.driverHelper.scrollToAndEnterValue(OcpImportFromGitPage.ADD_LABEL_INPUT_LOCATOR, label);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async submitConfiguration(): Promise<OcpApplicationPage> {
|
|
71
|
+
Logger.debug(`${this.constructor.name}.${this.submitConfiguration.name}`);
|
|
72
|
+
|
|
73
|
+
await this.driverHelper.waitAndClick(OcpImportFromGitPage.SUBMIT_BUTTON_LOCATOR);
|
|
74
|
+
return e2eContainer.get(CLASSES.OcpApplicationPage);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async fitAndSubmitConfiguration(gitRepoUrl: string, gitReference: string, label: string): Promise<OcpApplicationPage> {
|
|
78
|
+
Logger.debug(`${this.constructor.name}.${this.fitAndSubmitConfiguration.name}`);
|
|
79
|
+
|
|
80
|
+
await this.enterGitRepoUrl(gitRepoUrl);
|
|
81
|
+
await this.clickOnAdvancedOptionsButton();
|
|
82
|
+
await this.enterGitReference(gitReference);
|
|
83
|
+
await this.selectBuilderImageImportStrategy();
|
|
84
|
+
await this.addLabel(label);
|
|
85
|
+
return await this.submitConfiguration();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -34,7 +34,7 @@ export class OcpLoginPage {
|
|
|
34
34
|
Logger.debug('OcpLoginPage.clickOnLoginProviderTitle');
|
|
35
35
|
|
|
36
36
|
const loginProviderTitleLocator: By = By.xpath(`//a[text()=\'${TestConstants.TS_OCP_LOGIN_PAGE_PROVIDER_TITLE}\']`);
|
|
37
|
-
await this.driverHelper.waitAndClick(loginProviderTitleLocator);
|
|
37
|
+
await this.driverHelper.waitAndClick(loginProviderTitleLocator, TimeoutConstants.TS_SELENIUM_WAIT_FOR_URL);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
async isIdentityProviderLinkVisible(): Promise<boolean> {
|
|
@@ -80,8 +80,8 @@ export class OcpLoginPage {
|
|
|
80
80
|
async clickOnLoginButton(): Promise<void> {
|
|
81
81
|
Logger.debug('OcpLoginPage.clickOnLoginButton');
|
|
82
82
|
|
|
83
|
-
const
|
|
84
|
-
await this.driverHelper.waitAndClick(
|
|
83
|
+
const loginButtonLocator: By = By.css('button[type=submit]');
|
|
84
|
+
await this.driverHelper.waitAndClick(loginButtonLocator);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
async waitDisappearanceOpenShiftLoginWelcomePage(): Promise<void> {
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* Copyright (c) 2019-2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import 'reflect-metadata';
|
|
11
|
+
import { inject, injectable } from 'inversify';
|
|
12
|
+
import { DriverHelper } from '../../utils/DriverHelper';
|
|
13
|
+
import { CLASSES } from '../../configs/inversify.types';
|
|
14
|
+
import { By } from 'selenium-webdriver';
|
|
15
|
+
import { Logger } from '../../utils/Logger';
|
|
16
|
+
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
17
|
+
import { OcpImportFromGitPage } from './OcpImportFromGitPage';
|
|
18
|
+
import { e2eContainer } from '../../configs/inversify.config';
|
|
19
|
+
|
|
20
|
+
@injectable()
|
|
21
|
+
export class OcpMainPage {
|
|
22
|
+
|
|
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
|
+
|
|
30
|
+
private static getRoleLocator(role: string): By {
|
|
31
|
+
return By.xpath(`//a//*[text()="${role}"]`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private static getProjectDropdownItemLocator(projectName: string): By {
|
|
35
|
+
return By.xpath(`//button//*[text()="${projectName}"]`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
constructor(
|
|
39
|
+
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
|
|
40
|
+
|
|
41
|
+
async waitOpenMainPage(): Promise<void> {
|
|
42
|
+
Logger.debug(`${this.constructor.name}.${this.waitOpenMainPage.name}`);
|
|
43
|
+
|
|
44
|
+
await this.driverHelper.waitVisibility(OcpMainPage.MAIN_PAGE_HEADER_LOCATOR, TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async clickOnSelectRoleButton(): Promise<void> {
|
|
48
|
+
Logger.debug(`${this.constructor.name}.${this.clickOnSelectRoleButton.name}`);
|
|
49
|
+
|
|
50
|
+
await this.driverHelper.waitAndClick(OcpMainPage.SELECT_ROLE_BUTTON_LOCATOR);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async clickAddToProjectButton(): Promise<void> {
|
|
54
|
+
Logger.debug(`${this.constructor.name}.${this.clickAddToProjectButton.name}`);
|
|
55
|
+
|
|
56
|
+
await this.driverHelper.waitAndClick(OcpMainPage.ADD_BUTTON_LOCATOR);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async selectDeveloperRole(): Promise<void> {
|
|
60
|
+
Logger.debug(`${this.constructor.name}.${this.selectDeveloperRole.name}`);
|
|
61
|
+
|
|
62
|
+
await this.driverHelper.waitAndClick(OcpMainPage.getRoleLocator('Developer'));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async selectImportFromGitMethod(): Promise<OcpImportFromGitPage> {
|
|
66
|
+
Logger.debug(`${this.constructor.name}.${this.selectImportFromGitMethod.name}`);
|
|
67
|
+
|
|
68
|
+
await this.driverHelper.waitAndClick(OcpMainPage.IMPORT_FROM_GIT_ITEM_LOCATOR);
|
|
69
|
+
return e2eContainer.get(CLASSES.OcpImportFromGitPage);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async openImportFromGitPage(): Promise<OcpImportFromGitPage> {
|
|
73
|
+
await this.waitOpenMainPage();
|
|
74
|
+
await this.clickOnSelectRoleButton();
|
|
75
|
+
await this.selectDeveloperRole();
|
|
76
|
+
await this.clickAddToProjectButton();
|
|
77
|
+
return await this.selectImportFromGitMethod();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async selectProject(projectName: string): Promise<void> {
|
|
81
|
+
Logger.debug(`${this.constructor.name}.${this.selectProject.name}`);
|
|
82
|
+
|
|
83
|
+
await this.driverHelper.waitAndClick(OcpMainPage.SELECT_PROJECT_DROPDOWN_LOCATOR);
|
|
84
|
+
await this.driverHelper.enterValue(OcpMainPage.PROJECT_FILTER_INPUT_LOCATOR, projectName);
|
|
85
|
+
await this.driverHelper.waitAndClick(OcpMainPage.getProjectDropdownItemLocator(projectName));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
kind: DevWorkspace
|
|
2
|
+
apiVersion: workspace.devfile.io/v1alpha2
|
|
3
|
+
metadata:
|
|
4
|
+
name: web-terminal-container-overrides
|
|
5
|
+
spec:
|
|
6
|
+
started: true
|
|
7
|
+
template:
|
|
8
|
+
attributes:
|
|
9
|
+
controller.devfile.io/storage-type: ephemeral
|
|
10
|
+
projects:
|
|
11
|
+
- name: web-nodejs-sample
|
|
12
|
+
git:
|
|
13
|
+
remotes:
|
|
14
|
+
origin: "https://github.com/che-samples/web-nodejs-sample.git"
|
|
15
|
+
components:
|
|
16
|
+
- name: web-terminal
|
|
17
|
+
attributes:
|
|
18
|
+
container-overrides: {"resources":{"limits":{"nvidia.com/gpu":"1"}}}
|
|
19
|
+
container:
|
|
20
|
+
image: quay.io/wto/web-terminal-tooling:next
|
|
21
|
+
args:
|
|
22
|
+
- tail
|
|
23
|
+
- '-f'
|
|
24
|
+
- /dev/null
|
|
25
|
+
cpuLimit: 400m
|
|
26
|
+
cpuRequest: 100m
|
|
27
|
+
memoryLimit: 256Mi
|
|
28
|
+
memoryRequest: 128Mi
|
|
@@ -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: https://eclipse-che.github.io/che-plugin-registry/main/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
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import YAML from 'yaml';
|
|
5
|
+
import { expect } from 'chai';
|
|
6
|
+
|
|
7
|
+
suite(`Test defining container overrides via attribute.`, async function (): Promise<void> {
|
|
8
|
+
const pathToSampleFile: string = path.resolve('resources/container-overrides.yaml');
|
|
9
|
+
const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name;
|
|
10
|
+
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(workspaceName);
|
|
11
|
+
|
|
12
|
+
suiteSetup('Login into OC client', function (): void {
|
|
13
|
+
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
suiteTeardown('Delete DewWorkspace', function (): void {
|
|
17
|
+
kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('Apply container-overrides sample as DewWorkspace with OC client', function (): void {
|
|
21
|
+
kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsFile(pathToSampleFile);
|
|
22
|
+
kubernetesCommandLineToolsExecutor.wait(5);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('Check that fields are overridden in the Deployment for DewWorkspace', function (): void {
|
|
26
|
+
const devWorkspaceFullYamlOutput: any = YAML.parse(kubernetesCommandLineToolsExecutor.getDevWorkspaceYamlConfiguration());
|
|
27
|
+
expect(devWorkspaceFullYamlOutput.spec.template.components[0].attributes['container-overrides']).eqls({
|
|
28
|
+
resources: {
|
|
29
|
+
limits: {
|
|
30
|
+
'nvidia.com/gpu': '1'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import YAML from 'yaml';
|
|
5
|
+
import { expect } from 'chai';
|
|
6
|
+
|
|
7
|
+
suite(`Test defining pod overrides via attribute.`, async function (): Promise<void> {
|
|
8
|
+
const pathToSampleFile: string = path.resolve('resources/pod-overrides.yaml');
|
|
9
|
+
const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name;
|
|
10
|
+
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(workspaceName);
|
|
11
|
+
|
|
12
|
+
suiteSetup('Login into OC client', function (): void {
|
|
13
|
+
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
suiteTeardown('Delete DewWorkspace', function (): void {
|
|
17
|
+
kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('Apply pod-overrides sample as DewWorkspace with OC client', function (): void {
|
|
21
|
+
kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsFile(pathToSampleFile);
|
|
22
|
+
kubernetesCommandLineToolsExecutor.wait(5);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('Check that fields are overridden in the Deployment for DewWorkspace', function (): void {
|
|
26
|
+
const devWorkspaceFullYamlOutput: any = YAML.parse(kubernetesCommandLineToolsExecutor.getDevWorkspaceYamlConfiguration());
|
|
27
|
+
expect(devWorkspaceFullYamlOutput.spec.template.attributes['pod-overrides']).eqls({
|
|
28
|
+
metadata: {
|
|
29
|
+
annotations: {
|
|
30
|
+
'io.kubernetes.cri-o.userns-mode': 'auto:size=65536;map-to-root=true',
|
|
31
|
+
'io.openshift.userns': 'true',
|
|
32
|
+
'openshift.io/scc': 'container-build'
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
spec: {
|
|
36
|
+
runtimeClassName: 'kata',
|
|
37
|
+
schedulerName: 'stork'
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
|
|
@@ -109,7 +109,7 @@ suite(`Check if recommended extensions installed for ${samples}`, async function
|
|
|
109
109
|
test(`Let extensions complete installation`, async function (): Promise<void> {
|
|
110
110
|
Logger.info(`Time for extensions installation TimeoutConstants.TS_COMMON_PLUGIN_TEST_TIMEOUT=${TimeoutConstants.TS_COMMON_PLUGIN_TEST_TIMEOUT}`);
|
|
111
111
|
await driverHelper.wait(TimeoutConstants.TS_COMMON_PLUGIN_TEST_TIMEOUT);
|
|
112
|
-
browserTabsUtil.refreshPage();
|
|
112
|
+
await browserTabsUtil.refreshPage();
|
|
113
113
|
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
114
114
|
});
|
|
115
115
|
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* Copyright (c) 2019-2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
SideBarView,
|
|
13
|
+
ViewItem,
|
|
14
|
+
ViewSection
|
|
15
|
+
} from 'monaco-page-objects';
|
|
16
|
+
import { registerRunningWorkspace } from '../MochaHooks';
|
|
17
|
+
import { LoginTests } from '../../tests-library/LoginTests';
|
|
18
|
+
import { e2eContainer } from '../../configs/inversify.config';
|
|
19
|
+
import { CLASSES } from '../../configs/inversify.types';
|
|
20
|
+
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
21
|
+
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
22
|
+
import { expect } from 'chai';
|
|
23
|
+
import { TestConstants } from '../../constants/TestConstants';
|
|
24
|
+
import { OcpMainPage } from '../../pageobjects/openshift/OcpMainPage';
|
|
25
|
+
import { OcpImportFromGitPage } from '../../pageobjects/openshift/OcpImportFromGitPage';
|
|
26
|
+
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
27
|
+
import { GitUtil } from '../../utils/vsc/GitUtil';
|
|
28
|
+
import { OcpApplicationPage } from '../../pageobjects/openshift/OcpApplicationPage';
|
|
29
|
+
|
|
30
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
31
|
+
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
32
|
+
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
33
|
+
const ocpMainPage: OcpMainPage = e2eContainer.get(CLASSES.OcpMainPage);
|
|
34
|
+
let ocpImportPage: OcpImportFromGitPage;
|
|
35
|
+
let ocpApplicationPage: OcpApplicationPage;
|
|
36
|
+
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor();
|
|
37
|
+
|
|
38
|
+
// works only with no-admin user
|
|
39
|
+
suite(`DevConsole Integration`, async function (): Promise<void> {
|
|
40
|
+
// test specific data
|
|
41
|
+
const gitImportRepo: string = 'https://github.com/crw-qe/summit-lab-spring-music.git';
|
|
42
|
+
const gitImportReference: string = 'pipeline';
|
|
43
|
+
const projectLabel: string = 'app.openshift.io/runtime=spring';
|
|
44
|
+
const projectName: string = 'devconsole-integration-test';
|
|
45
|
+
|
|
46
|
+
suiteSetup('Create new empty project using ocp', async function (): Promise<void> {
|
|
47
|
+
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
48
|
+
kubernetesCommandLineToolsExecutor.createProject(projectName);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
loginTests.loginIntoOcpConsole();
|
|
52
|
+
|
|
53
|
+
test('Select test project on DevConsole', async function (): Promise<void> {
|
|
54
|
+
await ocpMainPage.selectProject(projectName);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test('Open import from git project page as Developer', async function (): Promise<void> {
|
|
58
|
+
ocpImportPage = await ocpMainPage.openImportFromGitPage();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('Fill and submit import data', async function (): Promise<void> {
|
|
62
|
+
ocpApplicationPage = await ocpImportPage.fitAndSubmitConfiguration(gitImportRepo, gitImportReference, projectLabel);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('Wait until application creates', async function (): Promise<void> {
|
|
66
|
+
await ocpApplicationPage.waitApplicationIcon();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('Check if application has worked link "Open Source Code"', async function (): Promise<void> {
|
|
70
|
+
await ocpApplicationPage.waitAndOpenEditSourceCodeIcon();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
loginTests.loginIntoChe();
|
|
74
|
+
|
|
75
|
+
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
76
|
+
|
|
77
|
+
test('Registering the running workspace', async function (): Promise<void> {
|
|
78
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test('Check if application source code opens in workspace', async function (): Promise<void> {
|
|
82
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('Check if project and files imported', async function (): Promise<void> {
|
|
86
|
+
const applicationSourceProjectName: string = GitUtil.getProjectNameFromGitUrl(gitImportRepo);
|
|
87
|
+
const projectSection: ViewSection = await new SideBarView().getContent().getSection(applicationSourceProjectName);
|
|
88
|
+
const isFileImported: ViewItem | undefined = await projectSection.findItem(TestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME);
|
|
89
|
+
expect(isFileImported).not.eqls(undefined);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
loginTests.logoutFromChe();
|
|
93
|
+
|
|
94
|
+
suiteTeardown('Delete project using ocp', async function (): Promise<void> {
|
|
95
|
+
kubernetesCommandLineToolsExecutor.deleteProject(projectName);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -89,7 +89,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
89
89
|
|
|
90
90
|
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
91
91
|
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
92
|
-
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName
|
|
92
|
+
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
test('Check if the project files were imported', async function (): Promise<void> {
|
|
@@ -115,7 +115,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
115
115
|
|
|
116
116
|
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
117
117
|
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
118
|
-
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName
|
|
118
|
+
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
test('Accept the project as a trusted one', async function (): Promise<void> {
|
|
@@ -98,7 +98,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
98
98
|
|
|
99
99
|
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
100
100
|
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
101
|
-
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName
|
|
101
|
+
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
test('Accept the project as a trusted one', async function (): Promise<void> {
|
|
@@ -12,27 +12,36 @@ import { CLASSES, TYPES } from '../configs/inversify.types';
|
|
|
12
12
|
import { ICheLoginPage } from '../pageobjects/login/ICheLoginPage';
|
|
13
13
|
import { TestConstants } from '../constants/TestConstants';
|
|
14
14
|
import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
|
|
15
|
-
import { Logger } from '../utils/Logger';
|
|
16
15
|
import { inject, injectable } from 'inversify';
|
|
17
16
|
import { Dashboard } from '../pageobjects/dashboard/Dashboard';
|
|
17
|
+
import { IOcpLoginPage } from '../pageobjects/login/IOcpLoginPage';
|
|
18
18
|
|
|
19
19
|
@injectable()
|
|
20
20
|
export class LoginTests {
|
|
21
21
|
constructor(
|
|
22
22
|
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil,
|
|
23
|
-
@inject(TYPES.CheLogin) private readonly
|
|
23
|
+
@inject(TYPES.CheLogin) private readonly productLoginPage: ICheLoginPage,
|
|
24
|
+
@inject(TYPES.OcpLogin) private readonly ocpLoginPage: IOcpLoginPage,
|
|
24
25
|
@inject(CLASSES.Dashboard) private readonly dashboard: Dashboard) {
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
public loginIntoChe(): void {
|
|
28
29
|
test('Login', async () => {
|
|
29
|
-
await this.browserTabsUtil.
|
|
30
|
-
|
|
31
|
-
if (TestConstants.TS_SELENIUM_LAUNCH_FULLSCREEN) {
|
|
32
|
-
Logger.debug(`TS_SELENIUM_LAUNCH_FULLSCREEN is set to true, maximizing window.`);
|
|
33
|
-
await this.browserTabsUtil.maximize();
|
|
34
|
-
await this.dashboard.waitStartingPageLoaderDisappearance();
|
|
30
|
+
if (!(await this.browserTabsUtil.getCurrentUrl()).includes(TestConstants.TS_SELENIUM_BASE_URL)) {
|
|
31
|
+
await this.browserTabsUtil.navigateTo(TestConstants.TS_SELENIUM_BASE_URL);
|
|
35
32
|
}
|
|
33
|
+
await this.productLoginPage.login();
|
|
34
|
+
await this.browserTabsUtil.maximize();
|
|
35
|
+
await this.dashboard.waitStartingPageLoaderDisappearance();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public loginIntoOcpConsole(): void {
|
|
40
|
+
test('Login into ocp console', async () => {
|
|
41
|
+
const openshiftConsoleUrl: string = TestConstants.TS_SELENIUM_BASE_URL.replace('devspaces', 'console-openshift-console');
|
|
42
|
+
await this.browserTabsUtil.navigateTo(openshiftConsoleUrl);
|
|
43
|
+
await this.ocpLoginPage.login();
|
|
44
|
+
await this.browserTabsUtil.maximize();
|
|
36
45
|
});
|
|
37
46
|
}
|
|
38
47
|
|
|
@@ -24,7 +24,10 @@ export class ProjectAndFileTests {
|
|
|
24
24
|
|
|
25
25
|
public async waitWorkspaceReadinessForCheCodeEditor(): Promise<void> {
|
|
26
26
|
try {
|
|
27
|
+
const start: number = new Date().getTime();
|
|
27
28
|
await this.driverHelper.getDriver().wait(until.elementLocated(By.className('monaco-workbench')), TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
|
|
29
|
+
const end: number = new Date().getTime();
|
|
30
|
+
Logger.debug(`${this.constructor.name}.${this.waitWorkspaceReadinessForCheCodeEditor.name} - editor was opened in ${end - start} seconds.`);
|
|
28
31
|
} catch (err) {
|
|
29
32
|
Logger.error(`ProjectAndFileTestsCheCode.waitWorkspaceReadinessForCheCodeEditor - waiting for workspace readiness failed: ${err}`);
|
|
30
33
|
throw err;
|
package/utils/BrowserTabsUtil.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { CLASSES } from '../configs/inversify.types';
|
|
|
13
13
|
import { DriverHelper } from './DriverHelper';
|
|
14
14
|
import { Logger } from './Logger';
|
|
15
15
|
import { TimeoutConstants } from '../constants/TimeoutConstants';
|
|
16
|
+
import { TestConstants } from '../constants/TestConstants';
|
|
16
17
|
|
|
17
18
|
@injectable()
|
|
18
19
|
export class BrowserTabsUtil {
|
|
@@ -91,8 +92,9 @@ export class BrowserTabsUtil {
|
|
|
91
92
|
|
|
92
93
|
public async maximize(): Promise<void> {
|
|
93
94
|
Logger.trace(`BrowserTabsUtil.maximize`);
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
if (TestConstants.TS_SELENIUM_LAUNCH_FULLSCREEN) {
|
|
96
|
+
Logger.debug(`TS_SELENIUM_LAUNCH_FULLSCREEN is set to true, maximizing window.`);
|
|
97
|
+
await this.driverHelper.getDriver().manage().window().maximize();
|
|
98
|
+
}
|
|
96
99
|
}
|
|
97
|
-
|
|
98
100
|
}
|