@eclipse-che/che-e2e 7.74.0-dev-1d09cb7 → 7.74.0-dev-aace77a
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/.eslintignore +10 -0
- package/.eslintrc.js +197 -0
- package/.prettierignore +10 -0
- package/.prettierrc.json +10 -0
- package/CODE_STYLE.md +144 -0
- package/README.md +47 -47
- package/configs/inversify.config.ts +39 -14
- package/configs/inversify.types.ts +44 -30
- package/configs/mocharc.ts +21 -24
- package/constants/API_TEST_CONSTANTS.ts +67 -0
- package/constants/BASE_TEST_CONSTANTS.ts +80 -0
- package/constants/CHROME_DRIVER_CONSTANTS.ts +42 -0
- package/constants/FACTORY_TEST_CONSTANTS.ts +61 -0
- package/constants/MONACO_CONSTANTS.ts +25 -0
- package/constants/OAUTH_CONSTANTS.ts +67 -0
- package/constants/PLUGIN_TEST_CONSTANTS.ts +15 -0
- package/constants/REPORTER_CONSTANTS.ts +53 -0
- package/constants/TIMEOUT_CONSTANTS.ts +131 -0
- package/dist/configs/inversify.config.js +36 -9
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +19 -5
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +13 -16
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/{APITestConstants.js → API_TEST_CONSTANTS.js} +12 -12
- package/dist/constants/API_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{BaseTestConstants.js → BASE_TEST_CONSTANTS.js} +16 -16
- package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/CHROME_DRIVER_CONSTANTS.js +36 -0
- package/dist/constants/CHROME_DRIVER_CONSTANTS.js.map +1 -0
- package/dist/constants/{FactoryTestConstants.js → FACTORY_TEST_CONSTANTS.js} +14 -13
- package/dist/constants/FACTORY_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{MonacoConstants.js → MONACO_CONSTANTS.js} +7 -7
- package/dist/constants/MONACO_CONSTANTS.js.map +1 -0
- package/dist/constants/{OAuthConstants.js → OAUTH_CONSTANTS.js} +14 -14
- package/dist/constants/OAUTH_CONSTANTS.js.map +1 -0
- package/dist/constants/{PluginsTestConstants.js → PLUGIN_TEST_CONSTANTS.js} +7 -7
- package/dist/constants/PLUGIN_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{ReporterConstants.js → REPORTER_CONSTANTS.js} +12 -12
- package/dist/constants/REPORTER_CONSTANTS.js.map +1 -0
- package/dist/constants/{TimeoutConstants.js → TIMEOUT_CONSTANTS.js} +24 -24
- package/dist/constants/TIMEOUT_CONSTANTS.js.map +1 -0
- package/dist/driver/ChromeDriver.js +12 -22
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/index.js +18 -12
- package/dist/index.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +15 -15
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +20 -21
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +55 -60
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +58 -48
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +22 -20
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +26 -12
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/pageobjects/login/interfaces/ICheLoginPage.js +2 -2
- package/dist/pageobjects/login/interfaces/IOcpLoginPage.js +2 -2
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js +14 -14
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +7 -7
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpLoginPage.js +24 -28
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +13 -16
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +9 -9
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js +19 -23
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +20 -19
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpApplicationPage.js +11 -11
- package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js +24 -24
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js +30 -30
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
- package/dist/specs/MochaHooks.js +33 -27
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +17 -17
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js +8 -6
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +27 -24
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +17 -17
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/api/PodOverridesAPI.spec.js +10 -8
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +10 -10
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +13 -13
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +52 -52
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +23 -19
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +38 -41
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +52 -50
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +49 -51
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +45 -42
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js +13 -13
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +9 -7
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +22 -19
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +21 -21
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js +91 -65
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +34 -15
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +34 -18
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +73 -68
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/IContextParams.js +12 -0
- package/dist/utils/IContextParams.js.map +1 -0
- package/dist/utils/IKubernetesCommandLineToolsExecutor.js +3 -0
- package/dist/utils/IKubernetesCommandLineToolsExecutor.js.map +1 -0
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +146 -107
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +18 -19
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js +26 -16
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/ShellExecutor.js +29 -9
- package/dist/utils/ShellExecutor.js.map +1 -1
- package/dist/utils/StringUtil.js +19 -9
- package/dist/utils/StringUtil.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +29 -29
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +12 -8
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/IAuthorizationHeaderHandler.js +2 -2
- package/dist/utils/workspace/ApiUrlResolver.js +5 -5
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
- package/dist/utils/workspace/ITestWorkspaceUtil.js +2 -2
- package/dist/utils/workspace/TestWorkspaceUtil.js +25 -23
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/dist/utils/workspace/WorkspaceStatus.js +2 -2
- package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
- package/driver/ChromeDriver.ts +45 -58
- package/driver/IDriver.ts +3 -3
- package/index.ts +11 -9
- package/package.json +59 -49
- package/pageobjects/dashboard/CreateWorkspace.ts +65 -55
- package/pageobjects/dashboard/Dashboard.ts +100 -100
- package/pageobjects/dashboard/Workspaces.ts +210 -186
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +153 -131
- package/pageobjects/git-providers/OauthPage.ts +177 -166
- package/pageobjects/ide/CheCodeLocatorLoader.ts +51 -46
- package/pageobjects/login/interfaces/ICheLoginPage.ts +3 -3
- package/pageobjects/login/interfaces/IOcpLoginPage.ts +3 -3
- package/pageobjects/login/kubernetes/DexLoginPage.ts +31 -30
- package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +15 -14
- package/pageobjects/login/openshift/OcpLoginPage.ts +51 -56
- package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +27 -27
- package/pageobjects/login/openshift/OcpUserLoginPage.ts +15 -18
- package/pageobjects/login/openshift/RedHatLoginPage.ts +49 -46
- package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +43 -34
- package/pageobjects/openshift/OcpApplicationPage.ts +21 -19
- package/pageobjects/openshift/OcpImportFromGitPage.ts +68 -68
- package/pageobjects/openshift/OcpMainPage.ts +69 -69
- package/specs/MochaHooks.ts +59 -52
- package/specs/SmokeTest.spec.ts +47 -45
- package/specs/api/ContainerOverridesAPI.spec.ts +39 -26
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +110 -97
- package/specs/api/EmptyWorkspaceAPI.spec.ts +67 -58
- package/specs/api/PodOverridesAPI.spec.ts +48 -34
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +36 -36
- package/specs/dashboard-samples/Quarkus.spec.ts +41 -40
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +202 -183
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +85 -75
- package/specs/factory/Factory.spec.ts +184 -178
- package/specs/factory/NoSetupRepoFactory.spec.ts +233 -219
- package/specs/factory/RefusedOAuthFactory.spec.ts +223 -211
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +70 -64
- package/tests-library/LoginTests.ts +34 -32
- package/tests-library/ProjectAndFileTests.ts +21 -18
- package/tests-library/WorkspaceHandlingTests.ts +98 -89
- package/tsconfig.json +15 -15
- package/utils/BrowserTabsUtil.ts +78 -74
- package/utils/CheReporter.ts +159 -157
- package/utils/DevWorkspaceConfigurationHelper.ts +63 -69
- package/utils/DevfilesRegistryHelper.ts +71 -57
- package/utils/DriverHelper.ts +728 -700
- package/utils/IContextParams.ts +26 -0
- package/utils/IKubernetesCommandLineToolsExecutor.ts +42 -0
- package/utils/KubernetesCommandLineToolsExecutor.ts +231 -183
- package/utils/Logger.ts +102 -125
- package/utils/ScreenCatcher.ts +57 -46
- package/utils/ShellExecutor.ts +23 -12
- package/utils/StringUtil.ts +49 -36
- package/utils/request-handlers/CheApiRequestHandler.ts +91 -88
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +32 -21
- package/utils/request-handlers/headers/IAuthorizationHeaderHandler.ts +3 -3
- package/utils/workspace/ApiUrlResolver.ts +31 -26
- package/utils/workspace/ITestWorkspaceUtil.ts +31 -31
- package/utils/workspace/TestWorkspaceUtil.ts +152 -145
- package/utils/workspace/WorkspaceStatus.ts +5 -5
- package/constants/APITestConstants.ts +0 -57
- package/constants/BaseTestConstants.ts +0 -68
- package/constants/ChromeDriverConstants.ts +0 -46
- package/constants/FactoryTestConstants.ts +0 -51
- package/constants/MonacoConstants.ts +0 -22
- package/constants/OAuthConstants.ts +0 -57
- package/constants/PluginsTestConstants.ts +0 -15
- package/constants/ReporterConstants.ts +0 -45
- package/constants/TimeoutConstants.ts +0 -113
- package/dist/constants/APITestConstants.js.map +0 -1
- package/dist/constants/BaseTestConstants.js.map +0 -1
- package/dist/constants/ChromeDriverConstants.js +0 -44
- package/dist/constants/ChromeDriverConstants.js.map +0 -1
- package/dist/constants/FactoryTestConstants.js.map +0 -1
- package/dist/constants/MonacoConstants.js.map +0 -1
- package/dist/constants/OAuthConstants.js.map +0 -1
- package/dist/constants/PluginsTestConstants.js.map +0 -1
- package/dist/constants/ReporterConstants.js.map +0 -1
- package/dist/constants/TimeoutConstants.js.map +0 -1
- package/tslint.json +0 -126
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2019-2023 Red Hat, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made
|
|
5
5
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -13,80 +13,75 @@ import { DriverHelper } from '../../../utils/DriverHelper';
|
|
|
13
13
|
import { CLASSES } from '../../../configs/inversify.types';
|
|
14
14
|
import { By } from 'selenium-webdriver';
|
|
15
15
|
import { Logger } from '../../../utils/Logger';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { TIMEOUT_CONSTANTS } from '../../../constants/TIMEOUT_CONSTANTS';
|
|
17
|
+
import { OAUTH_CONSTANTS } from '../../../constants/OAUTH_CONSTANTS';
|
|
18
18
|
|
|
19
19
|
@injectable()
|
|
20
20
|
export class OcpLoginPage {
|
|
21
|
+
private static readonly LOGIN_PAGE_WELCOME_MESSAGE: By = By.xpath('//*[contains(text(), "Welcome")]');
|
|
22
|
+
private static readonly LOGIN_BUTTON: By = By.css('button[type=submit]');
|
|
23
|
+
private static readonly LOGIN_PROVIDER_BUTTON: By = By.xpath(`//a[text()="${OAUTH_CONSTANTS.TS_OCP_LOGIN_PAGE_PROVIDER_TITLE}"]`);
|
|
24
|
+
private static readonly AUTHORIZE_OPENSHIFT_ACCESS_HEADER: By = By.xpath('//h1[text()="Authorize Access"]');
|
|
25
|
+
private static readonly APPROVE_ACCESS_BUTTON: By = By.css('input[name="approve"]');
|
|
26
|
+
private static readonly USERNAME_INPUT: By = By.id('inputUsername');
|
|
27
|
+
private static readonly PASSWORD_INPUT: By = By.id('inputPassword');
|
|
21
28
|
|
|
22
|
-
|
|
29
|
+
constructor(
|
|
30
|
+
@inject(CLASSES.DriverHelper)
|
|
31
|
+
private readonly driverHelper: DriverHelper
|
|
32
|
+
) {}
|
|
23
33
|
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
async waitOpenShiftLoginWelcomePage(): Promise<void> {
|
|
35
|
+
Logger.debug();
|
|
26
36
|
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
await this.driverHelper.waitVisibility(OcpLoginPage.LOGIN_PAGE_WELCOME_MESSAGE, TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
38
|
+
}
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
|
|
40
|
+
async waitAndClickOnLoginProviderTitle(): Promise<void> {
|
|
41
|
+
Logger.debug();
|
|
32
42
|
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
await this.driverHelper.waitAndClick(OcpLoginPage.LOGIN_PROVIDER_BUTTON, TIMEOUT_CONSTANTS.TS_SELENIUM_WAIT_FOR_URL);
|
|
44
|
+
}
|
|
35
45
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
46
|
+
async isIdentityProviderLinkVisible(): Promise<boolean> {
|
|
47
|
+
Logger.debug();
|
|
39
48
|
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
return await this.driverHelper.waitVisibilityBoolean(OcpLoginPage.LOGIN_PROVIDER_BUTTON, 3, 5000);
|
|
50
|
+
}
|
|
42
51
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
52
|
+
async isAuthorizeOpenShiftIdentityProviderPageVisible(): Promise<boolean> {
|
|
53
|
+
Logger.debug();
|
|
46
54
|
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
return await this.driverHelper.isVisible(OcpLoginPage.AUTHORIZE_OPENSHIFT_ACCESS_HEADER);
|
|
56
|
+
}
|
|
49
57
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
58
|
+
async clickOnApproveAuthorizeAccessButton(): Promise<void> {
|
|
59
|
+
Logger.debug();
|
|
53
60
|
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
await this.driverHelper.waitAndClick(OcpLoginPage.APPROVE_ACCESS_BUTTON);
|
|
62
|
+
}
|
|
56
63
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
64
|
+
async enterUserNameOpenShift(userName: string): Promise<void> {
|
|
65
|
+
Logger.debug(`"${userName}"`);
|
|
60
66
|
|
|
61
|
-
|
|
62
|
-
|
|
67
|
+
await this.driverHelper.enterValue(OcpLoginPage.USERNAME_INPUT, userName);
|
|
68
|
+
}
|
|
63
69
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
70
|
+
async enterPasswordOpenShift(userPassword: string): Promise<void> {
|
|
71
|
+
Logger.debug();
|
|
67
72
|
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
await this.driverHelper.enterValue(OcpLoginPage.PASSWORD_INPUT, userPassword);
|
|
74
|
+
}
|
|
70
75
|
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
async clickOnLoginButton(): Promise<void> {
|
|
77
|
+
Logger.debug();
|
|
73
78
|
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
await this.driverHelper.waitAndClick(OcpLoginPage.LOGIN_BUTTON);
|
|
80
|
+
}
|
|
76
81
|
|
|
77
|
-
|
|
78
|
-
|
|
82
|
+
async waitDisappearanceOpenShiftLoginWelcomePage(): Promise<void> {
|
|
83
|
+
Logger.debug();
|
|
79
84
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const loginButtonLocator: By = By.css('button[type=submit]');
|
|
84
|
-
await this.driverHelper.waitAndClick(loginButtonLocator);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async waitDisappearanceOpenShiftLoginWelcomePage(): Promise<void> {
|
|
88
|
-
Logger.debug();
|
|
89
|
-
|
|
90
|
-
await this.driverHelper.waitDisappearance(By.xpath(OcpLoginPage.LOGIN_PAGE_OPENSHIFT_XPATH));
|
|
91
|
-
}
|
|
85
|
+
await this.driverHelper.waitDisappearance(OcpLoginPage.LOGIN_PAGE_WELCOME_MESSAGE);
|
|
86
|
+
}
|
|
92
87
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2019 Red Hat, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made
|
|
5
5
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -12,7 +12,7 @@ import { inject, injectable } from 'inversify';
|
|
|
12
12
|
import { RedHatLoginPage } from './RedHatLoginPage';
|
|
13
13
|
import { CLASSES } from '../../../configs/inversify.types';
|
|
14
14
|
import { By } from 'selenium-webdriver';
|
|
15
|
-
import {
|
|
15
|
+
import { TIMEOUT_CONSTANTS } from '../../../constants/TIMEOUT_CONSTANTS';
|
|
16
16
|
import { ICheLoginPage } from '../interfaces/ICheLoginPage';
|
|
17
17
|
import { OcpLoginPage } from './OcpLoginPage';
|
|
18
18
|
import { DriverHelper } from '../../../utils/DriverHelper';
|
|
@@ -20,30 +20,30 @@ import { Logger } from '../../../utils/Logger';
|
|
|
20
20
|
|
|
21
21
|
@injectable()
|
|
22
22
|
export class OcpRedHatLoginPage implements ICheLoginPage {
|
|
23
|
+
private static readonly OPENSHIFT_LOGIN_LANDING_PAGE_BUTTON: By = By.xpath(
|
|
24
|
+
'//div[@class="panel-login"]/div[contains(@class, "panel-content")]/form/button'
|
|
25
|
+
);
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
constructor(
|
|
28
|
+
@inject(CLASSES.OcpLoginPage) private readonly ocpLogin: OcpLoginPage,
|
|
29
|
+
@inject(CLASSES.RedHatLoginPage)
|
|
30
|
+
private readonly redHatLogin: RedHatLoginPage,
|
|
31
|
+
@inject(CLASSES.DriverHelper)
|
|
32
|
+
private readonly driverHelper: DriverHelper
|
|
33
|
+
) {}
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
await this.redHatLogin.waitRedHatLoginWelcomePage();
|
|
43
|
-
await this.redHatLogin.enterUserNameRedHat();
|
|
44
|
-
await this.redHatLogin.clickNextButton();
|
|
45
|
-
await this.redHatLogin.enterPasswordRedHat();
|
|
46
|
-
await this.redHatLogin.clickOnLoginButton();
|
|
47
|
-
await this.redHatLogin.waitDisappearanceRedHatLoginWelcomePage();
|
|
48
|
-
}
|
|
35
|
+
async login(): Promise<void> {
|
|
36
|
+
Logger.debug();
|
|
37
|
+
await this.driverHelper.waitAndClick(
|
|
38
|
+
OcpRedHatLoginPage.OPENSHIFT_LOGIN_LANDING_PAGE_BUTTON,
|
|
39
|
+
TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT
|
|
40
|
+
);
|
|
41
|
+
await this.ocpLogin.waitAndClickOnLoginProviderTitle();
|
|
42
|
+
await this.redHatLogin.waitRedHatLoginWelcomePage();
|
|
43
|
+
await this.redHatLogin.enterUserNameRedHat();
|
|
44
|
+
await this.redHatLogin.clickNextButton();
|
|
45
|
+
await this.redHatLogin.enterPasswordRedHat();
|
|
46
|
+
await this.redHatLogin.clickOnLoginButton();
|
|
47
|
+
await this.redHatLogin.waitDisappearanceRedHatLoginWelcomePage();
|
|
48
|
+
}
|
|
49
49
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2019-2023 Red Hat, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made
|
|
5
5
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -13,26 +13,23 @@ import { inject, injectable } from 'inversify';
|
|
|
13
13
|
import { OcpLoginPage } from './OcpLoginPage';
|
|
14
14
|
import { CLASSES } from '../../../configs/inversify.types';
|
|
15
15
|
import { Logger } from '../../../utils/Logger';
|
|
16
|
-
import {
|
|
16
|
+
import { OAUTH_CONSTANTS } from '../../../constants/OAUTH_CONSTANTS';
|
|
17
17
|
|
|
18
18
|
@injectable()
|
|
19
19
|
export class OcpUserLoginPage implements IOcpLoginPage {
|
|
20
|
+
constructor(@inject(CLASSES.OcpLoginPage) private readonly ocpLogin: OcpLoginPage) {}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
async login(): Promise<void> {
|
|
23
|
+
Logger.debug();
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (OAuthConstants.TS_OCP_LOGIN_PAGE_PROVIDER_TITLE !== '') {
|
|
28
|
-
await this.ocpLogin.clickOnLoginProviderTitle();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
await this.ocpLogin.waitOpenShiftLoginWelcomePage();
|
|
32
|
-
await this.ocpLogin.enterUserNameOpenShift(OAuthConstants.TS_SELENIUM_OCP_USERNAME);
|
|
33
|
-
await this.ocpLogin.enterPasswordOpenShift(OAuthConstants.TS_SELENIUM_OCP_PASSWORD);
|
|
34
|
-
await this.ocpLogin.clickOnLoginButton();
|
|
35
|
-
await this.ocpLogin.waitDisappearanceOpenShiftLoginWelcomePage();
|
|
36
|
-
}
|
|
25
|
+
if (OAUTH_CONSTANTS.TS_OCP_LOGIN_PAGE_PROVIDER_TITLE !== '') {
|
|
26
|
+
await this.ocpLogin.waitAndClickOnLoginProviderTitle();
|
|
27
|
+
}
|
|
37
28
|
|
|
29
|
+
await this.ocpLogin.waitOpenShiftLoginWelcomePage();
|
|
30
|
+
await this.ocpLogin.enterUserNameOpenShift(OAUTH_CONSTANTS.TS_SELENIUM_OCP_USERNAME);
|
|
31
|
+
await this.ocpLogin.enterPasswordOpenShift(OAUTH_CONSTANTS.TS_SELENIUM_OCP_PASSWORD);
|
|
32
|
+
await this.ocpLogin.clickOnLoginButton();
|
|
33
|
+
await this.ocpLogin.waitDisappearanceOpenShiftLoginWelcomePage();
|
|
34
|
+
}
|
|
38
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2019 Red Hat, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made
|
|
5
5
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -13,51 +13,54 @@ import { By } from 'selenium-webdriver';
|
|
|
13
13
|
import { CLASSES } from '../../../configs/inversify.types';
|
|
14
14
|
import { DriverHelper } from '../../../utils/DriverHelper';
|
|
15
15
|
import { Logger } from '../../../utils/Logger';
|
|
16
|
-
import {
|
|
16
|
+
import { OAUTH_CONSTANTS } from '../../../constants/OAUTH_CONSTANTS';
|
|
17
|
+
import { TIMEOUT_CONSTANTS } from '../../../constants/TIMEOUT_CONSTANTS';
|
|
17
18
|
|
|
18
19
|
@injectable()
|
|
19
20
|
export class RedHatLoginPage {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
21
|
+
private static readonly USERNAME_INPUT: By = By.id('username-verification');
|
|
22
|
+
private static readonly PASSWORD_INPUT: By = By.id('password');
|
|
23
|
+
private static readonly NEXT_BUTTON: By = By.id('login-show-step2');
|
|
24
|
+
private static readonly LOGIN_BUTTON: By = By.id('rh-password-verification-submit-button');
|
|
25
|
+
|
|
26
|
+
constructor(
|
|
27
|
+
@inject(CLASSES.DriverHelper)
|
|
28
|
+
private readonly driverHelper: DriverHelper
|
|
29
|
+
) {}
|
|
30
|
+
|
|
31
|
+
async waitRedHatLoginWelcomePage(): Promise<void> {
|
|
32
|
+
Logger.debug();
|
|
33
|
+
|
|
34
|
+
await this.driverHelper.waitVisibility(RedHatLoginPage.USERNAME_INPUT, TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async enterPasswordRedHat(): Promise<void> {
|
|
38
|
+
Logger.debug();
|
|
39
|
+
|
|
40
|
+
await this.driverHelper.enterValue(RedHatLoginPage.PASSWORD_INPUT, OAUTH_CONSTANTS.TS_SELENIUM_OCP_PASSWORD);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async clickOnLoginButton(): Promise<void> {
|
|
44
|
+
Logger.debug();
|
|
45
|
+
|
|
46
|
+
await this.driverHelper.waitAndClick(RedHatLoginPage.LOGIN_BUTTON);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async waitDisappearanceRedHatLoginWelcomePage(): Promise<void> {
|
|
50
|
+
Logger.debug();
|
|
51
|
+
|
|
52
|
+
await this.driverHelper.waitDisappearance(RedHatLoginPage.LOGIN_BUTTON);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async enterUserNameRedHat(): Promise<void> {
|
|
56
|
+
Logger.debug();
|
|
57
|
+
|
|
58
|
+
await this.driverHelper.enterValue(RedHatLoginPage.USERNAME_INPUT, OAUTH_CONSTANTS.TS_SELENIUM_OCP_USERNAME);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async clickNextButton(): Promise<void> {
|
|
62
|
+
Logger.debug();
|
|
63
|
+
|
|
64
|
+
await this.driverHelper.waitAndClick(RedHatLoginPage.NEXT_BUTTON);
|
|
65
|
+
}
|
|
63
66
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2019-2023 Red Hat, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made
|
|
5
5
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -13,41 +13,50 @@ import { OcpLoginPage } from './OcpLoginPage';
|
|
|
13
13
|
import { inject, injectable } from 'inversify';
|
|
14
14
|
import { CLASSES } from '../../../configs/inversify.types';
|
|
15
15
|
import { Logger } from '../../../utils/Logger';
|
|
16
|
-
import {
|
|
16
|
+
import { TIMEOUT_CONSTANTS } from '../../../constants/TIMEOUT_CONSTANTS';
|
|
17
17
|
import { By } from 'selenium-webdriver';
|
|
18
18
|
import { DriverHelper } from '../../../utils/DriverHelper';
|
|
19
|
-
import {
|
|
19
|
+
import { OAUTH_CONSTANTS } from '../../../constants/OAUTH_CONSTANTS';
|
|
20
20
|
|
|
21
21
|
@injectable()
|
|
22
22
|
export class RegularUserOcpCheLoginPage implements ICheLoginPage {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
23
|
+
private static readonly OPENSHIFT_LOGIN_LANDING_PAGE_BUTTON: By = By.xpath(
|
|
24
|
+
'//div[@class="panel-login"]/div[contains(@class, "panel-content")]/form/button'
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
constructor(
|
|
28
|
+
@inject(CLASSES.OcpLoginPage) private readonly ocpLogin: OcpLoginPage,
|
|
29
|
+
@inject(CLASSES.DriverHelper)
|
|
30
|
+
private readonly driverHelper: DriverHelper
|
|
31
|
+
) {}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param userName
|
|
35
|
+
* @param password
|
|
36
|
+
*/
|
|
37
|
+
async login(
|
|
38
|
+
userName: string = OAUTH_CONSTANTS.TS_SELENIUM_OCP_USERNAME,
|
|
39
|
+
password: string = OAUTH_CONSTANTS.TS_SELENIUM_OCP_PASSWORD
|
|
40
|
+
): Promise<void> {
|
|
41
|
+
Logger.debug();
|
|
42
|
+
|
|
43
|
+
await this.driverHelper.waitAndClick(
|
|
44
|
+
RegularUserOcpCheLoginPage.OPENSHIFT_LOGIN_LANDING_PAGE_BUTTON,
|
|
45
|
+
TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
if (await this.ocpLogin.isIdentityProviderLinkVisible()) {
|
|
49
|
+
await this.ocpLogin.waitAndClickOnLoginProviderTitle();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
await this.ocpLogin.waitOpenShiftLoginWelcomePage();
|
|
53
|
+
await this.ocpLogin.enterUserNameOpenShift(userName);
|
|
54
|
+
await this.ocpLogin.enterPasswordOpenShift(password);
|
|
55
|
+
await this.ocpLogin.clickOnLoginButton();
|
|
56
|
+
await this.ocpLogin.waitDisappearanceOpenShiftLoginWelcomePage();
|
|
57
|
+
|
|
58
|
+
if (await this.ocpLogin.isAuthorizeOpenShiftIdentityProviderPageVisible()) {
|
|
59
|
+
await this.ocpLogin.clickOnApproveAuthorizeAccessButton();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
53
62
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2019-2023 Red Hat, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made
|
|
5
5
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -13,30 +13,32 @@ import { DriverHelper } from '../../utils/DriverHelper';
|
|
|
13
13
|
import { CLASSES } from '../../configs/inversify.types';
|
|
14
14
|
import { By } from 'selenium-webdriver';
|
|
15
15
|
import { Logger } from '../../utils/Logger';
|
|
16
|
-
import {
|
|
16
|
+
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
|
|
17
17
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
18
18
|
|
|
19
19
|
@injectable()
|
|
20
20
|
export class OcpApplicationPage {
|
|
21
|
+
private static readonly APPLICATION_ICON: By = By.xpath('//*[@data-test-id="base-node-handler"]');
|
|
22
|
+
private static readonly EDIT_SOURCE_CODE_ICON: By = By.xpath('//*[@aria-label="Edit source code"]');
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
constructor(
|
|
25
|
+
@inject(CLASSES.DriverHelper)
|
|
26
|
+
private readonly driverHelper: DriverHelper,
|
|
27
|
+
@inject(CLASSES.BrowserTabsUtil)
|
|
28
|
+
private readonly browserTabsUtil: BrowserTabsUtil
|
|
29
|
+
) {}
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil) {
|
|
28
|
-
}
|
|
31
|
+
async waitApplicationIcon(): Promise<void> {
|
|
32
|
+
Logger.debug();
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
await this.driverHelper.waitPresence(OcpApplicationPage.APPLICATION_ICON, TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
35
|
+
}
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
async waitAndOpenEditSourceCodeIcon(): Promise<void> {
|
|
38
|
+
Logger.debug();
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
await this.browserTabsUtil.waitAndSwitchToAnotherWindow(parentGUID, TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
41
|
-
}
|
|
40
|
+
const parentGUID: string = await this.browserTabsUtil.getCurrentWindowHandle();
|
|
41
|
+
await this.driverHelper.waitAndClick(OcpApplicationPage.EDIT_SOURCE_CODE_ICON);
|
|
42
|
+
await this.browserTabsUtil.waitAndSwitchToAnotherWindow(parentGUID, TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
43
|
+
}
|
|
42
44
|
}
|