@eclipse-che/che-e2e 7.73.0 → 7.74.0-dev-1d09cb7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configs/inversify.config.ts +6 -6
- package/configs/inversify.types.ts +27 -27
- package/configs/mocharc.ts +21 -21
- package/constants/APITestConstants.ts +39 -38
- package/constants/BaseTestConstants.ts +46 -43
- package/constants/ChromeDriverConstants.ts +29 -29
- package/constants/FactoryTestConstants.ts +30 -30
- package/constants/MonacoConstants.ts +10 -10
- package/constants/OAuthConstants.ts +46 -46
- package/constants/ReporterConstants.ts +28 -28
- package/constants/TimeoutConstants.ts +101 -101
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +1 -1
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/APITestConstants.js +2 -2
- package/dist/constants/APITestConstants.js.map +1 -1
- package/dist/constants/BaseTestConstants.js +2 -1
- package/dist/constants/BaseTestConstants.js.map +1 -1
- package/dist/constants/ChromeDriverConstants.js +1 -1
- package/dist/constants/ChromeDriverConstants.js.map +1 -1
- package/dist/constants/FactoryTestConstants.js +1 -1
- package/dist/constants/FactoryTestConstants.js.map +1 -1
- package/dist/constants/MonacoConstants.js +1 -1
- package/dist/constants/MonacoConstants.js.map +1 -1
- package/dist/constants/OAuthConstants.js +1 -1
- package/dist/constants/OAuthConstants.js.map +1 -1
- package/dist/constants/ReporterConstants.js +1 -1
- package/dist/constants/ReporterConstants.js.map +1 -1
- package/dist/constants/TimeoutConstants.js.map +1 -1
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +8 -8
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +11 -11
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +14 -14
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +8 -8
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +17 -17
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js +5 -5
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpLoginPage.js +10 -10
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +2 -2
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js +6 -6
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +2 -2
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpApplicationPage.js +2 -2
- package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js +5 -5
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js +11 -11
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
- package/dist/specs/MochaHooks.js +1 -1
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +7 -3
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +7 -5
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/api/PodOverridesAPI.spec.js +2 -1
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +9 -5
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +7 -3
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +6 -2
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +3 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +3 -1
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +4 -2
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +4 -2
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +6 -2
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +3 -3
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +54 -74
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +10 -10
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +2 -2
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +7 -7
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +81 -81
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +38 -35
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +45 -21
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/ShellExecutor.js.map +1 -1
- package/dist/utils/StringUtil.js +2 -2
- package/dist/utils/StringUtil.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +13 -11
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/workspace/ApiUrlResolver.js +3 -3
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
- package/dist/utils/workspace/TestWorkspaceUtil.js +20 -16
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
- package/driver/ChromeDriver.ts +44 -44
- package/driver/IDriver.ts +1 -1
- package/package.json +1 -1
- package/pageobjects/dashboard/CreateWorkspace.ts +52 -52
- package/pageobjects/dashboard/Dashboard.ts +72 -72
- package/pageobjects/dashboard/Workspaces.ts +138 -139
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +92 -93
- package/pageobjects/git-providers/OauthPage.ts +136 -136
- package/pageobjects/ide/CheCodeLocatorLoader.ts +40 -40
- package/pageobjects/login/interfaces/ICheLoginPage.ts +1 -1
- package/pageobjects/login/interfaces/IOcpLoginPage.ts +1 -1
- package/pageobjects/login/kubernetes/DexLoginPage.ts +27 -27
- package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +11 -11
- package/pageobjects/login/openshift/OcpLoginPage.ts +50 -50
- package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +21 -21
- package/pageobjects/login/openshift/OcpUserLoginPage.ts +14 -14
- package/pageobjects/login/openshift/RedHatLoginPage.ts +44 -41
- package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +23 -23
- package/pageobjects/openshift/OcpApplicationPage.ts +16 -16
- package/pageobjects/openshift/OcpImportFromGitPage.ts +54 -54
- package/pageobjects/openshift/OcpMainPage.ts +64 -64
- package/resources/pod-overrides-airgap.yaml +37 -0
- package/specs/MochaHooks.ts +44 -44
- package/specs/SmokeTest.spec.ts +35 -31
- package/specs/api/ContainerOverridesAPI.spec.ts +23 -23
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +93 -91
- package/specs/api/EmptyWorkspaceAPI.spec.ts +50 -50
- package/specs/api/PodOverridesAPI.spec.ts +30 -29
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +29 -25
- package/specs/dashboard-samples/Quarkus.spec.ts +31 -27
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +156 -152
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +62 -64
- package/specs/factory/Factory.spec.ts +149 -147
- package/specs/factory/NoSetupRepoFactory.spec.ts +188 -186
- package/specs/factory/RefusedOAuthFactory.spec.ts +182 -180
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +52 -48
- package/tests-library/LoginTests.ts +29 -29
- package/tests-library/ProjectAndFileTests.ts +13 -13
- package/tests-library/WorkspaceHandlingTests.ts +84 -103
- package/utils/BrowserTabsUtil.ts +69 -69
- package/utils/CheReporter.ts +4 -6
- package/utils/DevWorkspaceConfigurationHelper.ts +58 -58
- package/utils/DevfilesRegistryHelper.ts +51 -51
- package/utils/DriverHelper.ts +599 -600
- package/utils/KubernetesCommandLineToolsExecutor.ts +166 -158
- package/utils/Logger.ts +119 -67
- package/utils/ScreenCatcher.ts +42 -42
- package/utils/ShellExecutor.ts +10 -10
- package/utils/StringUtil.ts +29 -29
- package/utils/request-handlers/CheApiRequestHandler.ts +84 -82
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +18 -18
- package/utils/request-handlers/headers/IAuthorizationHeaderHandler.ts +1 -1
- package/utils/workspace/ApiUrlResolver.ts +23 -23
- package/utils/workspace/ITestWorkspaceUtil.ts +29 -29
- package/utils/workspace/TestWorkspaceUtil.ts +120 -116
- package/utils/workspace/WorkspaceStatus.ts +3 -3
|
@@ -18,165 +18,165 @@ import { OAuthConstants } from '../../constants/OAuthConstants';
|
|
|
18
18
|
|
|
19
19
|
@injectable()
|
|
20
20
|
export class OauthPage {
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
21
|
+
private static LOGIN_FORM: By;
|
|
22
|
+
private static PASSWORD_FORM: By;
|
|
23
|
+
private static SUBMIT_BUTTON: By;
|
|
24
|
+
private static APPROVE_BUTTON: By;
|
|
25
|
+
private static DENY_ACCESS_BUTTON: By;
|
|
26
|
+
private static DENY_SAVE_CREDENTIALS_BUTTON: By;
|
|
27
|
+
|
|
28
|
+
constructor(@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) {
|
|
29
|
+
switch (FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER) {
|
|
30
|
+
case GitProviderType.BITBUCKET : {
|
|
31
|
+
OauthPage.LOGIN_FORM = By.id('j_username');
|
|
32
|
+
OauthPage.PASSWORD_FORM = By.id('j_password');
|
|
33
|
+
OauthPage.APPROVE_BUTTON = By.id('approve');
|
|
34
|
+
OauthPage.SUBMIT_BUTTON = By.id('submit');
|
|
35
|
+
OauthPage.DENY_ACCESS_BUTTON = By.id('deny');
|
|
36
|
+
}
|
|
37
|
+
break;
|
|
38
|
+
case GitProviderType.GITLAB: {
|
|
39
|
+
OauthPage.LOGIN_FORM = By.id('user_login');
|
|
40
|
+
OauthPage.PASSWORD_FORM = By.id('user_password');
|
|
41
|
+
OauthPage.SUBMIT_BUTTON = By.xpath('//button[@data-qa-selector="sign_in_button"]');
|
|
42
|
+
OauthPage.APPROVE_BUTTON = By.xpath('//*[@value="Authorize"]');
|
|
43
|
+
OauthPage.DENY_ACCESS_BUTTON = By.xpath('//input[@value="Deny"]');
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
case GitProviderType.GITHUB: {
|
|
47
|
+
OauthPage.LOGIN_FORM = By.id('login_field');
|
|
48
|
+
OauthPage.PASSWORD_FORM = By.id('password');
|
|
49
|
+
OauthPage.APPROVE_BUTTON = By.xpath('//*[@id="js-oauth-authorize-btn"]');
|
|
50
|
+
OauthPage.SUBMIT_BUTTON = By.xpath('//*[@value="Sign in"]');
|
|
51
|
+
OauthPage.DENY_ACCESS_BUTTON = By.xpath('//button[contains(., "Cancel")]');
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
case GitProviderType.AZURE_DEVOPS: {
|
|
55
|
+
OauthPage.LOGIN_FORM = By.xpath('//input[@type="email"]');
|
|
56
|
+
OauthPage.PASSWORD_FORM = By.xpath('//input[@type="password"]');
|
|
57
|
+
OauthPage.APPROVE_BUTTON = By.id('accept-button');
|
|
58
|
+
OauthPage.SUBMIT_BUTTON = By.xpath('//input[@type="submit"]');
|
|
59
|
+
OauthPage.DENY_SAVE_CREDENTIALS_BUTTON = By.xpath('//input[@type="button"]');
|
|
60
|
+
OauthPage.DENY_ACCESS_BUTTON = By.id('deny-button');
|
|
61
|
+
}
|
|
62
|
+
break;
|
|
63
|
+
default: {
|
|
64
|
+
throw new Error(`Invalid git provider. The value should be ${GitProviderType.GITHUB}, ${GitProviderType.GITLAB}, ${GitProviderType.AZURE_DEVOPS} or ${GitProviderType.BITBUCKET}`);
|
|
65
|
+
}
|
|
67
66
|
}
|
|
67
|
+
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
async waitLoginPage(): Promise<void> {
|
|
70
|
+
Logger.debug();
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
await this.driverHelper.waitVisibility(OauthPage.LOGIN_FORM, TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM * 3);
|
|
73
|
+
}
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
async enterUserName(userName: string): Promise<void> {
|
|
76
|
+
Logger.debug(`"${userName}"`);
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
await this.driverHelper.enterValue(OauthPage.LOGIN_FORM, userName);
|
|
79
|
+
}
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
async enterPassword(password: string): Promise<void> {
|
|
82
|
+
Logger.debug();
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
await this.driverHelper.enterValue(OauthPage.PASSWORD_FORM, password);
|
|
85
|
+
}
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
async clickOnSubmitButton(): Promise<void> {
|
|
88
|
+
Logger.debug();
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
await this.driverHelper.waitAndClick(OauthPage.SUBMIT_BUTTON);
|
|
91
|
+
}
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
async clickOnNotRememberCredentialsButton(): Promise<void> {
|
|
94
|
+
Logger.debug();
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
await this.driverHelper.waitAndClick(OauthPage.DENY_SAVE_CREDENTIALS_BUTTON);
|
|
97
|
+
}
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
async waitClosingLoginPage(): Promise<void> {
|
|
100
|
+
Logger.debug();
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
await this.driverHelper.waitDisappearance(OauthPage.PASSWORD_FORM);
|
|
103
|
+
}
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
async waitOauthPage(): Promise<void> {
|
|
106
|
+
Logger.debug();
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
await this.driverHelper.waitVisibility(OauthPage.APPROVE_BUTTON);
|
|
109
|
+
}
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
async clickOnApproveButton(): Promise<void> {
|
|
112
|
+
Logger.debug();
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
await this.driverHelper.waitAndClick(OauthPage.APPROVE_BUTTON);
|
|
115
|
+
}
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
async clickOnDenyAccessButton(): Promise<void> {
|
|
118
|
+
Logger.debug();
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
await this.driverHelper.waitAndClick(OauthPage.DENY_ACCESS_BUTTON);
|
|
121
|
+
}
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
async waitDisappearanceOauthPage(): Promise<void> {
|
|
124
|
+
Logger.debug();
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
await this.driverHelper.waitDisappearance(OauthPage.APPROVE_BUTTON);
|
|
127
|
+
}
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
await this.waitLoginPage();
|
|
133
|
-
await this.enterUserName(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_USERNAME);
|
|
134
|
-
if (FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER === GitProviderType.AZURE_DEVOPS) {
|
|
135
|
-
await this.clickOnSubmitButton();
|
|
136
|
-
}
|
|
137
|
-
await this.enterPassword(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_PASSWORD);
|
|
138
|
-
await this.clickOnSubmitButton();
|
|
139
|
-
if (FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER === GitProviderType.AZURE_DEVOPS) {
|
|
140
|
-
await this.clickOnNotRememberCredentialsButton();
|
|
141
|
-
}
|
|
142
|
-
await this.waitClosingLoginPage();
|
|
143
|
-
}
|
|
129
|
+
async login(): Promise<void> {
|
|
130
|
+
Logger.debug();
|
|
144
131
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
await this.clickOnApproveButton();
|
|
150
|
-
await this.waitDisappearanceOauthPage();
|
|
151
|
-
} catch (e) {
|
|
152
|
-
Logger.debug('OauthPage.confirmAccess - access was not confirmed, retrying to click confirmation button');
|
|
153
|
-
// workaround for github, AZURE_DEVOPS oauth confirmation page (bot security)
|
|
154
|
-
await this.driverHelper.getAction()
|
|
155
|
-
.move({
|
|
156
|
-
origin: await this.driverHelper.waitPresence(OauthPage.APPROVE_BUTTON)
|
|
157
|
-
})
|
|
158
|
-
.click()
|
|
159
|
-
.perform();
|
|
160
|
-
await this.waitDisappearanceOauthPage();
|
|
161
|
-
}
|
|
132
|
+
await this.waitLoginPage();
|
|
133
|
+
await this.enterUserName(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_USERNAME);
|
|
134
|
+
if (FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER === GitProviderType.AZURE_DEVOPS) {
|
|
135
|
+
await this.clickOnSubmitButton();
|
|
162
136
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
137
|
+
await this.enterPassword(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_PASSWORD);
|
|
138
|
+
await this.clickOnSubmitButton();
|
|
139
|
+
if (FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER === GitProviderType.AZURE_DEVOPS) {
|
|
140
|
+
await this.clickOnNotRememberCredentialsButton();
|
|
141
|
+
}
|
|
142
|
+
await this.waitClosingLoginPage();
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async confirmAccess(): Promise<void> {
|
|
146
|
+
Logger.debug();
|
|
147
|
+
|
|
148
|
+
try {
|
|
149
|
+
await this.clickOnApproveButton();
|
|
150
|
+
await this.waitDisappearanceOauthPage();
|
|
151
|
+
} catch (e) {
|
|
152
|
+
Logger.debug('access was not confirmed, retrying to click confirmation button');
|
|
153
|
+
// workaround for GITHUB, AZURE_DEVOPS oauth confirmation page (bot security)
|
|
154
|
+
await this.driverHelper.getAction()
|
|
155
|
+
.move({
|
|
156
|
+
origin: await this.driverHelper.waitPresence(OauthPage.APPROVE_BUTTON)
|
|
157
|
+
})
|
|
158
|
+
.click()
|
|
159
|
+
.perform();
|
|
160
|
+
await this.waitDisappearanceOauthPage();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
async denyAccess(): Promise<void> {
|
|
165
|
+
Logger.debug();
|
|
166
|
+
|
|
167
|
+
try {
|
|
168
|
+
await this.clickOnDenyAccessButton();
|
|
169
|
+
await this.waitDisappearanceOauthPage();
|
|
170
|
+
} catch (e) {
|
|
171
|
+
Logger.debug('deny access was not confirmed, retrying to click confirmation button');
|
|
172
|
+
// workaround for GITHUB, AZURE_DEVOPS oauth confirmation page (bot security)
|
|
173
|
+
await this.driverHelper.getAction()
|
|
174
|
+
.move({
|
|
175
|
+
origin: await this.driverHelper.waitPresence(OauthPage.DENY_ACCESS_BUTTON)
|
|
176
|
+
})
|
|
177
|
+
.click()
|
|
178
|
+
.perform();
|
|
179
|
+
await this.waitDisappearanceOauthPage();
|
|
181
180
|
}
|
|
181
|
+
}
|
|
182
182
|
}
|
|
@@ -21,54 +21,54 @@ import { MonacoConstants } from '../../constants/MonacoConstants';
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
export class CheCodeLocatorLoader extends LocatorLoader {
|
|
24
|
-
|
|
24
|
+
readonly webCheCodeLocators: Locators;
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
constructor() {
|
|
27
|
+
super(MonacoConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION, MonacoConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION, getLocatorsPath());
|
|
28
|
+
this.webCheCodeLocators = this.mergeLocators() as Locators;
|
|
29
|
+
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
private webLocatorDiff(): LocatorDiff {
|
|
32
|
+
return {
|
|
33
|
+
locators: {
|
|
34
|
+
WelcomeContent: {
|
|
35
|
+
text: By.xpath('//*[@class="dialog-message-text" and contains(text(), "trust")]'),
|
|
36
|
+
button: By.xpath('//a[contains(., "trust")]')
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
extras: {
|
|
40
|
+
ExtensionsViewSection: {
|
|
41
|
+
requireReloadButton: By.xpath('//a[text()=\'Reload Required\']')
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
private merge(target: any, obj: any): object {
|
|
48
|
+
for (const key in obj) {
|
|
49
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
let oldVal: any = obj[key];
|
|
54
|
+
let newVal: any = target[key];
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
return target;
|
|
56
|
+
if (typeof (newVal) === 'object' && typeof (oldVal) === 'object') {
|
|
57
|
+
target[key] = this.merge(newVal, oldVal);
|
|
58
|
+
} else {
|
|
59
|
+
target[key] = clone(oldVal);
|
|
60
|
+
}
|
|
63
61
|
}
|
|
62
|
+
return target;
|
|
63
|
+
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
private mergeLocators(): Locators {
|
|
66
|
+
const target: Locators = super.loadLocators();
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
this.merge(target, this.webLocatorDiff().locators as Locators);
|
|
69
|
+
this.merge(target, this.webLocatorDiff().extras as Locators);
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
return target;
|
|
72
|
+
}
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import 'reflect-metadata';
|
|
11
|
-
import {
|
|
11
|
+
import { inject, injectable } from 'inversify';
|
|
12
12
|
import { CLASSES } from '../../../configs/inversify.types';
|
|
13
13
|
import { Logger } from '../../../utils/Logger';
|
|
14
14
|
import { By } from 'selenium-webdriver';
|
|
@@ -18,41 +18,41 @@ import { DriverHelper } from '../../../utils/DriverHelper';
|
|
|
18
18
|
@injectable()
|
|
19
19
|
export class DexLoginPage {
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
private static readonly dexPageContentContainer: By = By.className('dex-container');
|
|
22
|
+
private static readonly loginInput: By = By.id('login');
|
|
23
|
+
private static readonly passwordInput: By = By.id('password');
|
|
24
|
+
private static readonly submitButton: By = By.id('submit-login');
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
constructor(
|
|
27
|
+
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
async waitDexLoginPage(): Promise<void> {
|
|
30
|
+
Logger.debug();
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
await this.driverHelper.waitVisibility(DexLoginPage.dexPageContentContainer, TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
async clickOnLoginButton(): Promise<void> {
|
|
36
|
+
Logger.debug();
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
await this.driverHelper.waitAndClick(DexLoginPage.submitButton);
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
async enterUserNameKubernetes(userName: string): Promise<void> {
|
|
42
|
+
Logger.debug();
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
await this.driverHelper.enterValue(DexLoginPage.loginInput, userName);
|
|
45
|
+
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
async enterPasswordKubernetes(password: string): Promise<void> {
|
|
48
|
+
Logger.debug();
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
await this.driverHelper.enterValue(DexLoginPage.passwordInput, password);
|
|
51
|
+
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
async waitDexLoginPageDisappearance(): Promise<void> {
|
|
54
|
+
Logger.debug();
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
await this.driverHelper.waitDisappearance(DexLoginPage.dexPageContentContainer, TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
57
|
+
}
|
|
58
58
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import 'reflect-metadata';
|
|
11
|
-
import {
|
|
11
|
+
import { inject, injectable } from 'inversify';
|
|
12
12
|
import { CLASSES } from '../../../configs/inversify.types';
|
|
13
13
|
import { Logger } from '../../../utils/Logger';
|
|
14
14
|
import { ICheLoginPage } from '../interfaces/ICheLoginPage';
|
|
@@ -18,16 +18,16 @@ import { OAuthConstants } from '../../../constants/OAuthConstants';
|
|
|
18
18
|
@injectable()
|
|
19
19
|
export class KubernetesLoginPage implements ICheLoginPage {
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
constructor(
|
|
22
|
+
@inject(CLASSES.DexLoginPage) private readonly dexLoginPage: DexLoginPage) { }
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
async login(): Promise<void> {
|
|
25
|
+
Logger.debug();
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
await this.dexLoginPage.waitDexLoginPage();
|
|
28
|
+
await this.dexLoginPage.enterUserNameKubernetes(OAuthConstants.TS_SELENIUM_K8S_USERNAME);
|
|
29
|
+
await this.dexLoginPage.enterPasswordKubernetes(OAuthConstants.TS_SELENIUM_K8S_PASSWORD);
|
|
30
|
+
await this.dexLoginPage.clickOnLoginButton();
|
|
31
|
+
await this.dexLoginPage.waitDexLoginPageDisappearance();
|
|
32
|
+
}
|
|
33
33
|
}
|