@eclipse-che/che-e2e 7.70.0-dev-eacd975 → 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 +4 -4
- package/configs/inversify.config.ts +5 -6
- package/configs/inversify.types.ts +0 -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 +5 -6
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +0 -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 +11 -4
- 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 +5 -4
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +1 -2
- 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/kubernetes/KubernetesLoginPage.js +3 -3
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
- package/dist/pageobjects/{openshift → login/openshift}/OcpLoginPage.js +7 -7
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -0
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +1 -1
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +5 -5
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js +3 -3
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +4 -4
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
- 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/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 +2 -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 +11 -4
- package/package.json +1 -1
- package/pageobjects/dashboard/CreateWorkspace.ts +2 -2
- package/pageobjects/dashboard/Dashboard.ts +5 -4
- package/pageobjects/dashboard/Workspaces.ts +1 -2
- 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/KubernetesLoginPage.ts +3 -3
- package/pageobjects/{openshift → login/openshift}/OcpLoginPage.ts +7 -7
- package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +1 -1
- package/pageobjects/login/openshift/OcpUserLoginPage.ts +5 -5
- package/pageobjects/login/openshift/RedHatLoginPage.ts +3 -3
- package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +4 -4
- 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/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 +4 -4
- 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 +2 -2
- package/utils/workspace/TestWorkspaceUtil.ts +3 -3
- package/constants/TestConstants.ts +0 -274
- package/dist/constants/TestConstants.js +0 -223
- package/dist/constants/TestConstants.js.map +0 -1
- package/dist/pageobjects/openshift/CheLoginPage.js +0 -55
- 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
|
@@ -14,7 +14,7 @@ import { CLASSES } from '../../../configs/inversify.types';
|
|
|
14
14
|
import { By } from 'selenium-webdriver';
|
|
15
15
|
import { TimeoutConstants } from '../../../constants/TimeoutConstants';
|
|
16
16
|
import { ICheLoginPage } from '../interfaces/ICheLoginPage';
|
|
17
|
-
import { OcpLoginPage } from '
|
|
17
|
+
import { OcpLoginPage } from './OcpLoginPage';
|
|
18
18
|
import { DriverHelper } from '../../../utils/DriverHelper';
|
|
19
19
|
import { Logger } from '../../../utils/Logger';
|
|
20
20
|
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
import 'reflect-metadata';
|
|
11
11
|
import { IOcpLoginPage } from '../interfaces/IOcpLoginPage';
|
|
12
12
|
import { injectable, inject } from 'inversify';
|
|
13
|
-
import { OcpLoginPage } from '
|
|
13
|
+
import { OcpLoginPage } from './OcpLoginPage';
|
|
14
14
|
import { CLASSES } from '../../../configs/inversify.types';
|
|
15
|
-
import { TestConstants } from '../../../constants/TestConstants';
|
|
16
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
|
}
|
|
@@ -13,7 +13,7 @@ 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 { 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> {
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import 'reflect-metadata';
|
|
11
11
|
import { ICheLoginPage } from '../interfaces/ICheLoginPage';
|
|
12
|
-
import { OcpLoginPage } from '
|
|
12
|
+
import { OcpLoginPage } from './OcpLoginPage';
|
|
13
13
|
import { injectable, inject } from 'inversify';
|
|
14
14
|
import { CLASSES } from '../../../configs/inversify.types';
|
|
15
|
-
import { TestConstants } from '../../../constants/TestConstants';
|
|
16
15
|
import { Logger } from '../../../utils/Logger';
|
|
17
16
|
import { TimeoutConstants } from '../../../constants/TimeoutConstants';
|
|
18
17
|
import { By } from 'selenium-webdriver';
|
|
19
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 {
|
|
@@ -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
|
|
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
ViewItem,
|
|
26
26
|
ViewSection
|
|
27
27
|
} from 'monaco-page-objects';
|
|
28
|
-
import { TestConstants } from '../../constants/TestConstants';
|
|
29
28
|
import { expect } from 'chai';
|
|
30
29
|
import { OauthPage } from '../../pageobjects/git-providers/OauthPage';
|
|
31
30
|
import { StringUtil } from '../../utils/StringUtil';
|
|
@@ -38,6 +37,9 @@ import { DriverHelper } from '../../utils/DriverHelper';
|
|
|
38
37
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
39
38
|
import { Logger } from '../../utils/Logger';
|
|
40
39
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
40
|
+
import { OAuthConstants } from '../../constants/OAuthConstants';
|
|
41
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
42
|
+
import { FactoryTestConstants } from '../../constants/FactoryTestConstants';
|
|
41
43
|
|
|
42
44
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
43
45
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -47,7 +49,7 @@ const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
|
47
49
|
|
|
48
50
|
const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators;
|
|
49
51
|
|
|
50
|
-
suite(`Create a workspace via launching a factory from the ${
|
|
52
|
+
suite(`Create a workspace via launching a factory from the ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository`, async function (): Promise<void> {
|
|
51
53
|
const oauthPage: OauthPage = new OauthPage(driverHelper);
|
|
52
54
|
|
|
53
55
|
let projectSection: ViewSection;
|
|
@@ -59,18 +61,18 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
59
61
|
const timeToRefresh: number = 1500;
|
|
60
62
|
const changesToCommit: string = (new Date()).getTime().toString();
|
|
61
63
|
const fileToChange: string = 'Date.txt';
|
|
62
|
-
const commitChangesButtonLabel: string = `Commit Changes on "${
|
|
64
|
+
const commitChangesButtonLabel: string = `Commit Changes on "${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
|
|
63
65
|
const refreshButtonLabel: string = 'Refresh';
|
|
64
66
|
const pushItemLabel: string = 'Push';
|
|
65
67
|
let testRepoProjectName: string;
|
|
66
68
|
|
|
67
69
|
loginTests.loginIntoChe();
|
|
68
70
|
test(`Navigate to the factory URL`, async function (): Promise<void> {
|
|
69
|
-
await browserTabsUtil.navigateTo(
|
|
71
|
+
await browserTabsUtil.navigateTo(FactoryTestConstants.TS_SELENIUM_FACTORY_URL());
|
|
70
72
|
});
|
|
71
73
|
|
|
72
|
-
if (
|
|
73
|
-
test(`Authorize with a ${
|
|
74
|
+
if (OAuthConstants.TS_SELENIUM_GIT_PROVIDER_OAUTH) {
|
|
75
|
+
test(`Authorize with a ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth`, async function (): Promise<void> {
|
|
74
76
|
await oauthPage.login();
|
|
75
77
|
await oauthPage.waitOauthPage();
|
|
76
78
|
await oauthPage.confirmAccess();
|
|
@@ -88,13 +90,13 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
88
90
|
});
|
|
89
91
|
|
|
90
92
|
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
91
|
-
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(
|
|
93
|
+
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL);
|
|
92
94
|
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
93
95
|
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
94
96
|
});
|
|
95
97
|
|
|
96
98
|
test('Check if the project files were imported', async function (): Promise<void> {
|
|
97
|
-
const label: string =
|
|
99
|
+
const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
98
100
|
Logger.debug(`projectSection.findItem: find ${label}`);
|
|
99
101
|
const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
|
|
100
102
|
expect(isFileImported).not.eqls(undefined);
|
|
@@ -167,7 +169,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
167
169
|
});
|
|
168
170
|
|
|
169
171
|
test('Push the changes', async function (): Promise<void> {
|
|
170
|
-
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${
|
|
172
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
|
|
171
173
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
172
174
|
Logger.debug(`scmProvider.openMoreActions`);
|
|
173
175
|
scmContextMenu = await scmProvider.openMoreActions();
|
|
@@ -192,7 +194,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
192
194
|
loginTests.logoutFromChe();
|
|
193
195
|
|
|
194
196
|
suiteTeardown('Close the browser', async function (): Promise<void> {
|
|
195
|
-
if (!
|
|
197
|
+
if (!BaseTestConstants.TS_DEBUG_MODE) {
|
|
196
198
|
await driverHelper.getDriver().close();
|
|
197
199
|
}
|
|
198
200
|
});
|
|
@@ -38,10 +38,12 @@ import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
|
38
38
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
39
39
|
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
40
40
|
import { Workspaces } from '../../pageobjects/dashboard/Workspaces';
|
|
41
|
-
import { GitProviderType, TestConstants } from '../../constants/TestConstants';
|
|
42
41
|
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
43
42
|
import { Logger } from '../../utils/Logger';
|
|
44
43
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
44
|
+
import { FactoryTestConstants, GitProviderType } from '../../constants/FactoryTestConstants';
|
|
45
|
+
import { OAuthConstants } from '../../constants/OAuthConstants';
|
|
46
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
45
47
|
|
|
46
48
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
47
49
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -52,7 +54,7 @@ const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
|
52
54
|
const workspaces: Workspaces = e2eContainer.get(CLASSES.Workspaces);
|
|
53
55
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
54
56
|
|
|
55
|
-
suite(`Create a workspace via launching a factory from the ${
|
|
57
|
+
suite(`Create a workspace via launching a factory from the ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository without OAuth setup`, async function (): Promise<void> {
|
|
56
58
|
|
|
57
59
|
let projectSection: ViewSection;
|
|
58
60
|
let scmProvider: SingleScmProvider;
|
|
@@ -65,11 +67,11 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
65
67
|
const changesToCommit: string = (new Date()).getTime().toString();
|
|
66
68
|
const fileToChange: string = 'Date.txt';
|
|
67
69
|
const pushItemLabel: string = 'Push';
|
|
68
|
-
const commitChangesButtonLabel: string = `Commit Changes on "${
|
|
70
|
+
const commitChangesButtonLabel: string = `Commit Changes on "${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
|
|
69
71
|
const refreshButtonLabel: string = 'Refresh';
|
|
70
|
-
const label: string =
|
|
72
|
+
const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
71
73
|
let testRepoProjectName: string;
|
|
72
|
-
const isPrivateRepo: string =
|
|
74
|
+
const isPrivateRepo: string = FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO ? 'private' : 'public';
|
|
73
75
|
|
|
74
76
|
loginTests.loginIntoChe();
|
|
75
77
|
|
|
@@ -80,10 +82,10 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
80
82
|
});
|
|
81
83
|
|
|
82
84
|
test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function (): Promise<void> {
|
|
83
|
-
await browserTabsUtil.navigateTo(
|
|
85
|
+
await browserTabsUtil.navigateTo(FactoryTestConstants.TS_SELENIUM_FACTORY_URL());
|
|
84
86
|
});
|
|
85
87
|
|
|
86
|
-
if (
|
|
88
|
+
if (FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
87
89
|
|
|
88
90
|
test(`Check that workspace cannot be created without OAuth for ${isPrivateRepo} repo`, async function (): Promise<void> {
|
|
89
91
|
await dashboard.waitLoader();
|
|
@@ -114,7 +116,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
114
116
|
});
|
|
115
117
|
|
|
116
118
|
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
117
|
-
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(
|
|
119
|
+
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL);
|
|
118
120
|
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
119
121
|
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
120
122
|
});
|
|
@@ -136,7 +138,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
136
138
|
await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
|
|
137
139
|
} catch (e) {
|
|
138
140
|
Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
|
|
139
|
-
if (!
|
|
141
|
+
if (!FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
140
142
|
throw new WebDriverError(e as string);
|
|
141
143
|
}
|
|
142
144
|
}
|
|
@@ -208,7 +210,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
208
210
|
});
|
|
209
211
|
|
|
210
212
|
test('Push the changes', async function (): Promise<void> {
|
|
211
|
-
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${
|
|
213
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
|
|
212
214
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
213
215
|
Logger.debug(`scmProvider.openMoreActions`);
|
|
214
216
|
scmContextMenu = await scmProvider.openMoreActions();
|
|
@@ -217,7 +219,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
217
219
|
await scmContextMenu.select(pushItemLabel);
|
|
218
220
|
});
|
|
219
221
|
|
|
220
|
-
if (
|
|
222
|
+
if (FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER === GitProviderType.GITHUB) {
|
|
221
223
|
test('Decline GitHub Extension', async function (): Promise<void> {
|
|
222
224
|
await driverHelper.waitVisibility(webCheCodeLocators.Dialog.details);
|
|
223
225
|
const gitHaExtensionDialog: ModalDialog = new ModalDialog();
|
|
@@ -235,11 +237,11 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
235
237
|
Known issue for github.com - https://issues.redhat.com/browse/CRW-4066`);
|
|
236
238
|
}
|
|
237
239
|
const input: InputBox = new InputBox();
|
|
238
|
-
await input.setText(
|
|
240
|
+
await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_USERNAME);
|
|
239
241
|
await driverHelper.wait(timeToRefresh);
|
|
240
242
|
await input.confirm();
|
|
241
243
|
await driverHelper.wait(timeToRefresh);
|
|
242
|
-
await input.setText(
|
|
244
|
+
await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_PASSWORD);
|
|
243
245
|
await input.confirm();
|
|
244
246
|
await driverHelper.wait(timeToRefresh);
|
|
245
247
|
});
|
|
@@ -265,7 +267,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
265
267
|
}
|
|
266
268
|
|
|
267
269
|
suiteTeardown('Close the browser', async function (): Promise<void> {
|
|
268
|
-
if (!
|
|
270
|
+
if (!BaseTestConstants.TS_DEBUG_MODE) {
|
|
269
271
|
await driverHelper.getDriver().close();
|
|
270
272
|
}
|
|
271
273
|
});
|
|
@@ -35,12 +35,14 @@ import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTes
|
|
|
35
35
|
import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader';
|
|
36
36
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
37
37
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
38
|
-
import { TestConstants } from '../../constants/TestConstants';
|
|
39
38
|
import { OauthPage } from '../../pageobjects/git-providers/OauthPage';
|
|
40
39
|
import { StringUtil } from '../../utils/StringUtil';
|
|
41
40
|
import { Logger } from '../../utils/Logger';
|
|
42
41
|
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
43
42
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
43
|
+
import { OAuthConstants } from '../../constants/OAuthConstants';
|
|
44
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
45
|
+
import { FactoryTestConstants } from '../../constants/FactoryTestConstants';
|
|
44
46
|
|
|
45
47
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
46
48
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -49,7 +51,7 @@ const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocato
|
|
|
49
51
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
50
52
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
51
53
|
|
|
52
|
-
suite(`Create a workspace via launching a factory from the ${
|
|
54
|
+
suite(`Create a workspace via launching a factory from the ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository and deny the access`, async function (): Promise<void> {
|
|
53
55
|
const oauthPage: OauthPage = new OauthPage(driverHelper);
|
|
54
56
|
|
|
55
57
|
let projectSection: ViewSection;
|
|
@@ -61,21 +63,21 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
61
63
|
const timeToRefresh: number = 1500;
|
|
62
64
|
const changesToCommit: string = (new Date()).getTime().toString();
|
|
63
65
|
const fileToChange: string = 'Date.txt';
|
|
64
|
-
const commitChangesButtonLabel: string = `Commit Changes on "${
|
|
66
|
+
const commitChangesButtonLabel: string = `Commit Changes on "${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
|
|
65
67
|
const refreshButtonLabel: string = 'Refresh';
|
|
66
68
|
const pushItemLabel: string = 'Push';
|
|
67
|
-
const label: string =
|
|
69
|
+
const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
68
70
|
let testRepoProjectName: string;
|
|
69
|
-
const isPrivateRepo: string =
|
|
71
|
+
const isPrivateRepo: string = FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO ? 'private' : 'public';
|
|
70
72
|
|
|
71
73
|
loginTests.loginIntoChe();
|
|
72
74
|
|
|
73
75
|
test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function (): Promise<void> {
|
|
74
|
-
await browserTabsUtil.navigateTo(
|
|
76
|
+
await browserTabsUtil.navigateTo(FactoryTestConstants.TS_SELENIUM_FACTORY_URL());
|
|
75
77
|
});
|
|
76
78
|
|
|
77
|
-
if (
|
|
78
|
-
test(`Authorize with a ${
|
|
79
|
+
if (FactoryTestConstants.TS_SELENIUM_GIT_PROVIDER_OAUTH) {
|
|
80
|
+
test(`Authorize with a ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth and deny access`, async function (): Promise<void> {
|
|
79
81
|
await oauthPage.login();
|
|
80
82
|
await oauthPage.waitOauthPage();
|
|
81
83
|
await oauthPage.denyAccess();
|
|
@@ -97,7 +99,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
97
99
|
});
|
|
98
100
|
|
|
99
101
|
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
100
|
-
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(
|
|
102
|
+
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL);
|
|
101
103
|
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
102
104
|
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
103
105
|
});
|
|
@@ -119,13 +121,13 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
119
121
|
await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
|
|
120
122
|
} catch (e) {
|
|
121
123
|
Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
|
|
122
|
-
if (!
|
|
124
|
+
if (!FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
123
125
|
throw new WebDriverError(e as string);
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
128
|
});
|
|
127
129
|
|
|
128
|
-
if (
|
|
130
|
+
if (FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
129
131
|
test('Check that project can not be cloned', async function (): Promise<void> {
|
|
130
132
|
await driverHelper.waitVisibility(webCheCodeLocators.Dialog.message);
|
|
131
133
|
const workspaceDoesNotExistDialog: ModalDialog = new ModalDialog();
|
|
@@ -205,7 +207,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
205
207
|
});
|
|
206
208
|
|
|
207
209
|
test('Push the changes', async function (): Promise<void> {
|
|
208
|
-
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${
|
|
210
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
|
|
209
211
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
210
212
|
Logger.debug(`scmProvider.openMoreActions`);
|
|
211
213
|
scmContextMenu = await scmProvider.openMoreActions();
|
|
@@ -224,10 +226,10 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
224
226
|
Known issue for github.com - https://issues.redhat.com/browse/CRW-4066`);
|
|
225
227
|
}
|
|
226
228
|
const input: InputBox = new InputBox();
|
|
227
|
-
await input.setText(
|
|
229
|
+
await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_USERNAME);
|
|
228
230
|
await input.confirm();
|
|
229
231
|
await driverHelper.wait(timeToRefresh);
|
|
230
|
-
await input.setText(
|
|
232
|
+
await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_PASSWORD);
|
|
231
233
|
await input.confirm();
|
|
232
234
|
await driverHelper.wait(timeToRefresh);
|
|
233
235
|
});
|
|
@@ -253,7 +255,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
253
255
|
loginTests.logoutFromChe();
|
|
254
256
|
|
|
255
257
|
suiteTeardown('Close the browser', async function (): Promise<void> {
|
|
256
|
-
if (!
|
|
258
|
+
if (!BaseTestConstants.TS_DEBUG_MODE) {
|
|
257
259
|
await driverHelper.getDriver().close();
|
|
258
260
|
}
|
|
259
261
|
});
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
import { CLASSES, TYPES } from '../configs/inversify.types';
|
|
12
12
|
import { ICheLoginPage } from '../pageobjects/login/interfaces/ICheLoginPage';
|
|
13
|
-
import { TestConstants } from '../constants/TestConstants';
|
|
14
13
|
import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
|
|
15
14
|
import { inject, injectable } from 'inversify';
|
|
16
15
|
import { Dashboard } from '../pageobjects/dashboard/Dashboard';
|
|
17
16
|
import { IOcpLoginPage } from '../pageobjects/login/interfaces/IOcpLoginPage';
|
|
17
|
+
import { BaseTestConstants } from '../constants/BaseTestConstants';
|
|
18
18
|
|
|
19
19
|
@injectable()
|
|
20
20
|
export class LoginTests {
|
|
@@ -27,8 +27,8 @@ export class LoginTests {
|
|
|
27
27
|
|
|
28
28
|
loginIntoChe(): void {
|
|
29
29
|
test('Login', async () => {
|
|
30
|
-
if (!(await this.browserTabsUtil.getCurrentUrl()).includes(
|
|
31
|
-
await this.browserTabsUtil.navigateTo(
|
|
30
|
+
if (!(await this.browserTabsUtil.getCurrentUrl()).includes(BaseTestConstants.TS_SELENIUM_BASE_URL)) {
|
|
31
|
+
await this.browserTabsUtil.navigateTo(BaseTestConstants.TS_SELENIUM_BASE_URL);
|
|
32
32
|
}
|
|
33
33
|
await this.productLoginPage.login();
|
|
34
34
|
await this.browserTabsUtil.maximize();
|
|
@@ -38,7 +38,7 @@ export class LoginTests {
|
|
|
38
38
|
|
|
39
39
|
loginIntoOcpConsole(): void {
|
|
40
40
|
test('Login into ocp console', async () => {
|
|
41
|
-
const openshiftConsoleUrl: string =
|
|
41
|
+
const openshiftConsoleUrl: string = BaseTestConstants.TS_SELENIUM_BASE_URL.replace('devspaces', 'console-openshift-console');
|
|
42
42
|
await this.browserTabsUtil.navigateTo(openshiftConsoleUrl);
|
|
43
43
|
await this.ocpLoginPage.login();
|
|
44
44
|
await this.browserTabsUtil.maximize();
|
|
@@ -20,7 +20,6 @@ import { ApiUrlResolver } from '../utils/workspace/ApiUrlResolver';
|
|
|
20
20
|
import { TimeoutConstants } from '../constants/TimeoutConstants';
|
|
21
21
|
import { DriverHelper } from '../utils/DriverHelper';
|
|
22
22
|
import { By, error } from 'selenium-webdriver';
|
|
23
|
-
import { TestConstants } from '../constants/TestConstants';
|
|
24
23
|
|
|
25
24
|
@injectable()
|
|
26
25
|
export class WorkspaceHandlingTests {
|
|
@@ -90,7 +89,7 @@ export class WorkspaceHandlingTests {
|
|
|
90
89
|
obtainWorkspaceNameFromStartingPage(): void {
|
|
91
90
|
test('Obtain workspace name from workspace loader page', async() => {
|
|
92
91
|
const timeout: number = TimeoutConstants.TS_IDE_LOAD_TIMEOUT;
|
|
93
|
-
const polling: number =
|
|
92
|
+
const polling: number = TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
94
93
|
const attempts: number = Math.ceil(timeout / polling);
|
|
95
94
|
|
|
96
95
|
for (let i: number = 0; i < attempts; i++) {
|
package/utils/BrowserTabsUtil.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { CLASSES } from '../configs/inversify.types';
|
|
|
13
13
|
import { DriverHelper } from './DriverHelper';
|
|
14
14
|
import { Logger } from './Logger';
|
|
15
15
|
import { TimeoutConstants } from '../constants/TimeoutConstants';
|
|
16
|
-
import {
|
|
16
|
+
import { ChromeDriverConstants } from '../constants/ChromeDriverConstants';
|
|
17
17
|
|
|
18
18
|
@injectable()
|
|
19
19
|
export class BrowserTabsUtil {
|
|
@@ -92,7 +92,7 @@ export class BrowserTabsUtil {
|
|
|
92
92
|
|
|
93
93
|
async maximize(): Promise<void> {
|
|
94
94
|
Logger.trace(`BrowserTabsUtil.maximize`);
|
|
95
|
-
if (
|
|
95
|
+
if (ChromeDriverConstants.TS_SELENIUM_LAUNCH_FULLSCREEN) {
|
|
96
96
|
Logger.debug(`TS_SELENIUM_LAUNCH_FULLSCREEN is set to true, maximizing window.`);
|
|
97
97
|
await this.driverHelper.getDriver().manage().window().maximize();
|
|
98
98
|
}
|