@eclipse-che/che-e2e 7.81.0-next-07ed023 → 7.81.0-next-b489639
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.types.ts +2 -1
- package/constants/BASE_TEST_CONSTANTS.ts +2 -2
- package/dist/configs/inversify.types.js +2 -1
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -1
- package/dist/pageobjects/dashboard/UserPreferences.js +32 -0
- package/dist/pageobjects/dashboard/UserPreferences.js.map +1 -1
- package/dist/specs/miscellaneous/RevokeOauth.spec.js +29 -0
- package/dist/specs/miscellaneous/RevokeOauth.spec.js.map +1 -0
- package/dist/specs/miscellaneous/UserPreferencesTest.spec.js +1 -1
- package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js +12 -3
- package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js.map +1 -1
- package/package.json +1 -1
- package/pageobjects/dashboard/UserPreferences.ts +42 -0
- package/specs/miscellaneous/RevokeOauth.spec.ts +32 -0
- package/specs/miscellaneous/UserPreferencesTest.spec.ts +1 -1
- package/specs/miscellaneous/WorkspaceWithParent.spec.ts +14 -3
|
@@ -49,7 +49,8 @@ const CLASSES: any = {
|
|
|
49
49
|
ShellExecutor: 'ShellExecutor',
|
|
50
50
|
ContainerTerminal: 'ContainerTerminal',
|
|
51
51
|
UserPreferences: 'UserPreferences',
|
|
52
|
-
WebTerminalPage: 'WebTerminalPage'
|
|
52
|
+
WebTerminalPage: 'WebTerminalPage',
|
|
53
|
+
RevokeOauthPage: 'RevokeOauthPage'
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
const EXTERNAL_CLASSES: any = {
|
|
@@ -66,8 +66,8 @@ export const BASE_TEST_CONSTANTS: {
|
|
|
66
66
|
return BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL.includes('devspaces')
|
|
67
67
|
? 'devspaces'
|
|
68
68
|
: BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL.includes('che')
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
? 'che'
|
|
70
|
+
: 'default';
|
|
71
71
|
},
|
|
72
72
|
/**
|
|
73
73
|
* testing application version
|
|
@@ -51,7 +51,8 @@ const CLASSES = {
|
|
|
51
51
|
ShellExecutor: 'ShellExecutor',
|
|
52
52
|
ContainerTerminal: 'ContainerTerminal',
|
|
53
53
|
UserPreferences: 'UserPreferences',
|
|
54
|
-
WebTerminalPage: 'WebTerminalPage'
|
|
54
|
+
WebTerminalPage: 'WebTerminalPage',
|
|
55
|
+
RevokeOauthPage: 'RevokeOauthPage'
|
|
55
56
|
};
|
|
56
57
|
exports.CLASSES = CLASSES;
|
|
57
58
|
const EXTERNAL_CLASSES = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inversify.types.js","sourceRoot":"","sources":["../../configs/inversify.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;;AAExE,MAAM,KAAK,GAAQ;IAClB,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;IAC1C,2BAA2B,EAAE,MAAM,CAAC,GAAG,CAAC,6BAA6B,CAAC;IACtE,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;IAC1C,mCAAmC,EAAE,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC;IACtF,cAAc,EAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;CAC5C,CAAC;
|
|
1
|
+
{"version":3,"file":"inversify.types.js","sourceRoot":"","sources":["../../configs/inversify.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;;AAExE,MAAM,KAAK,GAA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iC,KAAK,MAAM;IAE3F;;OAEG;IACH,uBAAuB,EAAE,GAAY,EAAE,CAAC,2BAAmB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAEnG;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,QAAQ,CAAC,SAAS;IAE1D;;;OAGG;IACH,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,UAAU;IAEhE;;OAEG;IACH,kCAAkC,EAAE,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,cAAc;IAEpG;;OAEG;IACH,iCAAiC,EAAE,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,QAAQ;IAE5F;;OAEG;IACH,qCAAqC,EAAE,OAAO,CAAC,GAAG,CAAC,qCAAqC,IAAI,gBAAgB;IAE5G;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,OAAO;IAEnD;;OAEG;IACH,+BAA+B,EAAE,OAAO,CAAC,GAAG,CAAC,+BAA+B,KAAK,MAAM;IAEvF;;OAEG;IACH,gCAAgC,EAAE,OAAO,CAAC,GAAG,CAAC,gCAAgC,KAAK,MAAM;IAEzF;;OAEG;IACH,+BAA+B,EAAE,OAAO,CAAC,GAAG,CAAC,+BAA+B,KAAK,MAAM;IAEvF;;OAEG;IACH,mCAAmC,EAAE,OAAO,CAAC,GAAG,CAAC,+BAA+B,KAAK,MAAM;IAE3F;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM;CACnD,CAAC"}
|
|
@@ -29,6 +29,7 @@ const inversify_types_1 = require("../../configs/inversify.types");
|
|
|
29
29
|
const selenium_webdriver_1 = require("selenium-webdriver");
|
|
30
30
|
const DriverHelper_1 = require("../../utils/DriverHelper");
|
|
31
31
|
const Logger_1 = require("../../utils/Logger");
|
|
32
|
+
const FACTORY_TEST_CONSTANTS_1 = require("../../constants/FACTORY_TEST_CONSTANTS");
|
|
32
33
|
let UserPreferences = UserPreferences_1 = class UserPreferences {
|
|
33
34
|
constructor(driverHelper) {
|
|
34
35
|
this.driverHelper = driverHelper;
|
|
@@ -55,6 +56,19 @@ let UserPreferences = UserPreferences_1 = class UserPreferences {
|
|
|
55
56
|
Logger_1.Logger.debug();
|
|
56
57
|
await this.driverHelper.waitAndClick(UserPreferences_1.GIT_SERVICES_TAB);
|
|
57
58
|
}
|
|
59
|
+
async revokeGitService(servicesName) {
|
|
60
|
+
Logger_1.Logger.debug();
|
|
61
|
+
await this.selectListItem(servicesName);
|
|
62
|
+
await this.driverHelper.waitAndClick(UserPreferences_1.GIT_SERVICES_REVOKE_BUTTON);
|
|
63
|
+
await this.driverHelper.waitVisibility(UserPreferences_1.CONFIRMATION_WINDOW);
|
|
64
|
+
await this.driverHelper.waitAndClick(UserPreferences_1.DELETE_CONFIRMATION_CHECKBOX);
|
|
65
|
+
await this.driverHelper.waitAndClick(UserPreferences_1.DELETE_ITEM_BUTTON_ENABLED);
|
|
66
|
+
await this.driverHelper.waitDisappearance(this.getServicesListItemLocator(servicesName));
|
|
67
|
+
}
|
|
68
|
+
async selectListItem(servicesName) {
|
|
69
|
+
Logger_1.Logger.debug(`of the '${servicesName}' list item`);
|
|
70
|
+
await this.driverHelper.waitAndClick(this.getServicesListItemLocator(servicesName));
|
|
71
|
+
}
|
|
58
72
|
async openPatTab() {
|
|
59
73
|
Logger_1.Logger.debug();
|
|
60
74
|
await this.driverHelper.waitAndClick(UserPreferences_1.PAT_TAB);
|
|
@@ -69,17 +83,35 @@ let UserPreferences = UserPreferences_1 = class UserPreferences {
|
|
|
69
83
|
await this.driverHelper.waitAndClick(UserPreferences_1.SSH_KEY_TAB);
|
|
70
84
|
await this.driverHelper.waitVisibility(UserPreferences_1.ADD_NEW_SSH_KEY_BUTTON);
|
|
71
85
|
}
|
|
86
|
+
getServiceConfig(service) {
|
|
87
|
+
const gitService = {
|
|
88
|
+
[FACTORY_TEST_CONSTANTS_1.GitProviderType.GITHUB]: 'GitHub',
|
|
89
|
+
[FACTORY_TEST_CONSTANTS_1.GitProviderType.GITLAB]: 'GitLab',
|
|
90
|
+
[FACTORY_TEST_CONSTANTS_1.GitProviderType.AZURE_DEVOPS]: 'Microsoft Azure DevOps',
|
|
91
|
+
[FACTORY_TEST_CONSTANTS_1.GitProviderType.BITBUCKET_CLOUD_OAUTH2]: 'Bitbucket Cloud',
|
|
92
|
+
[FACTORY_TEST_CONSTANTS_1.GitProviderType.BITBUCKET_SERVER_OAUTH1]: 'Bitbucket Server',
|
|
93
|
+
[FACTORY_TEST_CONSTANTS_1.GitProviderType.BITBUCKET_SERVER_OAUTH2]: 'Bitbucket Server'
|
|
94
|
+
};
|
|
95
|
+
return gitService[service];
|
|
96
|
+
}
|
|
97
|
+
getServicesListItemLocator(servicesName) {
|
|
98
|
+
return selenium_webdriver_1.By.xpath(`//tr[td[text()='${servicesName}']]//input`);
|
|
99
|
+
}
|
|
72
100
|
};
|
|
73
101
|
UserPreferences.USER_SETTINGS_DROPDOWN = selenium_webdriver_1.By.xpath('//header//button/span[text()!=""]//parent::button');
|
|
74
102
|
UserPreferences.USER_PREFERENCES_BUTTON = selenium_webdriver_1.By.xpath('//button[text()="User Preferences"]');
|
|
75
103
|
UserPreferences.USER_PREFERENCES_PAGE = selenium_webdriver_1.By.xpath('//h1[text()="User Preferences"]');
|
|
76
104
|
UserPreferences.CONTAINER_REGISTRIES_TAB = selenium_webdriver_1.By.xpath('//button[text()="Container Registries"]');
|
|
77
105
|
UserPreferences.GIT_SERVICES_TAB = selenium_webdriver_1.By.xpath('//button[text()="Git Services"]');
|
|
106
|
+
UserPreferences.GIT_SERVICES_REVOKE_BUTTON = selenium_webdriver_1.By.xpath('//button[text()="Revoke"]');
|
|
78
107
|
UserPreferences.PAT_TAB = selenium_webdriver_1.By.xpath('//button[text()="Personal Access Tokens"]');
|
|
79
108
|
UserPreferences.ADD_NEW_PAT_BUTTON = selenium_webdriver_1.By.xpath('//button[text()="Add Personal Access Token"]');
|
|
80
109
|
UserPreferences.GIT_CONFIG_PAGE = selenium_webdriver_1.By.xpath('//button[text()="Gitconfig"]');
|
|
81
110
|
UserPreferences.SSH_KEY_TAB = selenium_webdriver_1.By.xpath('//button[text()="SSH Keys"]');
|
|
82
111
|
UserPreferences.ADD_NEW_SSH_KEY_BUTTON = selenium_webdriver_1.By.xpath('//button[text()="Add SSH Key"]');
|
|
112
|
+
UserPreferences.CONFIRMATION_WINDOW = selenium_webdriver_1.By.xpath('//span[text()="Revoke Git Services"]');
|
|
113
|
+
UserPreferences.DELETE_CONFIRMATION_CHECKBOX = selenium_webdriver_1.By.xpath('//input[@data-testid="warning-info-checkbox"]');
|
|
114
|
+
UserPreferences.DELETE_ITEM_BUTTON_ENABLED = selenium_webdriver_1.By.xpath('//button[@data-testid="revoke-button" and not(@disabled)]');
|
|
83
115
|
UserPreferences = UserPreferences_1 = __decorate([
|
|
84
116
|
(0, inversify_1.injectable)(),
|
|
85
117
|
__param(0, (0, inversify_1.inject)(inversify_types_1.CLASSES.DriverHelper)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserPreferences.js","sourceRoot":"","sources":["../../../pageobjects/dashboard/UserPreferences.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;wEAQwE;AACxE,yCAA+C;AAC/C,4BAA0B;AAC1B,mEAAwD;AACxD,2DAAwC;AACxC,2DAAwD;AACxD,+CAA4C;
|
|
1
|
+
{"version":3,"file":"UserPreferences.js","sourceRoot":"","sources":["../../../pageobjects/dashboard/UserPreferences.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;wEAQwE;AACxE,yCAA+C;AAC/C,4BAA0B;AAC1B,mEAAwD;AACxD,2DAAwC;AACxC,2DAAwD;AACxD,+CAA4C;AAC5C,mFAAyE;AAGlE,IAAM,eAAe,uBAArB,MAAM,eAAe;IAsB3B,YAEU,YAA0B;QAA1B,iBA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C,sCAAsC,CAAC,CAAC;AAC3E,4CAA4B,GAAO,uBAAE,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;AAC7F,0CAA0B,GAAO,uBAAE,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;AApBnH,eAAe;IAD3B,IAAA,sBAAU,GAAE;IAwBV,WAAA,IAAA,kBAAM,EAAC,yBAAO,CAAC,YAAY,CAAC,CAAA;qCACN,2BAAY;GAxBxB,eAAe,CAgH3B;AAhHY,0CAAe"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/** *******************************************************************
|
|
4
|
+
* copyright (c) 2020-2024 Red Hat, Inc.
|
|
5
|
+
*
|
|
6
|
+
* This program and the accompanying materials are made
|
|
7
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
8
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
9
|
+
*
|
|
10
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
11
|
+
**********************************************************************/
|
|
12
|
+
const inversify_config_1 = require("../../configs/inversify.config");
|
|
13
|
+
const inversify_types_1 = require("../../configs/inversify.types");
|
|
14
|
+
const FACTORY_TEST_CONSTANTS_1 = require("../../constants/FACTORY_TEST_CONSTANTS");
|
|
15
|
+
suite('"Revoke OAuth" test', function () {
|
|
16
|
+
const loginTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.LoginTests);
|
|
17
|
+
const userPreferences = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.UserPreferences);
|
|
18
|
+
const gitService = FACTORY_TEST_CONSTANTS_1.FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER || 'github';
|
|
19
|
+
suiteSetup('Login', async function () {
|
|
20
|
+
await loginTests.loginIntoChe();
|
|
21
|
+
});
|
|
22
|
+
test('Revoke OAuth test', async function () {
|
|
23
|
+
await userPreferences.openUserPreferencesPage();
|
|
24
|
+
await userPreferences.openGitServicesTab();
|
|
25
|
+
const selectedService = userPreferences.getServiceConfig(gitService);
|
|
26
|
+
await userPreferences.revokeGitService(selectedService);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=RevokeOauth.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RevokeOauth.spec.js","sourceRoot":"","sources":["../../../specs/miscellaneous/RevokeOauth.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;wEAQwE;AACxE,qEAA8D;AAC9D,mEAAwD;AAGxD,mFAAgF;AAEhF,KAAK,CAAC,qBAAqB,EAAE;IAC5B,MAAM,UAAU,GAAe,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,UAAU,CAAC,CAAC;IACpE,MAAM,eAAe,GAAoB,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,eAAe,CAAC,CAAC;IACnF,MAAM,UAAU,GAAW,+CAAsB,CAAC,gCAAgC,IAAI,QAAQ,CAAC;IAE/F,UAAU,CAAC,OAAO,EAAE,KAAK;QACxB,MAAM,UAAU,CAAC,YAAY,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,mBAAmB,EAAE,KAAK;QAC9B,MAAM,eAAe,CAAC,uBAAuB,EAAE,CAAC;QAChD,MAAM,eAAe,CAAC,kBAAkB,EAAE,CAAC;QAE3C,MAAM,eAAe,GAAW,eAAe,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC7E,MAAM,eAAe,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -18,7 +18,7 @@ suite(`"Check User Preferences page" test ${BASE_TEST_CONSTANTS_1.BASE_TEST_CONS
|
|
|
18
18
|
suiteSetup('Login', async function () {
|
|
19
19
|
await loginTests.loginIntoChe();
|
|
20
20
|
});
|
|
21
|
-
test(
|
|
21
|
+
test('Check user preferences page', async function () {
|
|
22
22
|
await userPreferences.openUserPreferencesPage();
|
|
23
23
|
await userPreferences.checkTabsAvailability();
|
|
24
24
|
});
|
|
@@ -17,6 +17,7 @@ const chai_1 = require("chai");
|
|
|
17
17
|
const API_TEST_CONSTANTS_1 = require("../../constants/API_TEST_CONSTANTS");
|
|
18
18
|
const WorkspaceHandlingTests_1 = require("../../tests-library/WorkspaceHandlingTests");
|
|
19
19
|
const MochaHooks_1 = require("../MochaHooks");
|
|
20
|
+
const TIMEOUT_CONSTANTS_1 = require("../../constants/TIMEOUT_CONSTANTS");
|
|
20
21
|
suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function () {
|
|
21
22
|
const projectAndFileTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.ProjectAndFileTests);
|
|
22
23
|
const loginTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.LoginTests);
|
|
@@ -26,6 +27,7 @@ suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS_1.BASE_TEST_CON
|
|
|
26
27
|
const testWorkspaceUtil = inversify_config_1.e2eContainer.get(inversify_types_1.TYPES.WorkspaceUtil);
|
|
27
28
|
const workspaceHandlingTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceHandlingTests);
|
|
28
29
|
const kubernetesCommandLineToolsExecutor = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.KubernetesCommandLineToolsExecutor);
|
|
30
|
+
const driverHelper = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.DriverHelper);
|
|
29
31
|
let podName = '';
|
|
30
32
|
suiteSetup(function () {
|
|
31
33
|
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
@@ -40,6 +42,9 @@ suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS_1.BASE_TEST_CON
|
|
|
40
42
|
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
41
43
|
(0, MochaHooks_1.registerRunningWorkspace)(WorkspaceHandlingTests_1.WorkspaceHandlingTests.getWorkspaceName());
|
|
42
44
|
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
45
|
+
// add 10 sec timeout for waiting for finishing animation of all IDE parts (Welcome parts. bottom widgets. etc.)
|
|
46
|
+
// using 10 sec easier than performing of finishing animation a all elements
|
|
47
|
+
await driverHelper.wait(TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_WAIT_FOR_URL);
|
|
43
48
|
await projectAndFileTests.performTrustAuthorDialog();
|
|
44
49
|
});
|
|
45
50
|
test('Check cloning of the test project', async function () {
|
|
@@ -55,19 +60,23 @@ suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS_1.BASE_TEST_CON
|
|
|
55
60
|
await input.setText('>Tasks: Run Task');
|
|
56
61
|
const runTaskItem = await input.findQuickPick('Tasks: Run Task');
|
|
57
62
|
await runTaskItem?.click();
|
|
63
|
+
// pause for avoiding StaleElement exception. It is easier solution than try/catch or writing separate function for this
|
|
64
|
+
await driverHelper.wait(TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING);
|
|
58
65
|
const devFileTask = await input.findQuickPick('devfile');
|
|
59
66
|
await devFileTask?.click();
|
|
67
|
+
// pause for avoiding StaleElement exception. It is easier solution than try/catch or writing separate function for this
|
|
68
|
+
await driverHelper.wait(TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING);
|
|
60
69
|
const firstExpectedQuickPick = await input.findQuickPick('1. This command from the devfile');
|
|
61
70
|
const secondExpectedQuickPick = await input.findQuickPick('2. This command from the parent');
|
|
62
71
|
(0, chai_1.expect)(firstExpectedQuickPick).not.undefined;
|
|
63
72
|
(0, chai_1.expect)(secondExpectedQuickPick).not.undefined;
|
|
64
73
|
});
|
|
65
74
|
test('Check expected containers in the parent POD', function () {
|
|
66
|
-
const getPodNameCommand = `${API_TEST_CONSTANTS_1.API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pods -n ${
|
|
75
|
+
const getPodNameCommand = `${API_TEST_CONSTANTS_1.API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pods -n ${kubernetesCommandLineToolsExecutor.namespace} --selector=controller.devfile.io/devworkspace_name=sample-using-parent --output jsonpath=\'{.items[0].metadata.name}\'`;
|
|
67
76
|
podName = shellExecutor.executeArbitraryShellScript(getPodNameCommand);
|
|
68
|
-
const containerNames = shellExecutor.executeArbitraryShellScript(`${API_TEST_CONSTANTS_1.API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pod ${podName} -n ${
|
|
77
|
+
const containerNames = shellExecutor.executeArbitraryShellScript(`${API_TEST_CONSTANTS_1.API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pod ${podName} -n ${kubernetesCommandLineToolsExecutor.namespace} --output jsonpath=\'{.spec.containers[*].name}\'`);
|
|
69
78
|
(0, chai_1.expect)(containerNames).contains('tools').and.contains('che-gateway');
|
|
70
|
-
const initContainerName = shellExecutor.executeArbitraryShellScript(`${API_TEST_CONSTANTS_1.API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pod ${podName} -n ${
|
|
79
|
+
const initContainerName = shellExecutor.executeArbitraryShellScript(`${API_TEST_CONSTANTS_1.API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pod ${podName} -n ${kubernetesCommandLineToolsExecutor.namespace} --output jsonpath=\'{.spec.initContainers[].name}\'`);
|
|
71
80
|
(0, chai_1.expect)(initContainerName).contains('che-code-injector');
|
|
72
81
|
});
|
|
73
82
|
test('Check expected environment variables', function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceWithParent.spec.js","sourceRo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HANGED
|
@@ -13,6 +13,7 @@ import { CLASSES } from '../../configs/inversify.types';
|
|
|
13
13
|
import { By } from 'selenium-webdriver';
|
|
14
14
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
15
15
|
import { Logger } from '../../utils/Logger';
|
|
16
|
+
import { GitProviderType } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
16
17
|
|
|
17
18
|
@injectable()
|
|
18
19
|
export class UserPreferences {
|
|
@@ -21,7 +22,9 @@ export class UserPreferences {
|
|
|
21
22
|
private static readonly USER_PREFERENCES_PAGE: By = By.xpath('//h1[text()="User Preferences"]');
|
|
22
23
|
|
|
23
24
|
private static readonly CONTAINER_REGISTRIES_TAB: By = By.xpath('//button[text()="Container Registries"]');
|
|
25
|
+
|
|
24
26
|
private static readonly GIT_SERVICES_TAB: By = By.xpath('//button[text()="Git Services"]');
|
|
27
|
+
private static readonly GIT_SERVICES_REVOKE_BUTTON: By = By.xpath('//button[text()="Revoke"]');
|
|
25
28
|
|
|
26
29
|
private static readonly PAT_TAB: By = By.xpath('//button[text()="Personal Access Tokens"]');
|
|
27
30
|
private static readonly ADD_NEW_PAT_BUTTON: By = By.xpath('//button[text()="Add Personal Access Token"]');
|
|
@@ -31,6 +34,10 @@ export class UserPreferences {
|
|
|
31
34
|
private static readonly SSH_KEY_TAB: By = By.xpath('//button[text()="SSH Keys"]');
|
|
32
35
|
private static readonly ADD_NEW_SSH_KEY_BUTTON: By = By.xpath('//button[text()="Add SSH Key"]');
|
|
33
36
|
|
|
37
|
+
private static readonly CONFIRMATION_WINDOW: By = By.xpath('//span[text()="Revoke Git Services"]');
|
|
38
|
+
private static readonly DELETE_CONFIRMATION_CHECKBOX: By = By.xpath('//input[@data-testid="warning-info-checkbox"]');
|
|
39
|
+
private static readonly DELETE_ITEM_BUTTON_ENABLED: By = By.xpath('//button[@data-testid="revoke-button" and not(@disabled)]');
|
|
40
|
+
|
|
34
41
|
constructor(
|
|
35
42
|
@inject(CLASSES.DriverHelper)
|
|
36
43
|
readonly driverHelper: DriverHelper
|
|
@@ -67,6 +74,24 @@ export class UserPreferences {
|
|
|
67
74
|
await this.driverHelper.waitAndClick(UserPreferences.GIT_SERVICES_TAB);
|
|
68
75
|
}
|
|
69
76
|
|
|
77
|
+
async revokeGitService(servicesName: string): Promise<void> {
|
|
78
|
+
Logger.debug();
|
|
79
|
+
|
|
80
|
+
await this.selectListItem(servicesName);
|
|
81
|
+
await this.driverHelper.waitAndClick(UserPreferences.GIT_SERVICES_REVOKE_BUTTON);
|
|
82
|
+
|
|
83
|
+
await this.driverHelper.waitVisibility(UserPreferences.CONFIRMATION_WINDOW);
|
|
84
|
+
await this.driverHelper.waitAndClick(UserPreferences.DELETE_CONFIRMATION_CHECKBOX);
|
|
85
|
+
await this.driverHelper.waitAndClick(UserPreferences.DELETE_ITEM_BUTTON_ENABLED);
|
|
86
|
+
await this.driverHelper.waitDisappearance(this.getServicesListItemLocator(servicesName));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async selectListItem(servicesName: string): Promise<void> {
|
|
90
|
+
Logger.debug(`of the '${servicesName}' list item`);
|
|
91
|
+
|
|
92
|
+
await this.driverHelper.waitAndClick(this.getServicesListItemLocator(servicesName));
|
|
93
|
+
}
|
|
94
|
+
|
|
70
95
|
async openPatTab(): Promise<void> {
|
|
71
96
|
Logger.debug();
|
|
72
97
|
|
|
@@ -86,4 +111,21 @@ export class UserPreferences {
|
|
|
86
111
|
await this.driverHelper.waitAndClick(UserPreferences.SSH_KEY_TAB);
|
|
87
112
|
await this.driverHelper.waitVisibility(UserPreferences.ADD_NEW_SSH_KEY_BUTTON);
|
|
88
113
|
}
|
|
114
|
+
|
|
115
|
+
getServiceConfig(service: string): string {
|
|
116
|
+
const gitService: { [key: string]: string } = {
|
|
117
|
+
[GitProviderType.GITHUB]: 'GitHub',
|
|
118
|
+
[GitProviderType.GITLAB]: 'GitLab',
|
|
119
|
+
[GitProviderType.AZURE_DEVOPS]: 'Microsoft Azure DevOps',
|
|
120
|
+
[GitProviderType.BITBUCKET_CLOUD_OAUTH2]: 'Bitbucket Cloud',
|
|
121
|
+
[GitProviderType.BITBUCKET_SERVER_OAUTH1]: 'Bitbucket Server',
|
|
122
|
+
[GitProviderType.BITBUCKET_SERVER_OAUTH2]: 'Bitbucket Server'
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return gitService[service];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private getServicesListItemLocator(servicesName: string): By {
|
|
129
|
+
return By.xpath(`//tr[td[text()='${servicesName}']]//input`);
|
|
130
|
+
}
|
|
89
131
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2020-2024 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 { e2eContainer } from '../../configs/inversify.config';
|
|
11
|
+
import { CLASSES } from '../../configs/inversify.types';
|
|
12
|
+
import { LoginTests } from '../../tests-library/LoginTests';
|
|
13
|
+
import { UserPreferences } from '../../pageobjects/dashboard/UserPreferences';
|
|
14
|
+
import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
15
|
+
|
|
16
|
+
suite('"Revoke OAuth" test', function (): void {
|
|
17
|
+
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
18
|
+
const userPreferences: UserPreferences = e2eContainer.get(CLASSES.UserPreferences);
|
|
19
|
+
const gitService: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER || 'github';
|
|
20
|
+
|
|
21
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
22
|
+
await loginTests.loginIntoChe();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('Revoke OAuth test', async function (): Promise<void> {
|
|
26
|
+
await userPreferences.openUserPreferencesPage();
|
|
27
|
+
await userPreferences.openGitServicesTab();
|
|
28
|
+
|
|
29
|
+
const selectedService: string = userPreferences.getServiceConfig(gitService);
|
|
30
|
+
await userPreferences.revokeGitService(selectedService);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -21,7 +21,7 @@ suite(`"Check User Preferences page" test ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT
|
|
|
21
21
|
await loginTests.loginIntoChe();
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
test(
|
|
24
|
+
test('Check user preferences page', async function (): Promise<void> {
|
|
25
25
|
await userPreferences.openUserPreferencesPage();
|
|
26
26
|
await userPreferences.checkTabsAvailability();
|
|
27
27
|
});
|
|
@@ -22,6 +22,8 @@ import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTes
|
|
|
22
22
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
23
23
|
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
24
24
|
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
25
|
+
import { DriverHelper } from '../../utils/DriverHelper';
|
|
26
|
+
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
|
|
25
27
|
|
|
26
28
|
suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
27
29
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
@@ -34,6 +36,8 @@ suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS.TEST_ENVIRONMEN
|
|
|
34
36
|
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get(
|
|
35
37
|
CLASSES.KubernetesCommandLineToolsExecutor
|
|
36
38
|
);
|
|
39
|
+
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
40
|
+
|
|
37
41
|
let podName: string = '';
|
|
38
42
|
|
|
39
43
|
suiteSetup(function (): void {
|
|
@@ -51,6 +55,9 @@ suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS.TEST_ENVIRONMEN
|
|
|
51
55
|
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
52
56
|
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
53
57
|
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
58
|
+
// add 10 sec timeout for waiting for finishing animation of all IDE parts (Welcome parts. bottom widgets. etc.)
|
|
59
|
+
// using 10 sec easier than performing of finishing animation a all elements
|
|
60
|
+
await driverHelper.wait(TIMEOUT_CONSTANTS.TS_SELENIUM_WAIT_FOR_URL);
|
|
54
61
|
await projectAndFileTests.performTrustAuthorDialog();
|
|
55
62
|
});
|
|
56
63
|
|
|
@@ -68,8 +75,12 @@ suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS.TEST_ENVIRONMEN
|
|
|
68
75
|
await input.setText('>Tasks: Run Task');
|
|
69
76
|
const runTaskItem: QuickPickItem | undefined = await input.findQuickPick('Tasks: Run Task');
|
|
70
77
|
await runTaskItem?.click();
|
|
78
|
+
// pause for avoiding StaleElement exception. It is easier solution than try/catch or writing separate function for this
|
|
79
|
+
await driverHelper.wait(TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING);
|
|
71
80
|
const devFileTask: QuickPickItem | undefined = await input.findQuickPick('devfile');
|
|
72
81
|
await devFileTask?.click();
|
|
82
|
+
// pause for avoiding StaleElement exception. It is easier solution than try/catch or writing separate function for this
|
|
83
|
+
await driverHelper.wait(TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING);
|
|
73
84
|
const firstExpectedQuickPick: QuickPickItem | undefined = await input.findQuickPick('1. This command from the devfile');
|
|
74
85
|
const secondExpectedQuickPick: QuickPickItem | undefined = await input.findQuickPick('2. This command from the parent');
|
|
75
86
|
expect(firstExpectedQuickPick).not.undefined;
|
|
@@ -77,16 +88,16 @@ suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS.TEST_ENVIRONMEN
|
|
|
77
88
|
});
|
|
78
89
|
|
|
79
90
|
test('Check expected containers in the parent POD', function (): void {
|
|
80
|
-
const getPodNameCommand: string = `${API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pods -n ${
|
|
91
|
+
const getPodNameCommand: string = `${API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pods -n ${kubernetesCommandLineToolsExecutor.namespace} --selector=controller.devfile.io/devworkspace_name=sample-using-parent --output jsonpath=\'{.items[0].metadata.name}\'`;
|
|
81
92
|
|
|
82
93
|
podName = shellExecutor.executeArbitraryShellScript(getPodNameCommand);
|
|
83
94
|
const containerNames: string = shellExecutor.executeArbitraryShellScript(
|
|
84
|
-
`${API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pod ${podName} -n ${
|
|
95
|
+
`${API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pod ${podName} -n ${kubernetesCommandLineToolsExecutor.namespace} --output jsonpath=\'{.spec.containers[*].name}\'`
|
|
85
96
|
);
|
|
86
97
|
expect(containerNames).contains('tools').and.contains('che-gateway');
|
|
87
98
|
|
|
88
99
|
const initContainerName: string = shellExecutor.executeArbitraryShellScript(
|
|
89
|
-
`${API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pod ${podName} -n ${
|
|
100
|
+
`${API_TEST_CONSTANTS.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL} get pod ${podName} -n ${kubernetesCommandLineToolsExecutor.namespace} --output jsonpath=\'{.spec.initContainers[].name}\'`
|
|
90
101
|
);
|
|
91
102
|
expect(initContainerName).contains('che-code-injector');
|
|
92
103
|
});
|