@eclipse-che/che-e2e 7.73.0-dev-11985ec → 7.73.0-dev-62c0c9d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configs/inversify.config.ts +6 -6
- package/configs/inversify.types.ts +27 -27
- package/configs/mocharc.ts +21 -21
- package/constants/APITestConstants.ts +39 -38
- package/constants/BaseTestConstants.ts +44 -43
- package/constants/ChromeDriverConstants.ts +29 -29
- package/constants/FactoryTestConstants.ts +30 -30
- package/constants/MonacoConstants.ts +10 -10
- package/constants/OAuthConstants.ts +46 -46
- package/constants/PluginsTestConstants.ts +1 -1
- package/constants/ReporterConstants.ts +28 -28
- package/constants/TimeoutConstants.ts +101 -101
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +1 -1
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/APITestConstants.js +2 -2
- package/dist/constants/APITestConstants.js.map +1 -1
- package/dist/constants/BaseTestConstants.js +1 -1
- package/dist/constants/BaseTestConstants.js.map +1 -1
- package/dist/constants/ChromeDriverConstants.js +1 -1
- package/dist/constants/ChromeDriverConstants.js.map +1 -1
- package/dist/constants/FactoryTestConstants.js +2 -2
- package/dist/constants/FactoryTestConstants.js.map +1 -1
- package/dist/constants/MonacoConstants.js +1 -1
- package/dist/constants/MonacoConstants.js.map +1 -1
- package/dist/constants/OAuthConstants.js +1 -1
- package/dist/constants/OAuthConstants.js.map +1 -1
- package/dist/constants/PluginsTestConstants.js +1 -1
- package/dist/constants/ReporterConstants.js +1 -1
- package/dist/constants/ReporterConstants.js.map +1 -1
- package/dist/constants/TimeoutConstants.js.map +1 -1
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +8 -8
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +11 -11
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +14 -14
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +8 -8
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +21 -21
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js +5 -5
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpLoginPage.js +10 -10
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +2 -2
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js +6 -6
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +2 -2
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpApplicationPage.js +2 -2
- package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js +5 -5
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js +11 -11
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
- package/dist/specs/MochaHooks.js +1 -1
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +7 -3
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +7 -5
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +9 -5
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +7 -3
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/{RecomendedExtentions.spec.js → RecommendedExtensions.spec.js} +7 -3
- package/dist/specs/dashboard-samples/{RecomendedExtentions.spec.js.map → RecommendedExtensions.spec.js.map} +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +3 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +3 -1
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +4 -2
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +4 -2
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +6 -2
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +3 -3
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +54 -74
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +10 -10
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +2 -2
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +7 -7
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +81 -81
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +38 -35
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +19 -10
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/ShellExecutor.js.map +1 -1
- package/dist/utils/StringUtil.js +2 -2
- package/dist/utils/StringUtil.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +13 -11
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/workspace/ApiUrlResolver.js +3 -3
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
- package/dist/utils/workspace/TestWorkspaceUtil.js +20 -16
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
- package/driver/ChromeDriver.ts +44 -44
- package/driver/IDriver.ts +1 -1
- package/package.json +1 -1
- package/pageobjects/dashboard/CreateWorkspace.ts +52 -52
- package/pageobjects/dashboard/Dashboard.ts +72 -72
- package/pageobjects/dashboard/Workspaces.ts +138 -139
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +92 -93
- package/pageobjects/git-providers/OauthPage.ts +136 -136
- package/pageobjects/ide/CheCodeLocatorLoader.ts +40 -40
- package/pageobjects/login/interfaces/ICheLoginPage.ts +1 -1
- package/pageobjects/login/interfaces/IOcpLoginPage.ts +1 -1
- package/pageobjects/login/kubernetes/DexLoginPage.ts +27 -27
- package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +11 -11
- package/pageobjects/login/openshift/OcpLoginPage.ts +50 -50
- package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +21 -21
- package/pageobjects/login/openshift/OcpUserLoginPage.ts +14 -14
- package/pageobjects/login/openshift/RedHatLoginPage.ts +44 -41
- package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +23 -23
- package/pageobjects/openshift/OcpApplicationPage.ts +16 -16
- package/pageobjects/openshift/OcpImportFromGitPage.ts +54 -54
- package/pageobjects/openshift/OcpMainPage.ts +64 -64
- package/specs/MochaHooks.ts +44 -44
- package/specs/SmokeTest.spec.ts +35 -31
- package/specs/api/ContainerOverridesAPI.spec.ts +23 -23
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +93 -91
- package/specs/api/EmptyWorkspaceAPI.spec.ts +50 -50
- package/specs/api/PodOverridesAPI.spec.ts +29 -29
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +29 -25
- package/specs/dashboard-samples/Quarkus.spec.ts +31 -27
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +205 -0
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +62 -64
- package/specs/factory/Factory.spec.ts +149 -147
- package/specs/factory/NoSetupRepoFactory.spec.ts +188 -186
- package/specs/factory/RefusedOAuthFactory.spec.ts +182 -180
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +52 -48
- package/tests-library/LoginTests.ts +29 -29
- package/tests-library/ProjectAndFileTests.ts +13 -13
- package/tests-library/WorkspaceHandlingTests.ts +84 -103
- package/utils/BrowserTabsUtil.ts +69 -69
- package/utils/CheReporter.ts +4 -6
- package/utils/DevWorkspaceConfigurationHelper.ts +58 -58
- package/utils/DevfilesRegistryHelper.ts +51 -51
- package/utils/DriverHelper.ts +599 -600
- package/utils/KubernetesCommandLineToolsExecutor.ts +166 -158
- package/utils/Logger.ts +98 -67
- package/utils/ScreenCatcher.ts +42 -42
- package/utils/ShellExecutor.ts +10 -10
- package/utils/StringUtil.ts +29 -30
- package/utils/request-handlers/CheApiRequestHandler.ts +84 -82
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +18 -18
- package/utils/request-handlers/headers/IAuthorizationHeaderHandler.ts +1 -1
- package/utils/workspace/ApiUrlResolver.ts +23 -23
- package/utils/workspace/ITestWorkspaceUtil.ts +29 -29
- package/utils/workspace/TestWorkspaceUtil.ts +120 -116
- package/utils/workspace/WorkspaceStatus.ts +3 -3
- package/specs/dashboard-samples/RecomendedExtentions.spec.ts +0 -201
|
@@ -7,68 +7,68 @@ import { DevfileContext } from '@eclipse-che/che-devworkspace-generator/lib/api/
|
|
|
7
7
|
import { APITestConstants } from '../../constants/APITestConstants';
|
|
8
8
|
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
9
9
|
|
|
10
|
-
suite(`Empty workspace API test`, async function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
suite(`Empty workspace API test`, async function(): Promise<void> {
|
|
11
|
+
// works only for root user
|
|
12
|
+
const namespace: string = APITestConstants.TS_API_TEST_NAMESPACE;
|
|
13
|
+
let clonedProjectName: string;
|
|
14
|
+
let containerWorkDir: string;
|
|
15
|
+
let devWorkspaceConfigurationHelper: DevWorkspaceConfigurationHelper;
|
|
16
|
+
let kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor;
|
|
17
|
+
let devfileContext: DevfileContext;
|
|
18
|
+
let devWorkspaceName: string | undefined;
|
|
19
|
+
let containerTerminal: KubernetesCommandLineToolsExecutor.ContainerTerminal;
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const gitRepository: string = 'https://github.com/crw-qe/web-nodejs-sample';
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
suiteSetup('Create empty workspace with OC client', async function(): Promise<void> {
|
|
24
|
+
const workspaceName: string = 'empty-' + Math.floor(Math.random() * 1000);
|
|
25
|
+
const devfileContent: string =
|
|
26
|
+
'schemaVersion: 2.2.0\n' +
|
|
27
|
+
'metadata:\n' +
|
|
28
|
+
` name: ${workspaceName}\n`;
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
devfileContext = await devWorkspaceConfigurationHelper.generateDevfileContext();
|
|
34
|
-
devWorkspaceName = devfileContext?.devWorkspace?.metadata?.name;
|
|
35
|
-
kubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(devWorkspaceName, namespace);
|
|
36
|
-
containerTerminal = new KubernetesCommandLineToolsExecutor.ContainerTerminal(kubernetesCommandLineToolsExecutor);
|
|
30
|
+
devWorkspaceConfigurationHelper = new DevWorkspaceConfigurationHelper({
|
|
31
|
+
devfileContent
|
|
37
32
|
});
|
|
33
|
+
devfileContext = await devWorkspaceConfigurationHelper.generateDevfileContext();
|
|
34
|
+
devWorkspaceName = devfileContext?.devWorkspace?.metadata?.name;
|
|
35
|
+
kubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(devWorkspaceName, namespace);
|
|
36
|
+
containerTerminal = new KubernetesCommandLineToolsExecutor.ContainerTerminal(kubernetesCommandLineToolsExecutor);
|
|
37
|
+
});
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
suite('Clone public repo without previous setup', function (): void {
|
|
39
|
+
test('Create empty workspace', async function(): Promise<void> {
|
|
40
|
+
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
41
|
+
const devWorkspaceConfigurationYamlString: string = await devWorkspaceConfigurationHelper.getDevWorkspaceConfigurationYamlAsString(devfileContext);
|
|
42
|
+
const output: ShellString = kubernetesCommandLineToolsExecutor.applyAndWaitDevWorkspace(devWorkspaceConfigurationYamlString);
|
|
43
|
+
expect(output.stdout).contains('condition met');
|
|
44
|
+
});
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
containerWorkDir = containerTerminal.pwd().stdout.replace('\n', '');
|
|
50
|
-
const cloneOutput: ShellString = containerTerminal.gitClone(gitRepository);
|
|
51
|
-
expect(cloneOutput.stdout + cloneOutput.stderr).includes('Cloning');
|
|
52
|
-
});
|
|
46
|
+
suite('Clone public repo without previous setup', function(): void {
|
|
53
47
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
test('Check if public repo can be cloned', function(): void {
|
|
49
|
+
containerWorkDir = containerTerminal.pwd().stdout.replace('\n', '');
|
|
50
|
+
const cloneOutput: ShellString = containerTerminal.gitClone(gitRepository);
|
|
51
|
+
expect(cloneOutput.stdout + cloneOutput.stderr).includes('Cloning');
|
|
52
|
+
});
|
|
58
53
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
test('Check if project was created', function(): void {
|
|
55
|
+
clonedProjectName = StringUtil.getProjectNameFromGitUrl(gitRepository);
|
|
56
|
+
expect(containerTerminal.ls().stdout).includes(clonedProjectName);
|
|
57
|
+
});
|
|
63
58
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
test('Check if project files are imported', function(): void {
|
|
60
|
+
expect(containerTerminal.ls(`${containerWorkDir}/${clonedProjectName}`).stdout)
|
|
61
|
+
.includes(BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME);
|
|
67
62
|
});
|
|
68
63
|
|
|
69
|
-
suiteTeardown('Delete
|
|
70
|
-
|
|
64
|
+
suiteTeardown('Delete cloned project', function(): void {
|
|
65
|
+
containerTerminal.removeFolder(`${clonedProjectName}`);
|
|
71
66
|
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
suiteTeardown('Delete workspace', function(): void {
|
|
70
|
+
kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
|
|
71
|
+
});
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
|
|
@@ -5,40 +5,40 @@ import YAML from 'yaml';
|
|
|
5
5
|
import { expect } from 'chai';
|
|
6
6
|
import { ShellExecutor } from '../../utils/ShellExecutor';
|
|
7
7
|
|
|
8
|
-
suite(`Test defining pod overrides via attribute.`, async function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
suite(`Test defining pod overrides via attribute.`, async function(): Promise<void> {
|
|
9
|
+
const pathToSampleFile: string = path.resolve('resources/pod-overrides.yaml');
|
|
10
|
+
const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name;
|
|
11
|
+
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(workspaceName);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
suiteSetup('Login into OC client', function(): void {
|
|
14
|
+
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
15
|
+
});
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
suiteTeardown('Delete DevWorkspace', function(): void {
|
|
18
|
+
kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
|
|
19
|
+
});
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
test('Apply pod-overrides sample as DevWorkspace with OC client', function(): void {
|
|
22
|
+
kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsFile(pathToSampleFile);
|
|
23
|
+
ShellExecutor.wait(5);
|
|
24
|
+
});
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
26
|
+
test('Check that fields are overridden in the Deployment for DevWorkspace', function(): void {
|
|
27
|
+
const devWorkspaceFullYamlOutput: any = YAML.parse(kubernetesCommandLineToolsExecutor.getDevWorkspaceYamlConfiguration());
|
|
28
|
+
expect(devWorkspaceFullYamlOutput.spec.template.attributes['pod-overrides']).eqls({
|
|
29
|
+
metadata: {
|
|
30
|
+
annotations: {
|
|
31
|
+
'io.kubernetes.cri-o.userns-mode': 'auto:size=65536;map-to-root=true',
|
|
32
|
+
'io.openshift.userns': 'true',
|
|
33
|
+
'openshift.io/scc': 'container-build'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
spec: {
|
|
37
|
+
runtimeClassName: 'kata',
|
|
38
|
+
schedulerName: 'stork'
|
|
39
|
+
}
|
|
41
40
|
});
|
|
41
|
+
});
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
|
|
@@ -24,38 +24,42 @@ const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUti
|
|
|
24
24
|
|
|
25
25
|
const stackName: string = 'Empty Workspace';
|
|
26
26
|
|
|
27
|
-
suite(`${stackName} test`, async ()
|
|
28
|
-
|
|
27
|
+
suite(`${stackName} test`, async function(): Promise<void> {
|
|
28
|
+
loginTests.loginIntoChe();
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
test(`Create and open new workspace, stack:${stackName}`, async function(): Promise<void> {
|
|
31
|
+
await workspaceHandlingTests.createAndOpenWorkspace(stackName);
|
|
32
|
+
});
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
test('Obtain workspace name from workspace loader page', async function(): Promise<void> {
|
|
35
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
36
|
+
});
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
test('Register running workspace', async function(): Promise<void> {
|
|
39
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
40
|
+
});
|
|
37
41
|
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
test('Wait workspace readiness', async function(): Promise<void> {
|
|
43
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
const workbench: Workbench = new Workbench();
|
|
46
|
+
const activityBar: ActivityBar = workbench.getActivityBar();
|
|
47
|
+
const activityBarControls: ViewControl[] = await activityBar.getViewControls();
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
Logger.debug(`Editor sections:`);
|
|
50
|
+
for (const control of activityBarControls) {
|
|
51
|
+
Logger.debug(`${await control.getTitle()}`);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
test('Stop the workspace', async function(): Promise<void> {
|
|
56
|
+
await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
57
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
58
|
+
});
|
|
55
59
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
test('Delete the workspace', async function(): Promise<void> {
|
|
61
|
+
await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
62
|
+
});
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
loginTests.logoutFromChe();
|
|
61
65
|
});
|
|
@@ -27,40 +27,44 @@ const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUti
|
|
|
27
27
|
const stackName: string = 'Java 11 with Quarkus';
|
|
28
28
|
const projectName: string = 'quarkus-quickstarts';
|
|
29
29
|
|
|
30
|
-
suite(`The ${stackName} userstory`, async function
|
|
31
|
-
|
|
30
|
+
suite(`The ${stackName} userstory`, async function(): Promise<void> {
|
|
31
|
+
let projectSection: ViewSection;
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
loginTests.loginIntoChe();
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
test(`Create and open new workspace, stack:${stackName}`, async function(): Promise<void> {
|
|
36
|
+
await workspaceHandlingTests.createAndOpenWorkspace(stackName);
|
|
37
|
+
});
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
test('Obtain workspace name from workspace loader page', async function(): Promise<void> {
|
|
40
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
41
|
+
});
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
test('Register running workspace', async function(): Promise<void> {
|
|
44
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
45
|
+
});
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
test('Wait workspace readiness', async function(): Promise<void> {
|
|
48
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
49
|
+
});
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
test('Check a project folder has been created', async function(): Promise<void> {
|
|
52
|
+
projectSection = await new SideBarView().getContent().getSection(projectName);
|
|
53
|
+
Logger.debug(`new SideBarView().getContent().getSection: get ${projectName}`);
|
|
54
|
+
});
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
test('Check the project files was imported', async function(): Promise<void> {
|
|
57
|
+
await projectSection.findItem(BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME);
|
|
58
|
+
Logger.debug(`projectSection.findItem: find ${BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME}`);
|
|
59
|
+
});
|
|
56
60
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
test('Stop the workspace', async function(): Promise<void> {
|
|
62
|
+
await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
63
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
64
|
+
});
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
test('Delete the workspace', async function(): Promise<void> {
|
|
67
|
+
await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
68
|
+
});
|
|
69
|
+
loginTests.logoutFromChe();
|
|
66
70
|
});
|
|
@@ -0,0 +1,205 @@
|
|
|
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
|
+
|
|
11
|
+
import {
|
|
12
|
+
ActivityBar,
|
|
13
|
+
ContextMenu,
|
|
14
|
+
ContextMenuItem,
|
|
15
|
+
EditorView,
|
|
16
|
+
ExtensionsViewItem,
|
|
17
|
+
ExtensionsViewSection,
|
|
18
|
+
Locators,
|
|
19
|
+
ModalDialog,
|
|
20
|
+
SideBarView,
|
|
21
|
+
TextEditor,
|
|
22
|
+
ViewItem,
|
|
23
|
+
ViewSection
|
|
24
|
+
} from 'monaco-page-objects';
|
|
25
|
+
import { registerRunningWorkspace } from '../MochaHooks';
|
|
26
|
+
import { LoginTests } from '../../tests-library/LoginTests';
|
|
27
|
+
import { e2eContainer } from '../../configs/inversify.config';
|
|
28
|
+
import { CLASSES } from '../../configs/inversify.types';
|
|
29
|
+
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
30
|
+
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
31
|
+
import { Logger } from '../../utils/Logger';
|
|
32
|
+
import { DriverHelper } from '../../utils/DriverHelper';
|
|
33
|
+
import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader';
|
|
34
|
+
import { expect } from 'chai';
|
|
35
|
+
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
36
|
+
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
37
|
+
import { PluginsTestConstants } from '../../constants/PluginsTestConstants';
|
|
38
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
39
|
+
|
|
40
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
41
|
+
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
42
|
+
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
43
|
+
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
44
|
+
|
|
45
|
+
const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators;
|
|
46
|
+
const samples: string[] = PluginsTestConstants.TS_SAMPLE_LIST.split(',');
|
|
47
|
+
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
48
|
+
|
|
49
|
+
suite(`Check if recommended extensions installed for ${samples}`, async function(): Promise<void> {
|
|
50
|
+
let projectSection: ViewSection;
|
|
51
|
+
let extensionsView: SideBarView | undefined;
|
|
52
|
+
let extensionSection: ExtensionsViewSection;
|
|
53
|
+
|
|
54
|
+
const extensionsListFileName: string = 'extensions.json';
|
|
55
|
+
let recommendedExtensions: any = {
|
|
56
|
+
recommendations: []
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
loginTests.loginIntoChe();
|
|
60
|
+
|
|
61
|
+
for (const sample of samples) {
|
|
62
|
+
test(`Create and open new workspace, stack:${sample}`, async function(): Promise<void> {
|
|
63
|
+
await workspaceHandlingTests.createAndOpenWorkspace(sample);
|
|
64
|
+
});
|
|
65
|
+
test('Obtain workspace name from workspace loader page', async function(): Promise<void> {
|
|
66
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('Registering the running workspace', async function(): Promise<void> {
|
|
70
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test('Wait workspace readiness', async function(): Promise<void> {
|
|
74
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('Wait until the project will be imported and accept it as trusted one', async function(): Promise<void> {
|
|
78
|
+
[projectSection] = await new SideBarView().getContent().getSections();
|
|
79
|
+
const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
80
|
+
Logger.debug(`projectSection.findItem: find ${label}`);
|
|
81
|
+
const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
|
|
82
|
+
expect(isFileImported).not.eqls(undefined);
|
|
83
|
+
try {
|
|
84
|
+
const buttonYesITrustTheAuthors: string = `Yes, I trust the authors`;
|
|
85
|
+
await driverHelper.waitVisibility(webCheCodeLocators.WelcomeContent.button, TimeoutConstants.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT);
|
|
86
|
+
const trustedProjectDialog: ModalDialog = new ModalDialog();
|
|
87
|
+
Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
|
|
88
|
+
await trustedProjectDialog.pushButton(buttonYesITrustTheAuthors);
|
|
89
|
+
} catch (e) {
|
|
90
|
+
Logger.debug(`Welcome modal dialog was not shown: ${e}`);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test(`Get recommended extensions list from ${extensionsListFileName}`, async function(): Promise<void> {
|
|
95
|
+
Logger.debug(`projectSection.findItem(item))?.select(): expand .vscode folder and open extensions.json.`);
|
|
96
|
+
await (await projectSection.findItem('.vscode'))?.select();
|
|
97
|
+
// time to expand project tree
|
|
98
|
+
await driverHelper.wait(TimeoutConstants.TS_EXPAND_PROJECT_TREE_ITEM_TIMEOUT);
|
|
99
|
+
await (await projectSection.findItem(extensionsListFileName))?.select();
|
|
100
|
+
Logger.debug(`EditorView().openEditor(${extensionsListFileName})`);
|
|
101
|
+
const editor: TextEditor = await new EditorView().openEditor(extensionsListFileName) as TextEditor;
|
|
102
|
+
await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea);
|
|
103
|
+
Logger.debug(`editor.getText(): get recommended extensions as text from editor, delete comments and parse to object.`);
|
|
104
|
+
recommendedExtensions = JSON.parse((await editor.getText()).replace(/\/\*[\s\S]*?\*\/|(?<=[^:])\/\/.*|^\/\/.*/g, '').trim());
|
|
105
|
+
Logger.debug(`recommendedExtensions.recommendations: Get recommendations clear names using map().`);
|
|
106
|
+
recommendedExtensions.recommendations = recommendedExtensions.recommendations.map((r: { split: (arg: string) => [any, any]; }) => {
|
|
107
|
+
const [publisher, name] = r.split('.');
|
|
108
|
+
return { publisher, name };
|
|
109
|
+
});
|
|
110
|
+
Logger.info(`Recommended extension for this workspace:\n${JSON.stringify(recommendedExtensions.recommendations)}.`);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
test(`Open "Extensions" view section`, async function(): Promise<void> {
|
|
114
|
+
Logger.debug(`ActivityBar().getViewControl('Extensions'))?.openView(): open Extensions view.`);
|
|
115
|
+
extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test(`Let extensions complete installation`, async function(): Promise<void> {
|
|
119
|
+
Logger.info(`Time for extensions installation TimeoutConstants.TS_COMMON_PLUGIN_TEST_TIMEOUT=${TimeoutConstants.TS_COMMON_PLUGIN_TEST_TIMEOUT}`);
|
|
120
|
+
await driverHelper.wait(TimeoutConstants.TS_COMMON_PLUGIN_TEST_TIMEOUT);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
test(`Check if extensions are installed and enabled`, async function(): Promise<void> {
|
|
124
|
+
this.retries(10);
|
|
125
|
+
Logger.debug(`ActivityBar().getViewControl('Extensions'))?.openView(): open Extensions view.`);
|
|
126
|
+
extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
|
|
127
|
+
|
|
128
|
+
Logger.debug(`extensionsView?.getContent().getSections(): get current section.`);
|
|
129
|
+
[extensionSection] = await extensionsView?.getContent().getSections() as ExtensionsViewSection[];
|
|
130
|
+
await driverHelper.waitAllPresence(webCheCodeLocators.ExtensionsViewSection.itemTitle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT);
|
|
131
|
+
|
|
132
|
+
for (const extension of recommendedExtensions.recommendations) {
|
|
133
|
+
Logger.info(`Check if ${JSON.stringify(extension)} are installed.`);
|
|
134
|
+
|
|
135
|
+
Logger.debug(`extensionSection.findItem(${extension.name}).`);
|
|
136
|
+
await extensionSection.findItem(extension.name);
|
|
137
|
+
|
|
138
|
+
// check if extension require reload the page
|
|
139
|
+
if (await driverHelper.isVisible((webCheCodeLocators.ExtensionsViewSection as any).requireReloadButton)) {
|
|
140
|
+
Logger.debug(`Extension require reload the editor. Refreshing the page..`);
|
|
141
|
+
await browserTabsUtil.refreshPage();
|
|
142
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
143
|
+
Logger.debug(`ActivityBar().getViewControl('Extensions'))?.openView(): open Extensions view.`);
|
|
144
|
+
extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
|
|
145
|
+
Logger.debug(`extensionsView?.getContent().getSections(): get current section.`);
|
|
146
|
+
[extensionSection] = await extensionsView?.getContent().getSections() as ExtensionsViewSection[];
|
|
147
|
+
await driverHelper.waitAllPresence(webCheCodeLocators.ExtensionsViewSection.itemTitle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT);
|
|
148
|
+
Logger.debug(`extensionSection.findItem(${extension.name}).`);
|
|
149
|
+
await extensionSection.findItem(extension.name);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
Logger.debug(`extensionsView?.getContent().getSections(): switch to marketplace section.`);
|
|
153
|
+
const [marketplaceSection]: ExtensionsViewSection[] = await extensionsView?.getContent().getSections() as ExtensionsViewSection[];
|
|
154
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ExtensionsViewSection.items, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT);
|
|
155
|
+
|
|
156
|
+
Logger.debug(`marketplaceSection.getVisibleItems(): get all found items.`);
|
|
157
|
+
const allFinedItems: ExtensionsViewItem[] = await marketplaceSection.getVisibleItems();
|
|
158
|
+
|
|
159
|
+
let itemWithRightNameAndPublisher: ExtensionsViewItem | undefined;
|
|
160
|
+
for (const item of allFinedItems) {
|
|
161
|
+
Logger.debug(`Try to find extension published by ${extension.publisher}.`);
|
|
162
|
+
if (await item.getAuthor() === extension.publisher) {
|
|
163
|
+
itemWithRightNameAndPublisher = item;
|
|
164
|
+
Logger.debug(`Extension was found: ${await itemWithRightNameAndPublisher?.getTitle()}`);
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
if (itemWithRightNameAndPublisher === undefined) {
|
|
168
|
+
Logger.error(`Extension with publisher as ${extension.publisher} was not found.`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
Logger.debug(`itemWithRightNameAndPublisher?.isInstalled()`);
|
|
173
|
+
const isInstalled: boolean = await itemWithRightNameAndPublisher?.isInstalled() as boolean;
|
|
174
|
+
|
|
175
|
+
Logger.debug(`itemWithRightNameAndPublisher?.isInstalled(): ${isInstalled}.`);
|
|
176
|
+
expect(isInstalled).eqls(true);
|
|
177
|
+
|
|
178
|
+
Logger.debug(`itemWithRightNameAndPublisher.manage(): get context menu.`);
|
|
179
|
+
const extensionManageMenu: ContextMenu = await (itemWithRightNameAndPublisher as ExtensionsViewItem).manage();
|
|
180
|
+
|
|
181
|
+
Logger.debug(`extensionManageMenu.getItems(): get menu items.`);
|
|
182
|
+
const extensionMenuItems: ContextMenuItem[] = await extensionManageMenu.getItems();
|
|
183
|
+
let extensionMenuItemLabels: string = '';
|
|
184
|
+
for (const item of extensionMenuItems) {
|
|
185
|
+
Logger.trace(`extensionMenuItems -> item.getLabel(): get menu items names.`);
|
|
186
|
+
extensionMenuItemLabels += (await item.getLabel()) + ' ';
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
Logger.debug(`extensionMenuItemLabels: ${extensionMenuItemLabels}.`);
|
|
190
|
+
expect(extensionMenuItemLabels).contains('Disable').and.not.contains('Enable');
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
test('Stop the workspace', async function(): Promise<void> {
|
|
195
|
+
await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
196
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
test('Delete the workspace', async function(): Promise<void> {
|
|
200
|
+
await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
loginTests.logoutFromChe();
|
|
205
|
+
});
|