@eclipse-che/che-e2e 7.70.0-dev-e748965 → 7.70.0-dev-6d2f86b
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/README.md +13 -4
- package/configs/inversify.config.ts +18 -15
- package/configs/inversify.types.ts +2 -1
- package/configs/mocharc.ts +12 -2
- package/configs/sh-scripts/generateIndex.sh +2 -3
- package/constants/APITestConstants.ts +56 -0
- package/constants/BaseTestConstants.ts +65 -0
- package/constants/ChromeDriverConstants.ts +46 -0
- package/constants/FactoryTestConstants.ts +45 -0
- package/constants/MonacoConstants.ts +22 -0
- package/constants/OAuthConstants.ts +56 -0
- package/constants/PluginsTestConstants.ts +15 -0
- package/constants/ReporterConstants.ts +45 -0
- package/constants/TimeoutConstants.ts +28 -146
- package/dist/configs/inversify.config.js +15 -11
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +2 -1
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +11 -2
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/APITestConstants.js +54 -0
- package/dist/constants/APITestConstants.js.map +1 -0
- package/dist/constants/BaseTestConstants.js +61 -0
- package/dist/constants/BaseTestConstants.js.map +1 -0
- package/dist/constants/ChromeDriverConstants.js +44 -0
- package/dist/constants/ChromeDriverConstants.js.map +1 -0
- package/dist/constants/FactoryTestConstants.js +44 -0
- package/dist/constants/FactoryTestConstants.js.map +1 -0
- package/dist/constants/MonacoConstants.js +25 -0
- package/dist/constants/MonacoConstants.js.map +1 -0
- package/dist/constants/OAuthConstants.js +52 -0
- package/dist/constants/OAuthConstants.js.map +1 -0
- package/dist/constants/PluginsTestConstants.js +19 -0
- package/dist/constants/PluginsTestConstants.js.map +1 -0
- package/dist/constants/ReporterConstants.js +43 -0
- package/dist/constants/ReporterConstants.js.map +1 -0
- package/dist/constants/TimeoutConstants.js +22 -113
- package/dist/constants/TimeoutConstants.js.map +1 -1
- package/dist/driver/ChromeDriver.js +7 -7
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/index.js +19 -10
- package/dist/index.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +2 -2
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +7 -6
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +3 -4
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +2 -3
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +12 -19
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +2 -2
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/pageobjects/login/interfaces/ICheLoginPage.js.map +1 -0
- package/dist/pageobjects/login/interfaces/IOcpLoginPage.js.map +1 -0
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js +68 -0
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -0
- package/dist/pageobjects/{openshift/CheLoginPage.js → login/kubernetes/KubernetesLoginPage.js} +21 -26
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -0
- package/dist/pageobjects/{openshift → login/openshift}/OcpLoginPage.js +7 -7
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{OcpRedHatLoginPage.js → openshift/OcpRedHatLoginPage.js} +5 -5
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{OcpUserLoginPage.js → openshift/OcpUserLoginPage.js} +7 -7
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{RedHatLoginPage.js → openshift/RedHatLoginPage.js} +6 -6
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{RegularUserOcpCheLoginPage.js → openshift/RegularUserOcpCheLoginPage.js} +8 -8
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -0
- package/dist/specs/MochaHooks.js +9 -7
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +2 -2
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +4 -3
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +7 -2
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecomendedExtentions.spec.js +4 -3
- package/dist/specs/dashboard-samples/RecomendedExtentions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +2 -2
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +12 -10
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +16 -14
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +17 -15
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js +4 -4
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +1 -2
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +2 -2
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js +31 -27
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +7 -7
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +9 -9
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +16 -17
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +13 -11
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +11 -11
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js +5 -5
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +2 -2
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +4 -2
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/workspace/TestWorkspaceUtil.js +3 -3
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/driver/ChromeDriver.ts +7 -7
- package/index.ts +19 -10
- package/package.json +1 -1
- package/pageobjects/dashboard/CreateWorkspace.ts +2 -2
- package/pageobjects/dashboard/Dashboard.ts +7 -6
- package/pageobjects/dashboard/Workspaces.ts +3 -4
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +2 -3
- package/pageobjects/git-providers/OauthPage.ts +8 -16
- package/pageobjects/ide/CheCodeLocatorLoader.ts +2 -2
- package/pageobjects/login/kubernetes/DexLoginPage.ts +58 -0
- package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +33 -0
- package/pageobjects/{openshift → login/openshift}/OcpLoginPage.ts +7 -7
- package/pageobjects/login/{OcpRedHatLoginPage.ts → openshift/OcpRedHatLoginPage.ts} +6 -6
- package/pageobjects/login/{OcpUserLoginPage.ts → openshift/OcpUserLoginPage.ts} +8 -8
- package/pageobjects/login/{RedHatLoginPage.ts → openshift/RedHatLoginPage.ts} +6 -6
- package/pageobjects/login/{RegularUserOcpCheLoginPage.ts → openshift/RegularUserOcpCheLoginPage.ts} +9 -9
- package/specs/MochaHooks.ts +9 -7
- package/specs/SmokeTest.spec.ts +2 -2
- package/specs/api/EmptyWorkspaceAPI.spec.ts +4 -3
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +10 -2
- package/specs/dashboard-samples/RecomendedExtentions.spec.ts +4 -3
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +2 -2
- package/specs/factory/Factory.spec.ts +12 -10
- package/specs/factory/NoSetupRepoFactory.spec.ts +16 -14
- package/specs/factory/RefusedOAuthFactory.spec.ts +17 -15
- package/tests-library/LoginTests.ts +6 -6
- package/tests-library/WorkspaceHandlingTests.ts +1 -2
- package/utils/BrowserTabsUtil.ts +2 -2
- package/utils/CheReporter.ts +32 -28
- package/utils/DevWorkspaceConfigurationHelper.ts +7 -7
- package/utils/DevfilesRegistryHelper.ts +3 -3
- package/utils/DriverHelper.ts +20 -21
- package/utils/KubernetesCommandLineToolsExecutor.ts +11 -9
- package/utils/Logger.ts +11 -12
- package/utils/ScreenCatcher.ts +5 -5
- package/utils/request-handlers/CheApiRequestHandler.ts +2 -2
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +4 -2
- package/utils/workspace/TestWorkspaceUtil.ts +3 -3
- package/constants/TestConstants.ts +0 -255
- package/dist/constants/TestConstants.js +0 -206
- package/dist/constants/TestConstants.js.map +0 -1
- package/dist/pageobjects/login/ICheLoginPage.js.map +0 -1
- package/dist/pageobjects/login/IOcpLoginPage.js.map +0 -1
- package/dist/pageobjects/login/OcpRedHatLoginPage.js.map +0 -1
- package/dist/pageobjects/login/OcpUserLoginPage.js.map +0 -1
- package/dist/pageobjects/login/RedHatLoginPage.js.map +0 -1
- package/dist/pageobjects/login/RegularUserOcpCheLoginPage.js.map +0 -1
- package/dist/pageobjects/openshift/CheLoginPage.js.map +0 -1
- package/dist/pageobjects/openshift/OcpLoginPage.js.map +0 -1
- package/pageobjects/openshift/CheLoginPage.ts +0 -42
- /package/dist/pageobjects/login/{ICheLoginPage.js → interfaces/ICheLoginPage.js} +0 -0
- /package/dist/pageobjects/login/{IOcpLoginPage.js → interfaces/IOcpLoginPage.js} +0 -0
- /package/pageobjects/login/{ICheLoginPage.ts → interfaces/ICheLoginPage.ts} +0 -0
- /package/pageobjects/login/{IOcpLoginPage.ts → interfaces/IOcpLoginPage.ts} +0 -0
|
@@ -12,10 +12,11 @@ import 'reflect-metadata';
|
|
|
12
12
|
import { CLASSES } from '../../configs/inversify.types';
|
|
13
13
|
import { By } from 'selenium-webdriver';
|
|
14
14
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
15
|
-
import { TestConstants } from '../../constants/TestConstants';
|
|
16
15
|
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
17
16
|
import { Workspaces } from './Workspaces';
|
|
18
17
|
import { Logger } from '../../utils/Logger';
|
|
18
|
+
import { OAuthConstants } from '../../constants/OAuthConstants';
|
|
19
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
19
20
|
|
|
20
21
|
@injectable()
|
|
21
22
|
export class Dashboard {
|
|
@@ -29,7 +30,7 @@ export class Dashboard {
|
|
|
29
30
|
private static getUserDropdownMenuButtonLocator(): By {
|
|
30
31
|
Logger.debug(`Dashboard.getUserDropdownMenuButtonLocator: get current user.`);
|
|
31
32
|
|
|
32
|
-
const currentUser: string =
|
|
33
|
+
const currentUser: string = OAuthConstants.TS_SELENIUM_OCP_USERNAME;
|
|
33
34
|
Logger.debug(`Dashboard.getUserDropdownMenuButtonLocator: ${currentUser}.`);
|
|
34
35
|
|
|
35
36
|
return By.xpath(`//*[text()="${currentUser}"]//parent::button`);
|
|
@@ -60,7 +61,7 @@ export class Dashboard {
|
|
|
60
61
|
await this.workspaces.waitWorkspaceListItem(workspaceName);
|
|
61
62
|
await this.workspaces.deleteWorkspaceByActionsButton(workspaceName);
|
|
62
63
|
await this.workspaces.waitPage();
|
|
63
|
-
await this.workspaces.
|
|
64
|
+
await this.workspaces.waitWorkspaceListItemAbsence(workspaceName);
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
async stopAndRemoveWorkspaceByUI(workspaceName: string): Promise<void> {
|
|
@@ -68,12 +69,12 @@ export class Dashboard {
|
|
|
68
69
|
|
|
69
70
|
await this.stopWorkspaceByUI(workspaceName);
|
|
70
71
|
await this.workspaces.deleteWorkspaceByActionsButton(workspaceName);
|
|
71
|
-
await this.workspaces.
|
|
72
|
+
await this.workspaces.waitWorkspaceListItemAbsence(workspaceName);
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
async openDashboard(): Promise<void> {
|
|
75
76
|
Logger.debug('Dashboard.openDashboard');
|
|
76
|
-
await this.driverHelper.getDriver().navigate().to(
|
|
77
|
+
await this.driverHelper.getDriver().navigate().to(BaseTestConstants.TS_SELENIUM_BASE_URL);
|
|
77
78
|
await this.waitPage();
|
|
78
79
|
|
|
79
80
|
}
|
|
@@ -125,7 +126,7 @@ export class Dashboard {
|
|
|
125
126
|
Logger.debug(`Dashboard.waitStartingPageLoaderDisappearance`);
|
|
126
127
|
|
|
127
128
|
await this.driverHelper.waitDisappearance(By.css(Dashboard.STARTING_PAGE_LOADER_CSS), timeout);
|
|
128
|
-
await this.driverHelper.wait(
|
|
129
|
+
await this.driverHelper.wait(TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING);
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
async getRecentWorkspaceName(timeout: number = TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT): Promise<string> {
|
|
@@ -14,7 +14,6 @@ import { CLASSES } from '../../configs/inversify.types';
|
|
|
14
14
|
import { By, WebElement } from 'selenium-webdriver';
|
|
15
15
|
import { Logger } from '../../utils/Logger';
|
|
16
16
|
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
17
|
-
import { TestConstants } from '../../constants/TestConstants';
|
|
18
17
|
|
|
19
18
|
export enum WorkspaceStatusUI {
|
|
20
19
|
Running = 'green',
|
|
@@ -160,10 +159,10 @@ export class Workspaces {
|
|
|
160
159
|
await this.clickActionsStopWorkspaceButton(workspaceName);
|
|
161
160
|
}
|
|
162
161
|
|
|
163
|
-
async
|
|
164
|
-
Logger.debug(`Workspaces.
|
|
162
|
+
async waitWorkspaceListItemAbsence(workspaceName: string, timeout: number = TimeoutConstants.TS_DASHBOARD_WORKSPACE_STOP_TIMEOUT): Promise<void> {
|
|
163
|
+
Logger.debug(`Workspaces.waitWorkspaceListItemAbsence "${workspaceName}"`);
|
|
165
164
|
|
|
166
|
-
const polling: number =
|
|
165
|
+
const polling: number = TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
167
166
|
const attempts: number = Math.ceil(timeout / polling);
|
|
168
167
|
|
|
169
168
|
const workspaceListItemLocator: By = By.xpath(this.getWorkspaceListItemLocator(workspaceName));
|
|
@@ -11,7 +11,6 @@ import { DriverHelper } from '../../../utils/DriverHelper';
|
|
|
11
11
|
import { injectable, inject } from 'inversify';
|
|
12
12
|
import { CLASSES, TYPES } from '../../../configs/inversify.types';
|
|
13
13
|
import 'reflect-metadata';
|
|
14
|
-
import { TestConstants } from '../../../constants/TestConstants';
|
|
15
14
|
import { By } from 'selenium-webdriver';
|
|
16
15
|
import { WorkspaceStatus } from '../../../utils/workspace/WorkspaceStatus';
|
|
17
16
|
import { Logger } from '../../../utils/Logger';
|
|
@@ -31,7 +30,7 @@ export class WorkspaceDetails {
|
|
|
31
30
|
@inject(TYPES.WorkspaceUtil) private readonly testWorkspaceUtil: ITestWorkspaceUtil,
|
|
32
31
|
@inject(CLASSES.ProjectAndFileTests) private readonly testProjectAndFileCheCode: ProjectAndFileTests) { }
|
|
33
32
|
|
|
34
|
-
async waitLoaderDisappearance(attempts: number =
|
|
33
|
+
async waitLoaderDisappearance(attempts: number = TimeoutConstants.TS_SELENIUM_DEFAULT_ATTEMPTS, polling: number = TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING): Promise<void> {
|
|
35
34
|
Logger.debug('WorkspaceDetails.waitLoaderDisappearance');
|
|
36
35
|
|
|
37
36
|
await this.driverHelper.waitDisappearance(By.css(WorkspaceDetails.WORKSPACE_DETAILS_LOADER_CSS), attempts, polling);
|
|
@@ -125,7 +124,7 @@ export class WorkspaceDetails {
|
|
|
125
124
|
await this.driverHelper.waitVisibility(By.css(WorkspaceDetails.ENABLED_SAVE_BUTTON_CSS), timeout);
|
|
126
125
|
}
|
|
127
126
|
|
|
128
|
-
private async waitSaveButtonDisappearance(attempts: number =
|
|
127
|
+
private async waitSaveButtonDisappearance(attempts: number = TimeoutConstants.TS_SELENIUM_DEFAULT_ATTEMPTS, polling: number = TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING): Promise<void> {
|
|
129
128
|
await this.driverHelper.waitDisappearance(By.css(WorkspaceDetails.SAVE_BUTTON_CSS), attempts, polling);
|
|
130
129
|
}
|
|
131
130
|
|
|
@@ -11,9 +11,10 @@ import { inject, injectable } from 'inversify';
|
|
|
11
11
|
import { By } from 'selenium-webdriver';
|
|
12
12
|
import { CLASSES } from '../../configs/inversify.types';
|
|
13
13
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
14
|
-
import { GitProviderType, TestConstants } from '../../constants/TestConstants';
|
|
15
14
|
import { Logger } from '../../utils/Logger';
|
|
16
15
|
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
16
|
+
import { FactoryTestConstants, GitProviderType } from '../../constants/FactoryTestConstants';
|
|
17
|
+
import { OAuthConstants } from '../../constants/OAuthConstants';
|
|
17
18
|
|
|
18
19
|
@injectable()
|
|
19
20
|
export class OauthPage {
|
|
@@ -24,7 +25,7 @@ export class OauthPage {
|
|
|
24
25
|
private readonly denyAccessButton: By;
|
|
25
26
|
|
|
26
27
|
constructor(@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) {
|
|
27
|
-
switch (
|
|
28
|
+
switch (FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER) {
|
|
28
29
|
case GitProviderType.BITBUCKET : {
|
|
29
30
|
this.loginForm = By.id('j_username');
|
|
30
31
|
this.passwordForm = By.id('j_password');
|
|
@@ -34,9 +35,9 @@ export class OauthPage {
|
|
|
34
35
|
}
|
|
35
36
|
break;
|
|
36
37
|
case GitProviderType.GITLAB: {
|
|
37
|
-
this.loginForm =
|
|
38
|
-
this.passwordForm =
|
|
39
|
-
this.submitButton =
|
|
38
|
+
this.loginForm = By.id('user_login');
|
|
39
|
+
this.passwordForm = By.id('user_password');
|
|
40
|
+
this.submitButton = By.xpath('//button[@data-qa-selector="sign_in_button"]');
|
|
40
41
|
this.approveButton = By.xpath('//*[@value="Authorize"]');
|
|
41
42
|
this.denyAccessButton = By.xpath('//input[@value="Deny"]');
|
|
42
43
|
}
|
|
@@ -58,15 +59,6 @@ export class OauthPage {
|
|
|
58
59
|
async waitLoginPage(): Promise<void> {
|
|
59
60
|
Logger.debug('OauthPage.waitLoginPage');
|
|
60
61
|
|
|
61
|
-
// for gitlab server https://gitlab.cee.redhat.com
|
|
62
|
-
if (!TestConstants.TS_SELENIUM_GIT_PROVIDER_IS_LDAP_LOGIN &&
|
|
63
|
-
TestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER === GitProviderType.GITLAB) {
|
|
64
|
-
{
|
|
65
|
-
Logger.debug(`OauthPage.login - go to ${TestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} Standard login section`);
|
|
66
|
-
await this.driverHelper.waitAndClick(By.xpath('//a[@data-qa-selector="standard_tab"]'));
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
62
|
await this.driverHelper.waitVisibility(this.loginForm, TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM * 3);
|
|
71
63
|
}
|
|
72
64
|
|
|
@@ -122,8 +114,8 @@ export class OauthPage {
|
|
|
122
114
|
Logger.debug('OauthPage.login');
|
|
123
115
|
|
|
124
116
|
await this.waitLoginPage();
|
|
125
|
-
await this.enterUserName(
|
|
126
|
-
await this.enterPassword(
|
|
117
|
+
await this.enterUserName(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_USERNAME);
|
|
118
|
+
await this.enterPassword(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_PASSWORD);
|
|
127
119
|
await this.clickOnLoginButton();
|
|
128
120
|
await this.waitClosingLoginPage();
|
|
129
121
|
}
|
|
@@ -12,7 +12,7 @@ import { getLocatorsPath } from 'vscode-extension-tester-locators';
|
|
|
12
12
|
import { LocatorDiff, Locators } from 'monaco-page-objects';
|
|
13
13
|
import { By } from 'selenium-webdriver';
|
|
14
14
|
import clone from 'clone-deep';
|
|
15
|
-
import {
|
|
15
|
+
import { MonacoConstants } from '../../constants/MonacoConstants';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* This class allows us to change or add some specific locators base on "monaco-page-object" and "vscode-extension-tester-locators".
|
|
@@ -24,7 +24,7 @@ export class CheCodeLocatorLoader extends LocatorLoader {
|
|
|
24
24
|
readonly webCheCodeLocators: Locators;
|
|
25
25
|
|
|
26
26
|
constructor() {
|
|
27
|
-
super(
|
|
27
|
+
super(MonacoConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION, MonacoConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION, getLocatorsPath());
|
|
28
28
|
this.webCheCodeLocators = this.mergeLocators() as Locators;
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { injectable, inject } from 'inversify';
|
|
12
|
+
import { CLASSES } from '../../../configs/inversify.types';
|
|
13
|
+
import { Logger } from '../../../utils/Logger';
|
|
14
|
+
import { By } from 'selenium-webdriver';
|
|
15
|
+
import { TimeoutConstants } from '../../../constants/TimeoutConstants';
|
|
16
|
+
import { DriverHelper } from '../../../utils/DriverHelper';
|
|
17
|
+
|
|
18
|
+
@injectable()
|
|
19
|
+
export class DexLoginPage {
|
|
20
|
+
|
|
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
|
+
|
|
26
|
+
constructor(
|
|
27
|
+
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
|
|
28
|
+
|
|
29
|
+
async waitDexLoginPage(): Promise<void> {
|
|
30
|
+
Logger.debug(`${this.constructor.name}.${this.waitDexLoginPage.name}`);
|
|
31
|
+
|
|
32
|
+
await this.driverHelper.waitVisibility(DexLoginPage.dexPageContentContainer, TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async clickOnLoginButton(): Promise<void> {
|
|
36
|
+
Logger.debug(`${this.constructor.name}.${this.clickOnLoginButton.name}`);
|
|
37
|
+
|
|
38
|
+
await this.driverHelper.waitAndClick(DexLoginPage.submitButton);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async enterUserNameKubernetes(userName: string): Promise<void> {
|
|
42
|
+
Logger.debug(`${this.constructor.name}.${this.enterUserNameKubernetes.name}`);
|
|
43
|
+
|
|
44
|
+
await this.driverHelper.enterValue(DexLoginPage.loginInput, userName);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async enterPasswordKubernetes(password: string): Promise<void> {
|
|
48
|
+
Logger.debug(`${this.constructor.name}.${this.enterPasswordKubernetes.name}`);
|
|
49
|
+
|
|
50
|
+
await this.driverHelper.enterValue(DexLoginPage.passwordInput, password);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async waitDexLoginPageDisappearance(): Promise<void> {
|
|
54
|
+
Logger.debug(`${this.constructor.name}.${this.waitDexLoginPageDisappearance.name}`);
|
|
55
|
+
|
|
56
|
+
await this.driverHelper.waitDisappearance(DexLoginPage.dexPageContentContainer, TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { injectable, inject } from 'inversify';
|
|
12
|
+
import { CLASSES } from '../../../configs/inversify.types';
|
|
13
|
+
import { Logger } from '../../../utils/Logger';
|
|
14
|
+
import { ICheLoginPage } from '../interfaces/ICheLoginPage';
|
|
15
|
+
import { DexLoginPage } from './DexLoginPage';
|
|
16
|
+
import { OAuthConstants } from '../../../constants/OAuthConstants';
|
|
17
|
+
|
|
18
|
+
@injectable()
|
|
19
|
+
export class KubernetesLoginPage implements ICheLoginPage {
|
|
20
|
+
|
|
21
|
+
constructor(
|
|
22
|
+
@inject(CLASSES.DexLoginPage) private readonly dexLoginPage: DexLoginPage) { }
|
|
23
|
+
|
|
24
|
+
async login(): Promise<void> {
|
|
25
|
+
Logger.debug(`${this.constructor.name}.${this.login.name}`);
|
|
26
|
+
|
|
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
|
+
}
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import 'reflect-metadata';
|
|
11
11
|
import { injectable, inject } from 'inversify';
|
|
12
|
-
import { DriverHelper } from '
|
|
13
|
-
import { CLASSES } from '
|
|
12
|
+
import { DriverHelper } from '../../../utils/DriverHelper';
|
|
13
|
+
import { CLASSES } from '../../../configs/inversify.types';
|
|
14
14
|
import { By } from 'selenium-webdriver';
|
|
15
|
-
import { Logger } from '
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
15
|
+
import { Logger } from '../../../utils/Logger';
|
|
16
|
+
import { TimeoutConstants } from '../../../constants/TimeoutConstants';
|
|
17
|
+
import { OAuthConstants } from '../../../constants/OAuthConstants';
|
|
18
18
|
|
|
19
19
|
@injectable()
|
|
20
20
|
export class OcpLoginPage {
|
|
@@ -33,14 +33,14 @@ export class OcpLoginPage {
|
|
|
33
33
|
async clickOnLoginProviderTitle(): Promise<void> {
|
|
34
34
|
Logger.debug('OcpLoginPage.clickOnLoginProviderTitle');
|
|
35
35
|
|
|
36
|
-
const loginProviderTitleLocator: By = By.xpath(`//a[text()=\'${
|
|
36
|
+
const loginProviderTitleLocator: By = By.xpath(`//a[text()=\'${OAuthConstants.TS_OCP_LOGIN_PAGE_PROVIDER_TITLE}\']`);
|
|
37
37
|
await this.driverHelper.waitAndClick(loginProviderTitleLocator, TimeoutConstants.TS_SELENIUM_WAIT_FOR_URL);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
async isIdentityProviderLinkVisible(): Promise<boolean> {
|
|
41
41
|
Logger.debug('OcpLoginPage.isIdentityProviderLinkVisible');
|
|
42
42
|
|
|
43
|
-
const loginWithHtpaswdLocator: By = By.xpath(`//a[text()=\'${
|
|
43
|
+
const loginWithHtpaswdLocator: By = By.xpath(`//a[text()=\'${OAuthConstants.TS_OCP_LOGIN_PAGE_PROVIDER_TITLE}\']`);
|
|
44
44
|
return await this.driverHelper.waitVisibilityBoolean(loginWithHtpaswdLocator, 3, 5000);
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
import 'reflect-metadata';
|
|
11
11
|
import { injectable, inject } from 'inversify';
|
|
12
12
|
import { RedHatLoginPage } from './RedHatLoginPage';
|
|
13
|
-
import { CLASSES } from '
|
|
13
|
+
import { CLASSES } from '../../../configs/inversify.types';
|
|
14
14
|
import { By } from 'selenium-webdriver';
|
|
15
|
-
import { TimeoutConstants } from '
|
|
16
|
-
import { ICheLoginPage } from '
|
|
17
|
-
import { OcpLoginPage } from '
|
|
18
|
-
import { DriverHelper } from '
|
|
19
|
-
import { Logger } from '
|
|
15
|
+
import { TimeoutConstants } from '../../../constants/TimeoutConstants';
|
|
16
|
+
import { ICheLoginPage } from '../interfaces/ICheLoginPage';
|
|
17
|
+
import { OcpLoginPage } from './OcpLoginPage';
|
|
18
|
+
import { DriverHelper } from '../../../utils/DriverHelper';
|
|
19
|
+
import { Logger } from '../../../utils/Logger';
|
|
20
20
|
|
|
21
21
|
@injectable()
|
|
22
22
|
export class OcpRedHatLoginPage implements ICheLoginPage {
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import 'reflect-metadata';
|
|
11
|
-
import { IOcpLoginPage } from '
|
|
11
|
+
import { IOcpLoginPage } from '../interfaces/IOcpLoginPage';
|
|
12
12
|
import { injectable, inject } from 'inversify';
|
|
13
|
-
import { OcpLoginPage } from '
|
|
14
|
-
import { CLASSES } from '
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
13
|
+
import { OcpLoginPage } from './OcpLoginPage';
|
|
14
|
+
import { CLASSES } from '../../../configs/inversify.types';
|
|
15
|
+
import { Logger } from '../../../utils/Logger';
|
|
16
|
+
import { OAuthConstants } from '../../../constants/OAuthConstants';
|
|
17
17
|
|
|
18
18
|
@injectable()
|
|
19
19
|
export class OcpUserLoginPage implements IOcpLoginPage {
|
|
@@ -24,13 +24,13 @@ export class OcpUserLoginPage implements IOcpLoginPage {
|
|
|
24
24
|
async login(): Promise<void> {
|
|
25
25
|
Logger.debug('OcpUserLoginPage.login');
|
|
26
26
|
|
|
27
|
-
if (
|
|
27
|
+
if (OAuthConstants.TS_OCP_LOGIN_PAGE_PROVIDER_TITLE !== '') {
|
|
28
28
|
await this.ocpLogin.clickOnLoginProviderTitle();
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
await this.ocpLogin.waitOpenShiftLoginWelcomePage();
|
|
32
|
-
await this.ocpLogin.enterUserNameOpenShift(
|
|
33
|
-
await this.ocpLogin.enterPasswordOpenShift(
|
|
32
|
+
await this.ocpLogin.enterUserNameOpenShift(OAuthConstants.TS_SELENIUM_OCP_USERNAME);
|
|
33
|
+
await this.ocpLogin.enterPasswordOpenShift(OAuthConstants.TS_SELENIUM_OCP_PASSWORD);
|
|
34
34
|
await this.ocpLogin.clickOnLoginButton();
|
|
35
35
|
await this.ocpLogin.waitDisappearanceOpenShiftLoginWelcomePage();
|
|
36
36
|
}
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
import 'reflect-metadata';
|
|
11
11
|
import { injectable, inject } from 'inversify';
|
|
12
12
|
import { By } from 'selenium-webdriver';
|
|
13
|
-
import { CLASSES } from '
|
|
14
|
-
import { DriverHelper } from '
|
|
15
|
-
import { Logger } from '
|
|
16
|
-
import {
|
|
13
|
+
import { CLASSES } from '../../../configs/inversify.types';
|
|
14
|
+
import { DriverHelper } from '../../../utils/DriverHelper';
|
|
15
|
+
import { Logger } from '../../../utils/Logger';
|
|
16
|
+
import { OAuthConstants } from '../../../constants/OAuthConstants';
|
|
17
17
|
|
|
18
18
|
@injectable()
|
|
19
19
|
export class RedHatLoginPage {
|
|
@@ -34,7 +34,7 @@ export class RedHatLoginPage {
|
|
|
34
34
|
Logger.debug('RedHatLoginPage.enterPasswordRedHat');
|
|
35
35
|
const passwordFieldLocator: By = By.id(this.PASSWORD_INPUT_ID);
|
|
36
36
|
await this.driverHelper.waitVisibility(passwordFieldLocator, 3000);
|
|
37
|
-
await this.driverHelper.enterValue(passwordFieldLocator,
|
|
37
|
+
await this.driverHelper.enterValue(passwordFieldLocator, OAuthConstants.TS_SELENIUM_OCP_PASSWORD);
|
|
38
38
|
}
|
|
39
39
|
async clickOnLoginButton(): Promise<void> {
|
|
40
40
|
Logger.debug('RedHatLoginPage.clickOnLoginButton');
|
|
@@ -49,7 +49,7 @@ export class RedHatLoginPage {
|
|
|
49
49
|
Logger.debug('RedHatLoginPage.enterUserNameRedHat');
|
|
50
50
|
const usernameFieldLocator: By = By.id(this.USERNAME_INPUT_ID);
|
|
51
51
|
await this.driverHelper.waitVisibility(usernameFieldLocator, 20000);
|
|
52
|
-
await this.driverHelper.enterValue(usernameFieldLocator,
|
|
52
|
+
await this.driverHelper.enterValue(usernameFieldLocator, OAuthConstants.TS_SELENIUM_OCP_USERNAME);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
async clickNextButton(): Promise<void> {
|
package/pageobjects/login/{RegularUserOcpCheLoginPage.ts → openshift/RegularUserOcpCheLoginPage.ts}
RENAMED
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import 'reflect-metadata';
|
|
11
|
-
import { ICheLoginPage } from '
|
|
12
|
-
import { OcpLoginPage } from '
|
|
11
|
+
import { ICheLoginPage } from '../interfaces/ICheLoginPage';
|
|
12
|
+
import { OcpLoginPage } from './OcpLoginPage';
|
|
13
13
|
import { injectable, inject } from 'inversify';
|
|
14
|
-
import { CLASSES } from '
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
14
|
+
import { CLASSES } from '../../../configs/inversify.types';
|
|
15
|
+
import { Logger } from '../../../utils/Logger';
|
|
16
|
+
import { TimeoutConstants } from '../../../constants/TimeoutConstants';
|
|
18
17
|
import { By } from 'selenium-webdriver';
|
|
19
|
-
import { DriverHelper } from '
|
|
18
|
+
import { DriverHelper } from '../../../utils/DriverHelper';
|
|
19
|
+
import { OAuthConstants } from '../../../constants/OAuthConstants';
|
|
20
20
|
|
|
21
21
|
@injectable()
|
|
22
22
|
export class RegularUserOcpCheLoginPage implements ICheLoginPage {
|
|
@@ -40,8 +40,8 @@ export class RegularUserOcpCheLoginPage implements ICheLoginPage {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
await this.ocpLogin.waitOpenShiftLoginWelcomePage();
|
|
43
|
-
await this.ocpLogin.enterUserNameOpenShift(
|
|
44
|
-
await this.ocpLogin.enterPasswordOpenShift(
|
|
43
|
+
await this.ocpLogin.enterUserNameOpenShift(OAuthConstants.TS_SELENIUM_OCP_USERNAME);
|
|
44
|
+
await this.ocpLogin.enterPasswordOpenShift(OAuthConstants.TS_SELENIUM_OCP_PASSWORD);
|
|
45
45
|
await this.ocpLogin.clickOnLoginButton();
|
|
46
46
|
await this.ocpLogin.waitDisappearanceOpenShiftLoginWelcomePage();
|
|
47
47
|
|
package/specs/MochaHooks.ts
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
import 'reflect-metadata';
|
|
12
12
|
import { CLASSES, TYPES } from '../configs/inversify.types';
|
|
13
|
-
import { TestConstants } from '../constants/TestConstants';
|
|
14
13
|
import { CheApiRequestHandler } from '../utils/request-handlers/CheApiRequestHandler';
|
|
15
14
|
import { TimeoutConstants } from '../constants/TimeoutConstants';
|
|
16
15
|
import * as monacoPageObjects from 'monaco-page-objects';
|
|
@@ -19,6 +18,9 @@ import { e2eContainer } from '../configs/inversify.config';
|
|
|
19
18
|
import { DriverHelper } from '../utils/DriverHelper';
|
|
20
19
|
import { ITestWorkspaceUtil } from '../utils/workspace/ITestWorkspaceUtil';
|
|
21
20
|
import { Logger } from '../utils/Logger';
|
|
21
|
+
import { BaseTestConstants } from '../constants/BaseTestConstants';
|
|
22
|
+
import { ChromeDriverConstants } from '../constants/ChromeDriverConstants';
|
|
23
|
+
import { MonacoConstants } from '../constants/MonacoConstants';
|
|
22
24
|
|
|
23
25
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
24
26
|
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
@@ -33,21 +35,21 @@ export function registerRunningWorkspace(workspaceName: string): void {
|
|
|
33
35
|
exports.mochaHooks = {
|
|
34
36
|
beforeAll: [
|
|
35
37
|
async function enableRequestInterceptor(): Promise<void> {
|
|
36
|
-
if (
|
|
38
|
+
if (BaseTestConstants.TS_SELENIUM_REQUEST_INTERCEPTOR) {
|
|
37
39
|
CheApiRequestHandler.enableRequestInterceptor();
|
|
38
40
|
}
|
|
39
41
|
},
|
|
40
42
|
async function enableResponseInterceptor(): Promise<void> {
|
|
41
|
-
if (
|
|
43
|
+
if (BaseTestConstants.TS_SELENIUM_RESPONSE_INTERCEPTOR) {
|
|
42
44
|
CheApiRequestHandler.enableResponseInterceptor();
|
|
43
45
|
}
|
|
44
46
|
},
|
|
45
47
|
async function initMonacoPageObjects(): Promise<void> {
|
|
46
48
|
// init vscode-extension-tester monaco-page-objects
|
|
47
|
-
monacoPageObjects.initPageObjects(
|
|
49
|
+
monacoPageObjects.initPageObjects(MonacoConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_USE_VERSION, MonacoConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION, vscodeExtensionTesterLocators.getLocatorsPath(), driverHelper.getDriver(), 'google-chrome');
|
|
48
50
|
},
|
|
49
51
|
async function prolongTimeoutConstantsInDebugMode(): Promise<void> {
|
|
50
|
-
if (
|
|
52
|
+
if (BaseTestConstants.TS_DEBUG_MODE) {
|
|
51
53
|
for (let [timeout, seconds] of Object.entries(TimeoutConstants)) {
|
|
52
54
|
Object.defineProperty(TimeoutConstants, timeout, {value: seconds as number * 100});
|
|
53
55
|
}
|
|
@@ -57,13 +59,13 @@ exports.mochaHooks = {
|
|
|
57
59
|
afterAll: [
|
|
58
60
|
// stop and remove running workspace
|
|
59
61
|
async () => {
|
|
60
|
-
if (
|
|
62
|
+
if (BaseTestConstants.DELETE_WORKSPACE_ON_FAILED_TEST) {
|
|
61
63
|
Logger.info('Property DELETE_WORKSPACE_ON_FAILED_TEST is true - trying to stop and delete running workspace with API.');
|
|
62
64
|
testWorkspaceUtil.stopAndDeleteWorkspaceByName(latestWorkspace);
|
|
63
65
|
}
|
|
64
66
|
},
|
|
65
67
|
async function stopTheDriver(): Promise<void> {
|
|
66
|
-
if (!
|
|
68
|
+
if (!BaseTestConstants.TS_DEBUG_MODE && ChromeDriverConstants.TS_USE_WEB_DRIVER_FOR_TEST) {
|
|
67
69
|
await driverHelper.getDriver().quit();
|
|
68
70
|
Logger.info('Chrome driver session stopped.');
|
|
69
71
|
}
|
package/specs/SmokeTest.spec.ts
CHANGED
|
@@ -15,10 +15,10 @@ import { WorkspaceHandlingTests } from '../tests-library/WorkspaceHandlingTests'
|
|
|
15
15
|
import { registerRunningWorkspace } from './MochaHooks';
|
|
16
16
|
import { Logger } from '../utils/Logger';
|
|
17
17
|
import { LoginTests } from '../tests-library/LoginTests';
|
|
18
|
-
import { TestConstants } from '../constants/TestConstants';
|
|
19
18
|
import { StringUtil } from '../utils/StringUtil';
|
|
19
|
+
import { FactoryTestConstants } from '../constants/FactoryTestConstants';
|
|
20
20
|
|
|
21
|
-
const factoryUrl: string =
|
|
21
|
+
const factoryUrl: string = FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL || 'https://github.com/che-incubator/quarkus-api-example.git';
|
|
22
22
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
23
23
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
24
24
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
@@ -2,13 +2,14 @@ import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesComman
|
|
|
2
2
|
import { expect } from 'chai';
|
|
3
3
|
import { ShellString } from 'shelljs';
|
|
4
4
|
import { StringUtil } from '../../utils/StringUtil';
|
|
5
|
-
import { TestConstants } from '../../constants/TestConstants';
|
|
6
5
|
import { DevWorkspaceConfigurationHelper } from '../../utils/DevWorkspaceConfigurationHelper';
|
|
7
6
|
import { DevfileContext } from '@eclipse-che/che-devworkspace-generator/lib/api/devfile-context';
|
|
7
|
+
import { APITestConstants } from '../../constants/APITestConstants';
|
|
8
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
8
9
|
|
|
9
10
|
suite(`Empty workspace API test`, async function (): Promise<void> {
|
|
10
11
|
// works only for root user
|
|
11
|
-
const namespace: string =
|
|
12
|
+
const namespace: string = APITestConstants.TS_API_TEST_NAMESPACE;
|
|
12
13
|
let clonedProjectName: string;
|
|
13
14
|
let containerWorkDir: string;
|
|
14
15
|
let devWorkspaceConfigurationHelper: DevWorkspaceConfigurationHelper;
|
|
@@ -57,7 +58,7 @@ suite(`Empty workspace API test`, async function (): Promise<void> {
|
|
|
57
58
|
|
|
58
59
|
test('Check if project files are imported', function (): void {
|
|
59
60
|
expect(containerTerminal.ls(`${containerWorkDir}/${clonedProjectName}`).stdout)
|
|
60
|
-
.includes(
|
|
61
|
+
.includes(BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME);
|
|
61
62
|
});
|
|
62
63
|
|
|
63
64
|
suiteTeardown('Delete cloned project', function (): void {
|
|
@@ -15,10 +15,13 @@ import { Logger } from '../../utils/Logger';
|
|
|
15
15
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
16
16
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
17
17
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
18
|
+
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
18
19
|
|
|
19
20
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
20
21
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
21
22
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
23
|
+
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
24
|
+
|
|
22
25
|
const stackName: string = 'Empty Workspace';
|
|
23
26
|
|
|
24
27
|
suite(`${stackName} test`, async () => {
|
|
@@ -44,8 +47,13 @@ suite(`${stackName} test`, async () => {
|
|
|
44
47
|
});
|
|
45
48
|
|
|
46
49
|
suite('Stopping and deleting the workspace', async () => {
|
|
47
|
-
test(
|
|
48
|
-
await workspaceHandlingTests.
|
|
50
|
+
test('Stop the workspace', async function (): Promise<void> {
|
|
51
|
+
await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
52
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('Delete the workspace', async function (): Promise<void> {
|
|
56
|
+
await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
49
57
|
});
|
|
50
58
|
loginTests.logoutFromChe();
|
|
51
59
|
});
|
|
@@ -33,8 +33,9 @@ import { DriverHelper } from '../../utils/DriverHelper';
|
|
|
33
33
|
import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader';
|
|
34
34
|
import { expect } from 'chai';
|
|
35
35
|
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
36
|
-
import { TestConstants } from '../../constants/TestConstants';
|
|
37
36
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
37
|
+
import { PluginsTestConstants } from '../../constants/PluginsTestConstants';
|
|
38
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
38
39
|
|
|
39
40
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
40
41
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -42,7 +43,7 @@ const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
|
42
43
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
43
44
|
|
|
44
45
|
const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators;
|
|
45
|
-
const samples: string[] =
|
|
46
|
+
const samples: string[] = PluginsTestConstants.TS_SAMPLE_LIST.split(',');
|
|
46
47
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
47
48
|
|
|
48
49
|
suite(`Check if recommended extensions installed for ${samples}`, async function (): Promise<void> {
|
|
@@ -71,7 +72,7 @@ suite(`Check if recommended extensions installed for ${samples}`, async function
|
|
|
71
72
|
|
|
72
73
|
test('Wait until the project will be imported and accept it as trusted one', async function (): Promise<void> {
|
|
73
74
|
[projectSection] = await new SideBarView().getContent().getSections();
|
|
74
|
-
const label: string =
|
|
75
|
+
const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
75
76
|
Logger.debug(`projectSection.findItem: find ${label}`);
|
|
76
77
|
const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
|
|
77
78
|
expect(isFileImported).not.eqls(undefined);
|
|
@@ -20,12 +20,12 @@ import { CLASSES } from '../../configs/inversify.types';
|
|
|
20
20
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
21
21
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
22
22
|
import { expect } from 'chai';
|
|
23
|
-
import { TestConstants } from '../../constants/TestConstants';
|
|
24
23
|
import { OcpMainPage } from '../../pageobjects/openshift/OcpMainPage';
|
|
25
24
|
import { OcpImportFromGitPage } from '../../pageobjects/openshift/OcpImportFromGitPage';
|
|
26
25
|
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
27
26
|
import { StringUtil } from '../../utils/StringUtil';
|
|
28
27
|
import { OcpApplicationPage } from '../../pageobjects/openshift/OcpApplicationPage';
|
|
28
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
29
29
|
|
|
30
30
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
31
31
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
@@ -86,7 +86,7 @@ suite(`DevConsole Integration`, async function (): Promise<void> {
|
|
|
86
86
|
test('Check if project and files imported', async function (): Promise<void> {
|
|
87
87
|
const applicationSourceProjectName: string = StringUtil.getProjectNameFromGitUrl(gitImportRepo);
|
|
88
88
|
const projectSection: ViewSection = await new SideBarView().getContent().getSection(applicationSourceProjectName);
|
|
89
|
-
const isFileImported: ViewItem | undefined = await projectSection.findItem(
|
|
89
|
+
const isFileImported: ViewItem | undefined = await projectSection.findItem(BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME);
|
|
90
90
|
expect(isFileImported).not.eqls(undefined);
|
|
91
91
|
});
|
|
92
92
|
|