From 2dffe945191d1c08473602933b664a0042177563 Mon Sep 17 00:00:00 2001 From: Anna Shumilova Date: Mon, 3 Jun 2019 16:33:49 +0300 Subject: [PATCH 1/5] Create workspace from devfile Signed-off-by: Anna Shumilova --- .../create-workspace.controller.ts | 98 ++++------------ .../create-workspace/create-workspace.html | 17 +-- .../create-workspace.service.ts | 19 +++- .../devfile-selector.controller.ts | 64 +++++++++++ .../devfile-selector.directive.ts | 42 +++++++ .../devfile-selector/devfile-selector.html | 66 +++++++++++ .../devfile-selector/devfile-selector.styl | 106 ++++++++++++++++++ .../workspace-editors.controller.ts | 1 - .../src/app/workspaces/workspaces-config.ts | 4 + .../src/components/api/che-api-config.ts | 2 + .../api/devfile-registry.factory.ts | 72 ++++++++++++ .../api/workspace/che-workspace.factory.ts | 16 ++- .../api/workspace/workspace-data-manager.ts | 1 + dashboard/src/components/typings/che.d.ts | 1 + 14 files changed, 406 insertions(+), 103 deletions(-) create mode 100644 dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.controller.ts create mode 100644 dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.directive.ts create mode 100644 dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html create mode 100644 dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.styl create mode 100644 dashboard/src/components/api/devfile-registry.factory.ts diff --git a/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts b/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts index 041f7f64f7e..99415db7ecc 100644 --- a/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts +++ b/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts @@ -23,6 +23,7 @@ import { ICheButtonDropdownMainAction, ICheButtonDropdownOtherAction } from '../../../components/widget/button-dropdown/che-button-dropdown.directive'; +import {DevfileRegistry} from '../../../components/api/devfile-registry.factory'; /** * This class is handling the controller for workspace creation. @@ -31,8 +32,8 @@ import { */ export class CreateWorkspaceController { - static $inject = ['$mdDialog', '$timeout', 'cheEnvironmentRegistry', 'createWorkspaceSvc', 'namespaceSelectorSvc', 'stackSelectorSvc', - 'randomSvc', '$log', 'cheNotification']; + static $inject = ['$mdDialog', '$timeout', 'cheEnvironmentRegistry', 'createWorkspaceSvc', 'namespaceSelectorSvc', + 'randomSvc', '$log', 'cheNotification', 'devfileRegistry']; /** * Dropdown button config. @@ -58,10 +59,6 @@ export class CreateWorkspaceController { * Namespace selector service. */ private namespaceSelectorSvc: NamespaceSelectorSvc; - /** - * Stack selector service. - */ - private stackSelectorSvc: StackSelectorSvc; /** * Generator for random strings. */ @@ -75,29 +72,21 @@ export class CreateWorkspaceController { */ private cheNotification: CheNotification; /** - * The environment manager. + * Devfile registry. */ - private environmentManager: EnvironmentManager; + private devfileRegistry: DevfileRegistry; /** - * The selected stack. + * The environment manager. */ - private stack: che.IStack; + private environmentManager: EnvironmentManager; /** - * The workspace config of the current stack. + * The selected devfile. */ - private workspaceConfig: che.IWorkspaceConfig; + private selectedDevfile: che.IWorkspaceDevfile; /** * The selected namespace ID. */ private namespaceId: string; - /** - * The list of machines of selected stack. - */ - private stackMachines: Array; - /** - * Desired memory limit by machine name. - */ - private memoryByMachine: {[name: string]: number}; /** * The map of forms. */ @@ -122,23 +111,21 @@ export class CreateWorkspaceController { cheEnvironmentRegistry: CheEnvironmentRegistry, createWorkspaceSvc: CreateWorkspaceSvc, namespaceSelectorSvc: NamespaceSelectorSvc, - stackSelectorSvc: StackSelectorSvc, randomSvc: RandomSvc, $log: ng.ILogService, - cheNotification: CheNotification) { + cheNotification: CheNotification, + devfileRegistry: DevfileRegistry) { this.$mdDialog = $mdDialog; this.$timeout = $timeout; this.cheEnvironmentRegistry = cheEnvironmentRegistry; this.createWorkspaceSvc = createWorkspaceSvc; this.namespaceSelectorSvc = namespaceSelectorSvc; - this.stackSelectorSvc = stackSelectorSvc; this.randomSvc = randomSvc; this.$log = $log; this.cheNotification = cheNotification; + this.devfileRegistry = devfileRegistry; this.usedNamesList = []; - this.stackMachines = []; - this.memoryByMachine = {}; this.forms = new Map(); this.namespaceId = this.namespaceSelectorSvc.getNamespaceId(); @@ -150,7 +137,8 @@ export class CreateWorkspaceController { // loader should be hidden and page content shown // when stacks selector is rendered // and default stack is selected - this.hideLoader = false; + //TODO + this.hideLoader = true; // header toolbar // dropdown button config @@ -182,43 +170,12 @@ export class CreateWorkspaceController { * * @param {string} stackId the stack ID */ - onStackSelected(stackId: string): void { + onDevfileSelected(devfile: che.IWorkspaceDevfile): void { // tiny timeout for templates selector to be rendered this.$timeout(() => { this.hideLoader = true; }, 10); - - this.stack = this.stackSelectorSvc.getStackById(stackId); - this.workspaceConfig = angular.copy(this.stack.workspaceConfig); - - if (!this.stack.workspaceConfig || !this.stack.workspaceConfig.defaultEnv) { - this.memoryByMachine = {}; - this.stackMachines = []; - return; - } - - const environmentName = this.stack.workspaceConfig.defaultEnv; - const environment = this.stack.workspaceConfig.environments[environmentName]; - const recipeType = environment.recipe.type; - this.environmentManager = this.cheEnvironmentRegistry.getEnvironmentManager(recipeType); - if (!this.environmentManager) { - const errorMessage = `Unsupported recipe type '${recipeType}'`; - this.$log.error(errorMessage); - this.cheNotification.showError(errorMessage); - return; - } - this.memoryByMachine = {}; - this.stackMachines = this.environmentManager.getMachines(environment); - } - - /** - * Callback which is called when machine's memory limit is changes. - * - * @param {string} name a machine name - * @param {number} memoryLimitBytes a machine's memory limit in bytes - */ - onRamChanged(name: string, memoryLimitBytes: number): void { - this.memoryByMachine[name] = memoryLimitBytes; + this.selectedDevfile = devfile } /** @@ -267,7 +224,7 @@ export class CreateWorkspaceController { * @return {boolean} */ isCreateButtonDisabled(): boolean { - if (!this.namespaceId || (this.stack && !this.stack.workspaceConfig)) { + if (!this.namespaceId || !this.selectedDevfile) { return true; } @@ -312,7 +269,7 @@ export class CreateWorkspaceController { this.usedNamesList = workspaces.filter((workspace: che.IWorkspace) => { return workspace.namespace === this.namespaceId; }).map((workspace: che.IWorkspace) => { - return workspace.config.name; + return this.createWorkspaceSvc.getWorkspaceName(workspace); }); }); } @@ -342,23 +299,8 @@ export class CreateWorkspaceController { */ createWorkspace(): ng.IPromise { // update workspace name - this.workspaceConfig.name = this.workspaceName; - - // update memory limits of machines - if (Object.keys(this.memoryByMachine).length !== 0) { - this.stackMachines.forEach((machine: IEnvironmentManagerMachine) => { - if (this.memoryByMachine[machine.name]) { - this.environmentManager.setMemoryLimit(machine, this.memoryByMachine[machine.name]); - } - }); - const environmentName = this.workspaceConfig.defaultEnv; - const environment = this.workspaceConfig.environments[environmentName]; - const newEnvironment = this.environmentManager.getEnvironment(environment, this.stackMachines); - this.workspaceConfig.environments[environmentName] = newEnvironment; - } - let attributes = {stackId: this.stack.id}; - - return this.createWorkspaceSvc.createWorkspaceFromConfig(this.workspaceConfig, attributes); + this.selectedDevfile.name = this.workspaceName; + return this.createWorkspaceSvc.createWorkspaceFromDevfile(this.selectedDevfile, null); } /** diff --git a/dashboard/src/app/workspaces/create-workspace/create-workspace.html b/dashboard/src/app/workspaces/create-workspace/create-workspace.html index f967b5432ea..34083aa6168 100644 --- a/dashboard/src/app/workspaces/create-workspace/create-workspace.html +++ b/dashboard/src/app/workspaces/create-workspace/create-workspace.html @@ -51,22 +51,11 @@ on-namespace-change="createWorkspaceController.onNamespaceChanged(namespaceId)"> - - - - - - - - - - + + + diff --git a/dashboard/src/app/workspaces/create-workspace/create-workspace.service.ts b/dashboard/src/app/workspaces/create-workspace/create-workspace.service.ts index 3673ff17f47..25d7fddde28 100644 --- a/dashboard/src/app/workspaces/create-workspace/create-workspace.service.ts +++ b/dashboard/src/app/workspaces/create-workspace/create-workspace.service.ts @@ -189,7 +189,7 @@ export class CreateWorkspaceSvc { }); } - /*createWorkspaceFromDevfile(workspaceDevfile: che.IWorkspaceDevfile, attributes: any): ng.IPromise { + createWorkspaceFromDevfile(workspaceDevfile: che.IWorkspaceDevfile, attributes: any): ng.IPromise { const namespaceId = this.namespaceSelectorSvc.getNamespaceId(), projectTemplates = this.projectSourceSelectorService.getProjectTemplates(); @@ -220,7 +220,7 @@ export class CreateWorkspaceSvc { return this.$q.reject(error); }); }); - }*/ + } /** * Show confirmation dialog when project editing is not completed. @@ -244,7 +244,8 @@ export class CreateWorkspaceSvc { * @param {che.IWorkspace} workspace the workspace to open in IDE */ redirectToIDE(workspace: che.IWorkspace): void { - const path = `/ide/${workspace.namespace}/${workspace.config.name}`; + let name = this.cheWorkspace.getWorkspaceDataManager().getName(workspace); + const path = `/ide/${workspace.namespace}/${name}`; this.$location.path(path); } @@ -254,7 +255,8 @@ export class CreateWorkspaceSvc { * @param {che.IWorkspace} workspace the workspace to open in IDE */ redirectToDetails(workspace: che.IWorkspace): void { - const path = `/workspace/${workspace.namespace}/${workspace.config.name}`; + let name = this.cheWorkspace.getWorkspaceDataManager().getName(workspace); + const path = `/workspace/${workspace.namespace}/${name}`; this.$location.path(path); } @@ -273,4 +275,13 @@ export class CreateWorkspaceSvc { }); }); } + + /** + * Returns name of the pointed workspace. + * + * @param workspace workspace + */ + getWorkspaceName(workspace: che.IWorkspace): string { + return this.cheWorkspace.getWorkspaceDataManager().getName(workspace); + } } diff --git a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.controller.ts b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.controller.ts new file mode 100644 index 00000000000..f8a54582722 --- /dev/null +++ b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.controller.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2015-2018 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +'use strict'; +import {CheWorkspace} from '../../../../components/api/workspace/che-workspace.factory'; +import {DevfileRegistry, IDevfileMetaData} from '../../../../components/api/devfile-registry.factory'; + +/** + * @description This class is handling the controller of devfile selector. + * @author Ann Shumilova + */ +export class DevfileSelectorController { + + static $inject = ['devfileRegistry', 'cheWorkspace']; + + private devfileRegistry: DevfileRegistry; + private cheWorkspace: CheWorkspace; + private devfiles: Array; + onDevfileSelect: Function; + selectedDevfile: any; + + /** + * Default constructor that is using resource injection + */ + constructor(devfileRegistry: DevfileRegistry, cheWorkspace: CheWorkspace) { + this.devfileRegistry = devfileRegistry; + this.cheWorkspace = cheWorkspace; + this.loadDevfiles(); + } + + loadDevfiles(): void { + let location = this.cheWorkspace.getWorkspaceSettings().devfileRegistry; + this.devfileRegistry.fetchDevfiles(location).then((data: Array) => { + this.devfiles = data; + + if (this.devfiles && this.devfiles.length > 0) { + this.devfileOnClick(this.devfiles[0]); + } + }); + } + + devfileOnClick(devfile: any): void { + this.selectedDevfile = devfile; + + let location = this.cheWorkspace.getWorkspaceSettings().devfileRegistry; + + let devfileContent = this.devfileRegistry.getDevfile(location, devfile.links.self); + if (devfileContent) { + this.onDevfileSelect({devfile: devfileContent}); + } else { + this.devfileRegistry.fetchDevfile(location, devfile.links.self).then((devfileContent: che.IWorkspaceDevfile) => { + this.onDevfileSelect({devfile: devfileContent}); + }); + } + } +} diff --git a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.directive.ts b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.directive.ts new file mode 100644 index 00000000000..2feb4beba35 --- /dev/null +++ b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.directive.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2015-2018 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +'use strict'; + +/** + * Defines a directive for displaying devfile selector widget. + * + * @author Ann Shumilova + */ +export class DevfileSelector implements ng.IDirective { + restrict: string = 'E'; + templateUrl: string = 'app/workspaces/create-workspace/devfile-selector/devfile-selector.html'; + replace: boolean = true; + + controller: string = 'DevfileSelectorController'; + controllerAs: string = 'devfileSelectorController'; + + bindToController: boolean = true; + + scope: { + [propName: string]: string + }; + + /** + * Default constructor that is using resource + */ + constructor() { + this.scope = { + devfileIdSelected: '=', + onDevfileSelect: '&' + }; + } +} diff --git a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html new file mode 100644 index 00000000000..c40937f6666 --- /dev/null +++ b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html @@ -0,0 +1,66 @@ +
+
+
+
+
+ +
+
+ + + +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+ {{devfile.displayName}} +
+ +
+ {{devfile.description}} +
+
+
+
+
+
+
+
+
+
+ There are no devfiles. +
+ +
diff --git a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.styl b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.styl new file mode 100644 index 00000000000..d6ae4cd74e2 --- /dev/null +++ b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.styl @@ -0,0 +1,106 @@ +.devfile-selector + width 100% + + $devfile-selector-list-header-border = lighten($very-light-grey-color, 4%) + $devfile-selector-list-header-background = lighten($very-light-grey-color, 28%) + + .devfile-selector-list + background-color $devfile-selector-list-header-background + border-top 1px solid $devfile-selector-list-header-border + border-radius 2px + width 100% + + & > div + position relative + margin-top 40px + che-box-shadow() + + & > div + overflow-y auto + max-height 307px + + .che-list-header + .che-list-header-additional + display none + .che-list-item-row + margin -40px 0 0 0 + .che-list-header-column > * + position absolute + line-height 40px + top -40px + + .che-list-content + .devfile-selector-item-icon + line-height inherit + + .devfile-selector-icon-column + width 100px !important + + .devfile-selector-devfile-list + margin 0 + + .che-list + margin 0 + +.devfile-selector-item + $devfile-selected-background-color = #F2F7FD + + position relative + background-color $che-white-color + border 1px solid lighten($very-light-grey-color, 4%) + border-top-color lighten($list-separator-color, 7%) + z-index 0 + + * + outline none + + &:not(:first-of-type) + margin-top -1px + + &:last-of-type + border-radius 0 0 2px 2px + + .devfile-selector-item-icon + line-height 38px + font-size 30px + width 55px + text-align center + filter grayscale(100%) opacity(50%) + + img + height 30px + vertical-align top + + div + width 50px + + .devfile-selector-item-components > div + display inline-block + margin-right 10px + padding 0 11px + border 1px solid darken($che-white-color, 9%) + border-radius 2px + font-size 9px + line-height 14px + color $default-color + + // selected state + &.devfile-selector-item-selected + background-color $devfile-selected-background-color + border-color $primary-color + z-index 1 !important + + .devfile-selector-item-name + color $primary-color + +.devfile-selector-item + md-item.che-list-item + border none + + md-item-content + display block + border none + + .che-list-item-row + line-height 25px + diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-editors/workspace-editors.controller.ts b/dashboard/src/app/workspaces/workspace-details/workspace-editors/workspace-editors.controller.ts index b9a65d2aa2a..17c8ab88339 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-editors/workspace-editors.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/workspace-editors/workspace-editors.controller.ts @@ -29,7 +29,6 @@ export class WorkspaceEditorsController { workspace: che.IWorkspace; pluginRegistryLocation: string; - pluginRegistry: PluginRegistry; cheNotification: CheNotification; cheWorkspace: CheWorkspace; diff --git a/dashboard/src/app/workspaces/workspaces-config.ts b/dashboard/src/app/workspaces/workspaces-config.ts index e716538b580..d735d8b5e51 100644 --- a/dashboard/src/app/workspaces/workspaces-config.ts +++ b/dashboard/src/app/workspaces/workspaces-config.ts @@ -84,6 +84,8 @@ import {WorkspaceWarningsController} from './workspace-details/warnings/workspac import {WorkspacesService} from './workspaces.service'; import {WorkspacePluginsConfig} from './workspace-details/workspace-plugins/workspace-plugins-config'; import {WorkspaceEditorsConfig} from './workspace-details/workspace-editors/workspace-editors-config'; +import {DevfileSelector} from './create-workspace/devfile-selector/devfile-selector.directive'; +import {DevfileSelectorController} from './create-workspace/devfile-selector/devfile-selector.controller'; /** * @ngdoc controller @@ -122,6 +124,8 @@ export class WorkspacesConfig { register.service('stackSelectorSvc', StackSelectorSvc); register.directive('stackSelector', StackSelector); register.directive('stackSelectorItem', StackSelectorItem); + register.directive('devfileSelector', DevfileSelector); + register.controller('DevfileSelectorController', DevfileSelectorController); register.controller('RamSettingsController', RamSettingsController); register.directive('ramSettings', RamSettings); register.controller('RamSettingsMachineItemController', RamSettingsMachineItemController); diff --git a/dashboard/src/components/api/che-api-config.ts b/dashboard/src/components/api/che-api-config.ts index 2f234c534de..47f4b78acbe 100644 --- a/dashboard/src/components/api/che-api-config.ts +++ b/dashboard/src/components/api/che-api-config.ts @@ -43,6 +43,7 @@ import {CheTeamEventsManager} from './che-team-events-manager.factory'; import {CheInvite} from './che-invite.factory'; import {NpmRegistry} from './npm-registry.factory'; import {PluginRegistry} from './plugin-registry.factory'; +import {DevfileRegistry} from './devfile-registry.factory'; export class ApiConfig { @@ -79,5 +80,6 @@ export class ApiConfig { register.factory('cheInvite', CheInvite); register.factory('npmRegistry', NpmRegistry); register.factory('pluginRegistry', PluginRegistry); + register.factory('devfileRegistry', DevfileRegistry); } } diff --git a/dashboard/src/components/api/devfile-registry.factory.ts b/dashboard/src/components/api/devfile-registry.factory.ts new file mode 100644 index 00000000000..8cd432fb807 --- /dev/null +++ b/dashboard/src/components/api/devfile-registry.factory.ts @@ -0,0 +1,72 @@ +import { stringify } from "querystring"; + +/* + * Copyright (c) 2015-2018 Red Hat, Inc. + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + */ +'use strict'; + +export interface IDevfileMetaData { + displayName: string; + description?: string; + icon: string; + links: any; +} + + +/** + * This class is handling devfile registry api + * @author Ann Shumilova + */ +export class DevfileRegistry { + static $inject = ['$http']; + + /** + * Angular Http service. + */ + private $http: ng.IHttpService; + + private devfilesMap: Map; + + /** + * Default constructor that is using resource + */ + constructor($http: ng.IHttpService) { + this.$http = $http; + this.devfilesMap = new Map(); + } + + fetchDevfiles(location: string): ng.IPromise> { + let promise = this.$http({ 'method': 'GET', 'url': location + '/devfiles/' }); + return promise.then((result: any) => { + return result.data; + }); + } + + fetchDevfile(location: string, link: string): ng.IPromise { + let promise = this.$http({ 'method': 'GET', 'url': location + link }); + return promise.then((result: any) => { + let devfile = this.devfileYamlToJson(result.data) + this.devfilesMap.set(location + link, devfile); + return devfile; + }); + } + + getDevfile(location: string, link: string): che.IWorkspaceDevfile { + return this.devfilesMap.get(location + link); + } + + private devfileYamlToJson(yaml: string): che.IWorkspaceDevfile { + try { + return jsyaml.load(yaml); + } catch (e) { + } + } +} diff --git a/dashboard/src/components/api/workspace/che-workspace.factory.ts b/dashboard/src/components/api/workspace/che-workspace.factory.ts index f76f7a118cd..aca6cd07fd0 100644 --- a/dashboard/src/components/api/workspace/che-workspace.factory.ts +++ b/dashboard/src/components/api/workspace/che-workspace.factory.ts @@ -28,6 +28,8 @@ const WS_AGENT_WS_LINK: string = 'wsagent/ws'; interface ICHELicenseResource extends ng.resource.IResourceClass { create: any; createWithNamespace: any; + createDevfile: any; + createDevfileWithNamespace: any; deleteWorkspace: any; updateWorkspace: any; addProject: any; @@ -142,7 +144,7 @@ export class CheWorkspace { create: {method: 'POST', url: '/api/workspace'}, createWithNamespace: {method: 'POST', url: '/api/workspace?namespace=:namespace'}, createDevfile: {method: 'POST', url: '/api/workspace/devfile'}, - createDevWithNamespace: {method: 'POST', url: '/api/workspace?namespace=:namespace'}, + createDevfileWithNamespace: {method: 'POST', url: '/api/workspace/devfile?namespace=:namespace'}, deleteWorkspace: {method: 'DELETE', url: '/api/workspace/:workspaceId'}, updateWorkspace: {method: 'PUT', url: '/api/workspace/:workspaceId'}, addProject: {method: 'POST', url: '/api/workspace/:workspaceId/project'}, @@ -531,16 +533,16 @@ export class CheWorkspace { this.remoteWorkspaceAPI.create({attribute: attrs}, workspaceConfig).$promise; } - /*createWorkspaceFromDevfile(namespace: string, devfile: che.IWorkspaceDevfile, attributes: any): ng.IPromise { + createWorkspaceFromDevfile(namespace: string, devfile: che.IWorkspaceDevfile, attributes: any): ng.IPromise { let attrs = this.lodash.map(this.lodash.pairs(attributes || {}), (item: any) => { return item[0] + ':' + item[1]; }); - return namespace ? this.remoteWorkspaceAPI.createWithNamespace({ + return namespace ? this.remoteWorkspaceAPI.createDevfileWithNamespace({ namespace: namespace, attribute: attrs - }, workspaceDev).$promise : - this.remoteWorkspaceAPI.create({attribute: attrs}, workspaceDevfile).$promise; - }*/ + }, devfile).$promise : + this.remoteWorkspaceAPI.createDevfile({attribute: attrs}, devfile).$promise; + } /** * Add a command into the workspace @@ -757,6 +759,8 @@ export class CheWorkspace { const promise = this.remoteWorkspaceAPI.getSettings().$promise; return promise.then((settings: che.IWorkspaceSettings) => { this.workspaceSettings = settings; + //TODO remove next line + this.workspaceSettings.devfileRegistry = 'http://che-devfile-registry-default.192.168.39.13.nip.io'; return this.workspaceSettings; }, (error: any) => { if (error.status === 304) { diff --git a/dashboard/src/components/api/workspace/workspace-data-manager.ts b/dashboard/src/components/api/workspace/workspace-data-manager.ts index 68fd4cb845f..cebe29247ea 100644 --- a/dashboard/src/components/api/workspace/workspace-data-manager.ts +++ b/dashboard/src/components/api/workspace/workspace-data-manager.ts @@ -114,6 +114,7 @@ export class WorkspaceDataManager { if (workspace.config) { workspace.config.commands.push(command); } else if (workspace.devfile) { + workspace.devfile.commands = workspace.devfile.commands || []; workspace.devfile.commands.push(command); } } diff --git a/dashboard/src/components/typings/che.d.ts b/dashboard/src/components/typings/che.d.ts index b44bf8de8d0..60117629ad3 100755 --- a/dashboard/src/components/typings/che.d.ts +++ b/dashboard/src/components/typings/che.d.ts @@ -304,6 +304,7 @@ declare namespace che { export interface IWorkspaceSettings { supportedRecipeTypes: string; cheWorkspacePluginRegistryUrl: string; + devfileRegistry?: string; [propName: string]: string | boolean; } From 5e9db37d7aed214bfbc83031699ee8cdf82c65f5 Mon Sep 17 00:00:00 2001 From: Anna Shumilova Date: Tue, 4 Jun 2019 13:56:02 +0300 Subject: [PATCH 2/5] Show required memory for devfile, use devfile registry url from settings Signed-off-by: Anna Shumilova --- .../create-workspace/create-workspace.html | 2 +- .../devfile-selector.controller.ts | 4 ++-- .../devfile-selector/devfile-selector.html | 15 +++++++++++---- .../components/api/devfile-registry.factory.ts | 1 + .../api/workspace/che-workspace.factory.ts | 2 -- dashboard/src/components/typings/che.d.ts | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/dashboard/src/app/workspaces/create-workspace/create-workspace.html b/dashboard/src/app/workspaces/create-workspace/create-workspace.html index 34083aa6168..a451d78285f 100644 --- a/dashboard/src/app/workspaces/create-workspace/create-workspace.html +++ b/dashboard/src/app/workspaces/create-workspace/create-workspace.html @@ -55,7 +55,7 @@ che-label-description="Choose your workspace runtime environment used to build and run your projects."> - + diff --git a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.controller.ts b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.controller.ts index f8a54582722..345b04f1a54 100644 --- a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.controller.ts +++ b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.controller.ts @@ -37,7 +37,7 @@ export class DevfileSelectorController { } loadDevfiles(): void { - let location = this.cheWorkspace.getWorkspaceSettings().devfileRegistry; + let location = this.cheWorkspace.getWorkspaceSettings().cheWorkspaceDevfileRegistryUrl; this.devfileRegistry.fetchDevfiles(location).then((data: Array) => { this.devfiles = data; @@ -50,7 +50,7 @@ export class DevfileSelectorController { devfileOnClick(devfile: any): void { this.selectedDevfile = devfile; - let location = this.cheWorkspace.getWorkspaceSettings().devfileRegistry; + let location = this.cheWorkspace.getWorkspaceSettings().cheWorkspaceDevfileRegistryUrl; let devfileContent = this.devfileRegistry.getDevfile(location, devfile.links.self); if (devfileContent) { diff --git a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html index c40937f6666..4f91cf7d2ae 100644 --- a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html +++ b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html @@ -14,13 +14,16 @@ class="che-list-item-details"> - - + che-column-title="Description"> +
@@ -44,13 +47,17 @@ -
+
{{devfile.displayName}}
{{devfile.description}}
+ +
+ {{devfile.globalMemoryLimit}} +
diff --git a/dashboard/src/components/api/devfile-registry.factory.ts b/dashboard/src/components/api/devfile-registry.factory.ts index 8cd432fb807..e4d7428fb75 100644 --- a/dashboard/src/components/api/devfile-registry.factory.ts +++ b/dashboard/src/components/api/devfile-registry.factory.ts @@ -16,6 +16,7 @@ import { stringify } from "querystring"; export interface IDevfileMetaData { displayName: string; description?: string; + globalMemoryLimit: string; icon: string; links: any; } diff --git a/dashboard/src/components/api/workspace/che-workspace.factory.ts b/dashboard/src/components/api/workspace/che-workspace.factory.ts index aca6cd07fd0..91583a006cc 100644 --- a/dashboard/src/components/api/workspace/che-workspace.factory.ts +++ b/dashboard/src/components/api/workspace/che-workspace.factory.ts @@ -759,8 +759,6 @@ export class CheWorkspace { const promise = this.remoteWorkspaceAPI.getSettings().$promise; return promise.then((settings: che.IWorkspaceSettings) => { this.workspaceSettings = settings; - //TODO remove next line - this.workspaceSettings.devfileRegistry = 'http://che-devfile-registry-default.192.168.39.13.nip.io'; return this.workspaceSettings; }, (error: any) => { if (error.status === 304) { diff --git a/dashboard/src/components/typings/che.d.ts b/dashboard/src/components/typings/che.d.ts index 60117629ad3..c1eceebe62c 100755 --- a/dashboard/src/components/typings/che.d.ts +++ b/dashboard/src/components/typings/che.d.ts @@ -304,7 +304,7 @@ declare namespace che { export interface IWorkspaceSettings { supportedRecipeTypes: string; cheWorkspacePluginRegistryUrl: string; - devfileRegistry?: string; + cheWorkspaceDevfileRegistryUrl?: string; [propName: string]: string | boolean; } From 4b23324cd2ace688af083949d0e596ba4ba6f986 Mon Sep 17 00:00:00 2001 From: Anna Shumilova Date: Thu, 6 Jun 2019 10:37:01 +0300 Subject: [PATCH 3/5] Rework stack tests Signed-off-by: Anna Shumilova --- .../devfile-selector/devfile-selector.html | 4 +- .../api/devfile-registry.factory.ts | 2 - .../dashboard/CreateWorkspaceHelper.java | 5 - .../pageobject/dashboard/NewWorkspace.java | 469 +------------ .../CreateAndDeleteProjectsTest.java | 5 +- .../selenium/dashboard/CreateFactoryTest.java | 8 +- .../dashboard/CreateWorkspaceTest.java | 203 +----- .../ImportMavenProjectFromGitTest.java | 5 +- .../ImportProjectFromGitHubTest.java | 5 +- .../dashboard/ImportProjectFromZipTest.java | 5 +- .../AddWorkspaceToOrganizationTest.java | 4 +- .../ShareWorkspaceMemberTest.java | 5 +- .../organization/ShareWorkspaceOwnerTest.java | 4 +- .../AddOrImportProjectFormTest.java | 21 +- .../workspaces/NewWorkspacePageTest.java | 625 ------------------ .../workspaces/WorkspacesListTest.java | 4 +- .../details/WorkspaceDetailsComposeTest.java | 220 ------ .../details/WorkspaceDetailsOverviewTest.java | 9 +- ...oginExistedUserWithOpenShiftOAuthTest.java | 5 +- .../LoginNewUserWithOpenShiftOAuthTest.java | 6 +- .../CreateWorkspaceFromAndroidStackTest.java | 105 --- .../CreateWorkspaceFromBlankStackTest.java | 77 --- .../CreateWorkspaceFromCamelStackTest.java | 68 -- ...eateWorkspaceFromCentosBlankStackTest.java | 77 --- .../CreateWorkspaceFromCentosGoStackTest.java | 106 --- ...reateWorkspaceFromCentosNodeStackTest.java | 145 ---- ...kspaceFromCentosWildFlySwarmStackTest.java | 88 --- ...eWorkspaceFromCeylonWithJavaStackTest.java | 102 --- .../CreateWorkspaceFromCppStackTest.java | 98 --- ...reateWorkspaceFromEclipseCheStackTest.java | 93 --- ...ateWorkspaceFromEclipseVertxStackTest.java | 157 ----- .../stack/CreateWorkspaceFromGoStackTest.java | 106 --- ...reateWorkspaceFromJavaCentosStackTest.java | 97 --- ...WorkspaceFromJavaMySqlCentosStackTest.java | 133 ---- ...CreateWorkspaceFromJavaMySqlStackTest.java | 129 ---- .../CreateWorkspaceFromJavaStackTest.java | 159 ----- ...WorkspaceFromJavaTheiaDockerStackTest.java | 92 --- ...kspaceFromJavaTheiaOpenshiftStackTest.java | 92 --- .../CreateWorkspaceFromKotlinStackTest.java | 59 -- .../CreateWorkspaceFromNETStackTest.java | 98 --- .../CreateWorkspaceFromNodeStackTest.java | 162 ----- .../CreateWorkspaceFromPHPStackTest.java | 130 ---- .../CreateWorkspaceFromPythonStackTest.java | 136 ---- .../CreateWorkspaceFromRailsStackTest.java | 111 ---- ...reateWorkspaceFromSpringBootStackTest.java | 134 ---- ...mportAndValidateEclipseCheProjectTest.java | 210 ------ .../theia/Che7PreviewStackStartTest.java | 4 +- .../selenium/theia/TheiaBuildPluginTest.java | 4 +- .../CreateWorkspaceOnDashboardTest.java | 5 +- .../src/test/resources/suites/CheSuite.xml | 8 - 50 files changed, 58 insertions(+), 4541 deletions(-) delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsComposeTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromAndroidStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromBlankStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCamelStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosBlankStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosGoStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosNodeStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosWildFlySwarmStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCeylonWithJavaStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCppStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseCheStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseVertxStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromGoStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaCentosStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlCentosStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaDockerStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaOpenshiftStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromKotlinStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNETStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNodeStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPHPStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPythonStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromRailsStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromSpringBootStackTest.java delete mode 100644 selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/ImportAndValidateEclipseCheProjectTest.java diff --git a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html index 4f91cf7d2ae..1fb9535a056 100644 --- a/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html +++ b/dashboard/src/app/workspaces/create-workspace/devfile-selector/devfile-selector.html @@ -28,7 +28,7 @@ -
- {{devfile.globalMemoryLimit}} + {{devfile.globalMemoryLimit | changeMemoryUnit:['MB','GB']}}
diff --git a/dashboard/src/components/api/devfile-registry.factory.ts b/dashboard/src/components/api/devfile-registry.factory.ts index e4d7428fb75..b4da3618acf 100644 --- a/dashboard/src/components/api/devfile-registry.factory.ts +++ b/dashboard/src/components/api/devfile-registry.factory.ts @@ -1,5 +1,3 @@ -import { stringify } from "querystring"; - /* * Copyright (c) 2015-2018 Red Hat, Inc. * This program and the accompanying materials are made diff --git a/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/CreateWorkspaceHelper.java b/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/CreateWorkspaceHelper.java index b44a59c00d8..5dc392ab613 100644 --- a/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/CreateWorkspaceHelper.java +++ b/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/CreateWorkspaceHelper.java @@ -74,12 +74,7 @@ private void prepareWorkspace(NewWorkspace.Stack stack, String workspaceName, Do workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); - newWorkspace.clickOnAllStacksTab(); newWorkspace.selectStack(stack); newWorkspace.typeWorkspaceName(workspaceName); - - if (machineRam != null) { - newWorkspace.setMachineRAM("dev-machine", machineRam); - } } } diff --git a/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/NewWorkspace.java b/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/NewWorkspace.java index c94ee173b96..bf7f9419d4f 100644 --- a/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/NewWorkspace.java +++ b/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/NewWorkspace.java @@ -15,26 +15,14 @@ import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.WIDGET_TIMEOUT_SEC; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.ALL_BUTTON_ID; import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.BOTTOM_CREATE_BUTTON_XPATH; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.CREATE_STACK_DIALOG_FORM_XPATH; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.DECREMENT_MEMORY_BUTTON; import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.ERROR_MESSAGE; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.FILTERS_INPUT_TAGS_XPATH; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.FILTERS_INPUT_TAG_XPATH_TEMPLATE; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.FILTER_SELECTED_SUGGESTION_BUTTON; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.FILTER_SUGGESTION_BUTTON; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.INCREMENT_MEMORY_BUTTON; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.MULTI_MACHINE_BUTTON_ID; import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.ORGANIZATIONS_LIST_ID; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.QUICK_START_BUTTON_ID; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.SINGLE_MACHINE_BUTTON_ID; import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.STACK_ROW_XPATH; import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.TOOLBAR_TITLE_ID; import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.TOP_CREATE_BUTTON_XPATH; import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.TOP_DROPDOWN_BUTTON_XPATH; import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Locators.TOP_EDIT_BUTTON_XPATH; -import static org.openqa.selenium.Keys.BACK_SPACE; import com.google.inject.Inject; import com.google.inject.Singleton; @@ -43,7 +31,6 @@ import java.util.stream.Collectors; import org.eclipse.che.selenium.core.SeleniumWebDriver; import org.eclipse.che.selenium.core.constant.TestTimeoutsConstants; -import org.eclipse.che.selenium.core.utils.WaitUtils; import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; import org.eclipse.che.selenium.core.webdriver.WebDriverWaitFactory; import org.eclipse.che.selenium.pageobject.TestWebElementRenderChecker; @@ -86,102 +73,25 @@ public interface Locators { String WORKSPACE_NAME_INPUT = "workspace-name-input"; String ERROR_MESSAGE = "new-workspace-error-message"; String TOOLBAR_TITLE_ID = "New_Workspace"; - String SELECT_ALL_STACKS_TAB = "all-stacks-button"; - String SELECT_QUICK_START_STACKS_TAB = "quick-start-button"; - String SELECT_SINGLE_MACHINE_STACKS_TAB = "single-machine-button"; - String SELECT_MULTI_MACHINE_STACKS_TAB = "multi-machine-button"; - String ADD_STACK_BUTTON = "search-stack-input"; - String FILTERS_STACK_BUTTON = "filter-stacks-button"; - String FILTER_STACK_INPUT = "filter-stack-input"; - String FILTER_SUGGESTION_TEXT = - "//div[contains(@class,'stack-library-filter-suggestion-text')]"; - String FILTER_SUGGESTION_BUTTON = - "//div[@name='suggestionText' and text()='%s']/../div[@name='suggestionButton']"; - String FILTER_SELECTED_SUGGESTION_BUTTON = "//button[@class='md-chip-remove ng-scope']"; - String SEARCH_INPUT = "//div[@id='search-stack-input']//input"; - String CLEAR_INPUT = "//div[@id='search-stack-input']//div[@role='button']"; - String STACK_ROW_XPATH = "//div[@data-stack-id='%s']"; + String STACK_ROW_XPATH = "//div[@data-devfile-id='%s']"; String MACHINE_NAME = "//span[contains(@class,'ram-settings-machine-item-item-name') and text()='%s']"; - String MACHINE_IMAGE = "//span[@class='ram-settings-machine-item-secondary-color']"; - String DECREMENT_MEMORY_BUTTON = - "//*[@id='machine-%s-ram']//button[@aria-label='Decrement memory']"; - String INCREMENT_MEMORY_BUTTON = - "//*[@id='machine-%s-ram']//button[@aria-label='Increment memory']"; - String MACHINE_RAM_VALUE = "//*[@id='machine-%s-ram']//input"; String ORGANIZATIONS_LIST_ID = "namespace-selector"; String ORGANIZATION_ITEM = "//md-menu-item[text()='%s']"; - String FILTERS_INPUT_TAGS_XPATH = "//div[@class='md-chip-content']"; - String FILTERS_INPUT_TAG_XPATH_TEMPLATE = "//div[@class='md-chip-content']//div[text()='%s']"; - String CREATE_STACK_DIALOG_FORM_XPATH = - "//div[contains(@class, 'md-dialog-container ng-scope')]/md-dialog"; - // buttons String TOP_CREATE_BUTTON_XPATH = "//button[@name='split-button']"; String TOP_DROPDOWN_BUTTON_XPATH = "//button[@name='dropdown-toggle']"; String TOP_EDIT_BUTTON_XPATH = "//span[text()='Create & Proceed Editing']"; String BOTTOM_CREATE_BUTTON_XPATH = "//che-button-save-flat/button[@name='saveButton']"; - String ALL_BUTTON_ID = "all-stacks-button"; - String QUICK_START_BUTTON_ID = "quick-start-button"; - String SINGLE_MACHINE_BUTTON_ID = "single-machine-button"; - String MULTI_MACHINE_BUTTON_ID = "multi-machine-button"; } public enum Stack { - BLANK("blank-default"), - JAVA("java-default"), - JAVA_MYSQL("java-mysql"), - DOT_NET_DEFAULT("dotnet-default"), - DOT_NET("dotnet"), - ANDROID("android-default"), - CPP("cpp-default"), - CAMEL_SPRINGBOOT_CHE7("apache-camel-springboot-che7"), - CAMEL_SPRINGBOOT("apache-camel-springboot"), - CENTOS_BLANK("centos"), - CENTOS_GO("centos-go"), - CENTOS_NODEJS("nodejs6"), - CENTOS_WILDFLY_SWARM("wildfly-swarm"), - CEYLON_WITH_JAVA_JAVASCRIPT("ceylon-java-javascript-dart-centos"), - CHE_7_PREVIEW("che7-preview"), - CHE_7_PREVIEW_DEV("che7-preview-plugin-dev"), - CHE_7_THEIA_DEV("che7-development-che-theia-and-theia-plugins"), - DEBIAN("debian"), - DEBIAN_LSP("debianlsp"), - ECLIPSE_CHE("che-in-che"), - ECLIPSE_VERTX("vert.x"), - GO_DEFAULT("go-default"), - GO("go"), - JAVA_CENTOS("java-centos"), - JAVA_GRADLE("java-gradle"), - JAVA_MAVEN("java-maven"), - JAVA_THEIA_DOCKER("simple-theia-docker"), - JAVA_THEIA_ON_KUBERNETES("java-theia-kubernetes"), - JAVA_MYSQL_THEIA_ON_KUBERNETES("java-mysql-theia-kubernetes"), - JAVA_THEIA_OPENSHIFT("java-theia-openshift"), - JAVA_MYSQL_CENTOS("java-centos-mysql"), - JAVA_DEBIAN("java-debian"), - KOTLIN("kotlin-default"), - NODE("node-default"), - NODEJS_AND_POSTGRES("nodejs-postgres"), - OPENSHIFT_SQL("openshift-sql"), - PHP("php-default"), - PHP_CHE7("php"), - PHP_MYSQL_CHE7("php+mysql"), - PHP_GAE("php-gae"), - PHP_5_6("php5.6-default"), - PLATFORMIO("platformio"), - PYTHON_DEFAULT("python-default"), - PYTHON("python"), - PYTHON_2_7("python-2.7"), - PYTHON_GAE("python-gae"), - RAILS("rails-default"), - OPENSHIFT("openshift-default"), - HADOOP("hadoop-default"), - SELENIUM("selenium"), - SPRING_BOOT("spring-boot"), - TOM_EE("tomee-default"), - UBUNTU("ubuntu"), - ZEND("zend"); + APACHE_CAMEL("Apache Camel based projects on Che 7"), + DOT_NET(".NET Core with Theia IDE"), + GO("Go with Theia IDE"), + JAVA_GRADLE("Java Gradle"), + JAVA_MAVEN("Java Maven"), + PYTHON("Python with Theia IDE"); // wsnext-helloworld-openshift private final String id; @@ -203,12 +113,6 @@ public String getId() { } } - @FindBy(id = Locators.FILTERS_STACK_BUTTON) - WebElement filtersStackButton; - - @FindBy(id = Locators.FILTER_STACK_INPUT) - WebElement filterStackInput; - @FindBy(id = TOOLBAR_TITLE_ID) WebElement toolbarTitle; @@ -227,24 +131,6 @@ public String getId() { @FindBy(xpath = TOP_EDIT_BUTTON_XPATH) WebElement topEditWorkspaceButton; - @FindBy(xpath = Locators.SEARCH_INPUT) - WebElement searchInput; - - @FindBy(xpath = Locators.CLEAR_INPUT) - WebElement clearInput; - - @FindBy(id = Locators.SELECT_ALL_STACKS_TAB) - WebElement selectAllStacksTab; - - @FindBy(id = Locators.SELECT_QUICK_START_STACKS_TAB) - WebElement selectQuickStartStacksTab; - - @FindBy(id = Locators.SELECT_SINGLE_MACHINE_STACKS_TAB) - WebElement selectSingleMachineStacksTab; - - @FindBy(id = Locators.SELECT_MULTI_MACHINE_STACKS_TAB) - WebElement selectMultiMachineStacksTab; - private void waitButtonDisableState(WebElement button, boolean state) { seleniumWebDriverHelper.waitAttributeEqualsTo(button, "aria-disabled", Boolean.toString(state)); } @@ -282,211 +168,6 @@ public boolean isMachineExists(String machineName) { > 0; } - public void clickOnIncrementMemoryButton(String machineName) { - seleniumWebDriverHelper.waitAndClick(By.xpath(format(INCREMENT_MEMORY_BUTTON, machineName))); - } - - public void clickAndHoldIncrementMemoryButton(String machineName, int holdingTimeout) { - seleniumWebDriverHelper.clickAndHoldElementDuringTimeout( - By.xpath(format(INCREMENT_MEMORY_BUTTON, machineName)), holdingTimeout); - } - - public void clickAndHoldDecrementMemoryButton(String machineName, int holdingTimeout) { - seleniumWebDriverHelper.clickAndHoldElementDuringTimeout( - By.xpath(format(DECREMENT_MEMORY_BUTTON, machineName)), holdingTimeout); - } - - public void waitRamValueInSpecifiedRange( - String machineName, double lowestValue, double highestValue) { - webDriverWaitFactory - .get() - .until( - (ExpectedCondition) - driver -> { - double ramValue = getRAM(machineName); - return ramValue >= lowestValue && ramValue <= highestValue; - }); - } - - public void clickOnDecrementMemoryButton(String machineName) { - seleniumWebDriverHelper.waitAndClick(By.xpath(format(DECREMENT_MEMORY_BUTTON, machineName))); - } - - public double getRAM(String machineName) { - String amountOfRam = - seleniumWebDriverHelper.waitVisibilityAndGetValue( - By.xpath(format(Locators.MACHINE_RAM_VALUE, machineName))); - return Double.parseDouble(amountOfRam); - } - - public void waitRamValue(String machineName, double expectedValue) { - webDriverWaitFactory - .get() - .until((ExpectedCondition) driver -> expectedValue == getRAM(machineName)); - } - - public void setMachineRAM(String machineName, double value) { - seleniumWebDriverHelper.setValue( - By.xpath(format(Locators.MACHINE_RAM_VALUE, machineName)), Double.toString(value)); - } - - public void clickOnFiltersButton() { - seleniumWebDriverHelper.waitAndClick(filtersStackButton); - } - - public void typeToFiltersInput(String value) { - seleniumWebDriverHelper.setValue(filterStackInput, value); - } - - public void deleteLastTagFromInputTagsField() { - seleniumWebDriverHelper.waitAndSendKeysTo(filterStackInput, BACK_SPACE.toString()); - - // one "backspace" should sent exactly to defined tag (for activating) and next "backspace" - // should be a simple button pressing - seleniumWebDriverHelper.sendKeys(BACK_SPACE.toString()); - } - - public void waitFiltersFormOpened() { - seleniumWebDriverHelper.waitVisibility(filterStackInput); - } - - public void waitFiltersFormClosed() { - seleniumWebDriverHelper.waitInvisibility(filterStackInput); - } - - public String getTextFromFiltersInput() { - return seleniumWebDriverHelper.waitVisibilityAndGetValue(filterStackInput); - } - - private List getTagsFromFiltersInput() { - String tagsXpath = FILTERS_INPUT_TAGS_XPATH + "/md-chip-template"; - - seleniumWebDriverHelper.waitVisibility(By.xpath(tagsXpath)); - - return seleniumWebDriverHelper.waitVisibilityOfAllElements(By.xpath(tagsXpath)); - } - - private String getFiltersInputTagName(WebElement tag) { - return seleniumWebDriverHelper.waitVisibilityAndGetText(tag); - } - - public List getFiltersInputTags() { - return getTagsFromFiltersInput() - .stream() - .map(tag -> getFiltersInputTagName(tag)) - .collect(Collectors.toList()); - } - - public void waitFiltersInputIsEmpty() { - seleniumWebDriverHelper.waitInvisibility(By.xpath(FILTERS_INPUT_TAGS_XPATH)); - } - - public void waitFiltersInputTags(List expectedTags) { - webDriverWaitFactory - .get() - .until((ExpectedCondition) driver -> getFiltersInputTags().equals(expectedTags)); - } - - public void deleteTagByRemoveButton(String tagName) { - String removeButtonXpath = - format( - FILTERS_INPUT_TAG_XPATH_TEMPLATE - + "/parent::md-chip-template/div[@class='stack-library-filter-tag-btn']/i", - tagName); - - seleniumWebDriverHelper.moveCursorToAndClick(By.xpath(removeButtonXpath)); - } - - public void waitTextContainsInFiltersInput(String expectedText) { - webDriverWaitFactory - .get() - .until( - (ExpectedCondition) - driver -> getTextFromFiltersInput().contains(expectedText)); - } - - public void waitTextEqualsInFiltersInput(String expectedText) { - webDriverWaitFactory - .get() - .until( - (ExpectedCondition) driver -> getTextFromFiltersInput().equals(expectedText)); - } - - public List getFiltersSuggestionsNames() { - return seleniumWebDriverHelper - .waitVisibilityOfAllElements(By.xpath("//div[@name='suggestionText']")) - .stream() - .map(webElement -> webElement.getText()) - .collect(toList()); - } - - public List getFiltersSuggestions() { - String filtersSuggestionBody = "//md-chip"; - return seleniumWebDriverHelper.waitVisibilityOfAllElements(By.xpath(filtersSuggestionBody)); - } - - public void waitFiltersSuggestionsNames(List expectedSuggestions) { - expectedSuggestions.forEach( - item -> { - webDriverWaitFactory - .get() - .until( - (ExpectedCondition) - driver -> getFiltersSuggestionsNames().contains(item)); - }); - } - - public WebElement getSelectedSuggestion() { - return getFiltersSuggestions() - .stream() - .filter( - webElement -> - webElement - .getAttribute("class") - .contains("stack-library-filter-suggestion-selected")) - .collect(toList()) - .get(0); - } - - public void waitSelectedFiltersSuggestion(String suggestionName) { - webDriverWaitFactory - .get() - .until( - (ExpectedCondition) - driver -> getSelectedFiltersSuggestionName().equals(suggestionName)); - } - - public String getSelectedFiltersSuggestionName() { - return seleniumWebDriverHelper.waitVisibilityAndGetText(getSelectedSuggestion()); - } - - public WebElement getFiltersSuggestionByName(String suggestionName) { - String filtersSuggestion = - format("//div[@name='suggestionText' and text()='%s']", suggestionName); - - return seleniumWebDriverHelper.waitVisibility(By.xpath(filtersSuggestion)); - } - - public String getSuggestionName(WebElement suggestion) { - return seleniumWebDriverHelper.waitVisibilityAndGetText(suggestion); - } - - public void clearSuggestions() { - seleniumWebDriverHelper.waitAndClick(By.xpath(FILTER_SELECTED_SUGGESTION_BUTTON)); - } - - public void chooseFilterSuggestionByPlusButton(String suggestion) { - seleniumWebDriverHelper.waitAndClick(By.xpath(format(FILTER_SUGGESTION_BUTTON, suggestion))); - } - - public void clickOnFiltersSuggestions(String suggestionName) { - seleniumWebDriverHelper.waitAndClick(getFiltersSuggestionByName(suggestionName)); - } - - public void doubleClickOnFiltersSuggestion(String suggestionName) { - seleniumWebDriverHelper.moveCursorToAndDoubleClick(getFiltersSuggestionByName(suggestionName)); - } - public void waitToolbar() { waitToolbar(WIDGET_TIMEOUT_SEC); } @@ -495,32 +176,6 @@ public void waitToolbar(int timeout) { seleniumWebDriverHelper.waitVisibility(By.id(TOOLBAR_TITLE_ID), timeout); } - public String getTextFromSearchInput() { - return seleniumWebDriverHelper.waitVisibilityAndGetValue(searchInput); - } - - public void typeToSearchInput(String value) { - seleniumWebDriverHelper.setValue(searchInput, value); - } - - public void typeToRamField(String value) { - seleniumWebDriverHelper.setValue(By.id("machine--ram"), value); - } - - public void waitRedRamFieldBorders() { - seleniumWebDriverHelper.waitAttributeContainsValue( - By.xpath("//ng-form[@name='ramAmountForm']"), "class", "ng-invalid-required"); - } - - public void waitRedRamFieldBordersDisappearance() { - seleniumWebDriverHelper.waitAttributeContainsValue( - By.xpath("//ng-form[@name='ramAmountForm']"), "class", "ng-valid-required"); - } - - public void clearTextInSearchInput() { - seleniumWebDriverHelper.waitAndClick(clearInput); - } - public boolean isStackVisible(Stack stack) { return seleniumWebDriver.findElements(By.xpath(format(STACK_ROW_XPATH, stack.getId()))).size() > 0; @@ -557,22 +212,6 @@ public void waitBottomCreateWorkspaceButtonDisabled() { By.xpath(BOTTOM_CREATE_BUTTON_XPATH), "aria-disabled", "true"); } - public void clickOnAllStacksTab() { - seleniumWebDriverHelper.waitAndClick(selectAllStacksTab); - } - - public void clickOnQuickStartTab() { - seleniumWebDriverHelper.waitAndClick(selectQuickStartStacksTab); - } - - public void clickOnSingleMachineTab() { - seleniumWebDriverHelper.waitAndClick(selectSingleMachineStacksTab); - } - - public void clickOnMultiMachineTab() { - seleniumWebDriverHelper.waitAndClick(selectMultiMachineStacksTab); - } - public void clickOnCreateButtonAndOpenInIDE() { // need to move cursor to button to avoid failure https://github.com/eclipse/che/issues/12309 seleniumWebDriverHelper.waitVisibility(bottomCreateWorkspaceButton); @@ -620,54 +259,6 @@ public WebElement waitNameField() { return waitNameField(DEFAULT_TIMEOUT); } - public WebElement waitAllButton(int timeout) { - return seleniumWebDriverHelper.waitVisibility(By.id(ALL_BUTTON_ID), timeout); - } - - public WebElement waitAllButton() { - return waitAllButton(DEFAULT_TIMEOUT); - } - - public void clickOnAllButton() { - waitAllButton().click(); - } - - public WebElement waitQuickStartButton(int timeout) { - return seleniumWebDriverHelper.waitVisibility(By.id(QUICK_START_BUTTON_ID), timeout); - } - - public WebElement waitQuickStartButton() { - return waitQuickStartButton(DEFAULT_TIMEOUT); - } - - public void clickOnQuickStartButton() { - waitQuickStartButton().click(); - } - - public WebElement waitSingleMachineButton(int timeout) { - return seleniumWebDriverHelper.waitVisibility(By.id(SINGLE_MACHINE_BUTTON_ID), timeout); - } - - public WebElement waitSingleMachineButton() { - return waitSingleMachineButton(DEFAULT_TIMEOUT); - } - - public void clickOnSingleMachineButton() { - waitSingleMachineButton().click(); - } - - public WebElement waitMultiMachineButton(int timeout) { - return seleniumWebDriverHelper.waitVisibility(By.id(MULTI_MACHINE_BUTTON_ID), timeout); - } - - public WebElement waitMultiMachineButton() { - return waitMultiMachineButton(DEFAULT_TIMEOUT); - } - - public void clickOnMultiMachineButton() { - waitMultiMachineButton().click(); - } - public void waitBottomCreateButton(int timeout) { seleniumWebDriverHelper.waitVisibility(bottomCreateWorkspaceButton, timeout); } @@ -678,10 +269,6 @@ public void waitBottomCreateButton() { public void waitMainActionButtons(int timeout) { waitTopCreateButton(timeout); - waitAllButton(timeout); - waitQuickStartButton(timeout); - waitSingleMachineButton(timeout); - waitMultiMachineButton(timeout); addOrImportForm.waitAddOrImportProjectButton(timeout); waitBottomCreateButton(timeout); } @@ -702,26 +289,26 @@ public void waitPageLoad() { public List getAvailableStacks() { return seleniumWebDriverHelper - .waitPresenceOfAllElements(By.xpath("//div[@data-stack-id]")) + .waitPresenceOfAllElements(By.xpath("//div[@data-devfile-id]")) .stream() - .map(webElement -> Stack.getById(webElement.getAttribute("data-stack-id"))) + .map(webElement -> Stack.getById(webElement.getAttribute("data-devfile-id"))) .collect(toList()); } public void waitStackSelected(Stack stack) { String selectedStackXpath = format( - "//div[@data-stack-id='%s' and contains(@class, 'stack-selector-item-selected')]", + "//div[@data-devfile-id='%s' and contains(@class, 'devfile-selector-item-selected')]", stack.getId()); seleniumWebDriverHelper.waitVisibility(By.xpath(selectedStackXpath)); } public List getVisibleStacks() { return seleniumWebDriverHelper - .waitPresenceOfAllElements(By.xpath("//div[@data-stack-id]")) + .waitPresenceOfAllElements(By.xpath("//div[@data-devfile-id]")) .stream() .filter(seleniumWebDriverHelper::isVisible) - .map(webElement -> Stack.getById(webElement.getAttribute("data-stack-id"))) + .map(webElement -> Stack.getById(webElement.getAttribute("data-devfile-id"))) .collect(Collectors.toList()); } @@ -737,7 +324,7 @@ public void waitStacks(List expectedStacks) { expectedStacks.forEach( stack -> seleniumWebDriverHelper.waitPresence( - By.xpath(format("//div[@data-stack-id='%s']", stack.getId())))); + By.xpath(format("//div[@data-devfile-id='%s']", stack.getId())))); } public void waitStacksCount(int expectedCount) { @@ -775,37 +362,7 @@ public void clickOnTitlePlaceCoordinate() { seleniumWebDriverHelper.getAction().click().perform(); } - public void clickOnInputFieldTag(String tagName) { - seleniumWebDriverHelper.waitAndClick( - By.xpath(format(FILTERS_INPUT_TAG_XPATH_TEMPLATE, tagName))); - } - public void clickOnAddStackButton() { seleniumWebDriverHelper.waitAndClick(By.id("add-stack-button")); } - - public void waitCreateStackDialog() { - // wait should be changed to "TestWebElementRenderChecker" after resolving issue - // https://github.com/eclipse/che/issues/10087 - WaitUtils.sleepQuietly(2); - - seleniumWebDriverHelper.waitVisibility(By.xpath(CREATE_STACK_DIALOG_FORM_XPATH)); - seleniumWebDriverHelper.waitVisibility(By.xpath("//div[text()='Build stack from recipe']")); - } - - public void waitCreateStackDialogClosing() { - seleniumWebDriverHelper.waitInvisibility(By.xpath("//md-dialog")); - } - - public void clickOnYesButtonInCreateStackDialog() { - seleniumWebDriverHelper.waitAndClick(By.xpath("//*[@che-button-title='Ok']")); - } - - public void clickOnNoButtonInCreateStackDialog() { - seleniumWebDriverHelper.waitAndClick(By.xpath("//*[@che-button-title='Cancel']")); - } - - public void closeCreateStackDialogByCloseButton() { - seleniumWebDriverHelper.waitAndClick(By.xpath("//md-dialog//i")); - } } diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateAndDeleteProjectsTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateAndDeleteProjectsTest.java index 753ea5dc065..8d5b7503414 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateAndDeleteProjectsTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateAndDeleteProjectsTest.java @@ -13,7 +13,6 @@ import static org.eclipse.che.commons.lang.NameGenerator.generate; import static org.eclipse.che.selenium.pageobject.ProjectExplorer.FolderTypes.PROJECT_FOLDER; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Template.CONSOLE_JAVA_SIMPLE; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Template.WEB_JAVA_SPRING; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.PROJECTS; @@ -32,6 +31,7 @@ import org.eclipse.che.selenium.pageobject.ToastLoader; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceProjects; @@ -86,8 +86,7 @@ public void createProjectTest() { newWorkspace.waitToolbar(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE); // create 'web-java-spring' and 'console-java-simple' projects diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateFactoryTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateFactoryTest.java index 7cf8a4e290c..d4300d7eaee 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateFactoryTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateFactoryTest.java @@ -12,7 +12,6 @@ package org.eclipse.che.selenium.dashboard; import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Template.WEB_JAVA_SPRING; import static org.eclipse.che.selenium.pageobject.dashboard.factories.CreateFactoryPage.TabNames.CONFIG_TAB_ID; import static org.eclipse.che.selenium.pageobject.dashboard.factories.CreateFactoryPage.TabNames.GIT_TAB_ID; @@ -41,6 +40,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.DashboardFactories; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; import org.eclipse.che.selenium.pageobject.dashboard.factories.CreateFactoryPage; import org.eclipse.che.selenium.pageobject.dashboard.factories.FactoryDetails; @@ -375,8 +375,7 @@ private TestWorkspace createWorkspaceWithProject(String workspaceName) { loader.waitOnClosed(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(workspaceName); projectSourcePage.clickOnAddOrImportProjectButton(); @@ -402,8 +401,7 @@ private TestWorkspace createWorkspaceWithoutProject(String workspaceName) { loader.waitOnClosed(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(workspaceName); newWorkspace.clickOnCreateButtonAndEditWorkspace(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateWorkspaceTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateWorkspaceTest.java index d7046177d72..74adc3d0646 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateWorkspaceTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/CreateWorkspaceTest.java @@ -11,23 +11,15 @@ */ package org.eclipse.che.selenium.dashboard; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.BLANK; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_PREVIEW; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL_CENTOS; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL_THEIA_ON_KUBERNETES; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Template.WEB_JAVA_SPRING; import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; import com.google.inject.Inject; import org.eclipse.che.commons.lang.NameGenerator; -import org.eclipse.che.selenium.core.TestGroup; -import org.eclipse.che.selenium.core.utils.WaitUtils; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.BeforeClass; @@ -92,201 +84,10 @@ public void checkWorkspaceName() { newWorkspace.waitBottomCreateWorkspaceButtonEnabled(); } - @Test(groups = TestGroup.DOCKER) - public void checkMachinesDocker() { - String machineName = "dev-machine"; - - // change the RAM number by the increment and decrement buttons - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); - assertTrue(newWorkspace.isMachineExists(machineName)); - assertEquals(newWorkspace.getRAM(machineName), 2.0); - newWorkspace.clickOnIncrementMemoryButton(machineName); - assertEquals(newWorkspace.getRAM(machineName), 2.1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - - // we need to wait a little to avoid quick clicking on this button - WaitUtils.sleepQuietly(1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - WaitUtils.sleepQuietly(1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - assertEquals(newWorkspace.getRAM(machineName), 1.8); - - // type number of memory in the RAM field - newWorkspace.setMachineRAM(machineName, 5.0); - assertEquals(newWorkspace.getRAM(machineName), 5.0); - - // check the RAM section of the Java-MySql stack(with two machines) - newWorkspace.selectStack(JAVA_MYSQL_CENTOS); - assertTrue(newWorkspace.isMachineExists("db")); - assertTrue(newWorkspace.isMachineExists(machineName)); - newWorkspace.clickOnDecrementMemoryButton(machineName); - newWorkspace.clickOnDecrementMemoryButton("db"); - assertEquals(newWorkspace.getRAM(machineName), 1.9); - assertEquals(newWorkspace.getRAM("db"), 0.9); - newWorkspace.clickOnDecrementMemoryButton("db"); - assertEquals(newWorkspace.getRAM("db"), 0.8); - newWorkspace.setMachineRAM(machineName, 100.0); - newWorkspace.clickOnIncrementMemoryButton(machineName); - assertEquals(newWorkspace.getRAM(machineName), 100.0); - } - - @Test(groups = {TestGroup.OPENSHIFT}) - public void checkMachinesOpenshift() { - String machineName = "dev-machine"; - - // change the RAM number by the increment and decrement buttons - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); - assertTrue(newWorkspace.isMachineExists(machineName)); - assertEquals(newWorkspace.getRAM(machineName), 2.0); - newWorkspace.clickOnIncrementMemoryButton(machineName); - assertEquals(newWorkspace.getRAM(machineName), 2.1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - - // we need to wait a little to avoid quick clicking on this button - WaitUtils.sleepQuietly(1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - WaitUtils.sleepQuietly(1); - newWorkspace.clickOnDecrementMemoryButton(machineName); - assertEquals(newWorkspace.getRAM(machineName), 1.8); - - // type number of memory in the RAM field - newWorkspace.setMachineRAM(machineName, 5.0); - assertEquals(newWorkspace.getRAM(machineName), 5.0); - - // check the RAM section of 'MySQL with Theia IDE on Kubernetes' stack(with two machines) - newWorkspace.selectStack(JAVA_MYSQL_THEIA_ON_KUBERNETES); - assertTrue(newWorkspace.isMachineExists("web/mysql")); - assertTrue(newWorkspace.isMachineExists("web/dev")); - newWorkspace.clickOnDecrementMemoryButton("web/dev"); - newWorkspace.clickOnDecrementMemoryButton("web/mysql"); - assertEquals(newWorkspace.getRAM("web/dev"), 0.4); - assertEquals(newWorkspace.getRAM("web/mysql"), 0.2); - newWorkspace.clickOnDecrementMemoryButton("web/mysql"); - assertEquals(newWorkspace.getRAM("web/mysql"), 0.1); - newWorkspace.setMachineRAM("web/dev", 100.0); - newWorkspace.clickOnIncrementMemoryButton("web/dev"); - assertEquals(newWorkspace.getRAM("web/dev"), 100.0); - } - - @Test(groups = TestGroup.DOCKER) - public void checkFiltersStacksFeatureDocker() { - - // filter stacks by 'java' value and check filtered stacks list - newWorkspace.clickOnAllStacksTab(); - newWorkspace.clickOnFiltersButton(); - newWorkspace.typeToFiltersInput("java"); - newWorkspace.chooseFilterSuggestionByPlusButton("JAVA"); - assertTrue(newWorkspace.isStackVisible(JAVA)); - assertFalse(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clickOnMultiMachineTab(); - assertFalse(newWorkspace.isStackVisible(JAVA)); - - // filter stacks by 'blank' value and check filtered stacks list - newWorkspace.clickOnSingleMachineTab(); - newWorkspace.clickOnFiltersButton(); - newWorkspace.clearSuggestions(); - newWorkspace.typeToFiltersInput("blank"); - newWorkspace.chooseFilterSuggestionByPlusButton("BLANK"); - assertTrue(newWorkspace.isStackVisible(BLANK)); - - // filter the Java-MySql stack - newWorkspace.clickOnAllStacksTab(); - newWorkspace.clickOnFiltersButton(); - newWorkspace.clearSuggestions(); - newWorkspace.typeToFiltersInput("java"); - newWorkspace.chooseFilterSuggestionByPlusButton("JAVA 1.8, TOMCAT 8, MYSQL 5.7"); - assertTrue(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clickOnSingleMachineTab(); - assertFalse(newWorkspace.isStackVisible(JAVA_MYSQL)); - } - - @Test(groups = {TestGroup.OPENSHIFT}) - public void checkFiltersStacksFeatureOpenshift() { - - // filter stacks by 'java' value and check filtered stacks list - newWorkspace.clickOnAllStacksTab(); - newWorkspace.clickOnFiltersButton(); - newWorkspace.typeToFiltersInput("java"); - newWorkspace.chooseFilterSuggestionByPlusButton("JAVA"); - assertTrue(newWorkspace.isStackVisible(JAVA)); - assertFalse(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clickOnMultiMachineTab(); - assertFalse(newWorkspace.isStackVisible(JAVA)); - - // filter stacks by 'blank' value and check filtered stacks list - newWorkspace.clickOnSingleMachineTab(); - newWorkspace.clickOnFiltersButton(); - newWorkspace.clearSuggestions(); - newWorkspace.typeToFiltersInput("blank"); - newWorkspace.chooseFilterSuggestionByPlusButton("BLANK"); - assertTrue(newWorkspace.isStackVisible(BLANK)); - } - - @Test(groups = TestGroup.DOCKER) - public void checkSearchStackFeatureDocker() { - - // search stacks with 'java' value - newWorkspace.typeToSearchInput("java"); - newWorkspace.clickOnSingleMachineTab(); - assertTrue(newWorkspace.isStackVisible(JAVA)); - assertFalse(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clickOnAllStacksTab(); - assertTrue(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clearTextInSearchInput(); - - // search stacks with 'mysql' value - newWorkspace.typeToSearchInput("mysql"); - newWorkspace.clickOnMultiMachineTab(); - assertTrue(newWorkspace.isStackVisible(JAVA_MYSQL)); - newWorkspace.clickOnAllStacksTab(); - assertTrue(newWorkspace.isStackVisible(JAVA_MYSQL)); - - // search stacks with 'blank' value - newWorkspace.typeToSearchInput("blank"); - assertTrue(newWorkspace.isStackVisible(BLANK)); - newWorkspace.clickOnMultiMachineTab(); - assertFalse(newWorkspace.isStackVisible(BLANK)); - - newWorkspace.clearTextInSearchInput(); - } - - @Test(groups = {TestGroup.OPENSHIFT}) - public void checkSearchStackFeatureOpenshift() { - - // search stacks with 'java' value - newWorkspace.typeToSearchInput("java"); - newWorkspace.clickOnSingleMachineTab(); - assertTrue(newWorkspace.isStackVisible(JAVA)); - assertFalse(newWorkspace.isStackVisible(JAVA_MYSQL_THEIA_ON_KUBERNETES)); - newWorkspace.clickOnAllStacksTab(); - assertTrue(newWorkspace.isStackVisible(JAVA_MYSQL_THEIA_ON_KUBERNETES)); - newWorkspace.clearTextInSearchInput(); - - // search stacks with 'mysql' value - newWorkspace.typeToSearchInput("che 7"); - newWorkspace.clickOnAllStacksTab(); - assertTrue(newWorkspace.isStackVisible(CHE_7_PREVIEW)); - newWorkspace.clickOnMultiMachineTab(); - assertFalse(newWorkspace.isStackVisible(CHE_7_PREVIEW)); - - // search stacks with 'blank' value - newWorkspace.clickOnSingleMachineTab(); - newWorkspace.typeToSearchInput("blank"); - assertTrue(newWorkspace.isStackVisible(BLANK)); - newWorkspace.clickOnMultiMachineTab(); - assertFalse(newWorkspace.isStackVisible(BLANK)); - - newWorkspace.clearTextInSearchInput(); - } - @Test public void checkProjectSourcePage() { - newWorkspace.clickOnAllStacksTab(); - // add a project from the 'web-java-spring' sample - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); projectSourcePage.clickOnAddOrImportProjectButton(); projectSourcePage.selectSample(projectName); projectSourcePage.clickOnAddProjectButton(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportMavenProjectFromGitTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportMavenProjectFromGitTest.java index cc76201c1fb..672ab64c68c 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportMavenProjectFromGitTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportMavenProjectFromGitTest.java @@ -12,7 +12,6 @@ package org.eclipse.che.selenium.dashboard; import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Sources.GIT; import com.google.inject.Inject; @@ -30,6 +29,7 @@ import org.eclipse.che.selenium.pageobject.ToastLoader; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.AfterClass; @@ -82,8 +82,7 @@ public void checkAbilityImportMavenProjectTest() { newWorkspace.waitToolbar(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE); projectSourcePage.clickOnAddOrImportProjectButton(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromGitHubTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromGitHubTest.java index 236dec525a5..d753de423ae 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromGitHubTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromGitHubTest.java @@ -14,7 +14,6 @@ import static org.eclipse.che.commons.lang.NameGenerator.generate; import static org.eclipse.che.selenium.core.utils.WaitUtils.sleepQuietly; import static org.eclipse.che.selenium.pageobject.ProjectExplorer.FolderTypes.PROJECT_FOLDER; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Sources.GITHUB; import static org.testng.AssertJUnit.assertTrue; @@ -35,6 +34,7 @@ import org.eclipse.che.selenium.pageobject.ToastLoader; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.AfterClass; @@ -99,8 +99,7 @@ public void checkAbilityImportProjectFromGithub() { workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE); projectSourcePage.clickOnAddOrImportProjectButton(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromZipTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromZipTest.java index 47ea6dc1095..9cd0faa1271 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromZipTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/ImportProjectFromZipTest.java @@ -12,7 +12,6 @@ package org.eclipse.che.selenium.dashboard; import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage.Sources.ZIP; import com.google.inject.Inject; @@ -30,6 +29,7 @@ import org.eclipse.che.selenium.pageobject.ToastLoader; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.AfterClass; @@ -84,8 +84,7 @@ public void importProjectFromZipTest() { newWorkspace.waitToolbar(); // we are selecting 'Java' stack from the 'All Stack' tab for compatibility with OSIO - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE); projectSourcePage.clickOnAddOrImportProjectButton(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/AddWorkspaceToOrganizationTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/AddWorkspaceToOrganizationTest.java index b774a90ae72..1dc7a9f7b72 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/AddWorkspaceToOrganizationTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/AddWorkspaceToOrganizationTest.java @@ -13,7 +13,6 @@ import static org.eclipse.che.commons.lang.NameGenerator.generate; import static org.eclipse.che.selenium.pageobject.dashboard.NavigationBar.MenuItem.ORGANIZATIONS; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; @@ -25,6 +24,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.CheMultiuserAdminDashboard; import org.eclipse.che.selenium.pageobject.dashboard.NavigationBar; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.organization.OrganizationListPage; import org.eclipse.che.selenium.pageobject.dashboard.organization.OrganizationPage; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails; @@ -164,7 +164,7 @@ private void createWorkspace(String organizationName, String workspaceName) { newWorkspace.waitToolbar(); newWorkspace.openOrganizationsList(); newWorkspace.selectOrganizationFromList(organizationName); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(workspaceName); newWorkspace.clickOnCreateButtonAndEditWorkspace(); workspaceDetails.waitToolbarTitleName(workspaceName); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceMemberTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceMemberTest.java index 2a642aa1633..62620c4f3f3 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceMemberTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceMemberTest.java @@ -15,7 +15,6 @@ import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Project.New.FILE; import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Project.New.NEW; import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Project.PROJECT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.OVERVIEW; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.SHARE; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces.Status.STOPPED; @@ -38,6 +37,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.CheMultiuserAdminDashboard; import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; import org.eclipse.che.selenium.pageobject.dashboard.NavigationBar; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.StateWorkspace; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceOverview; @@ -179,7 +179,8 @@ public void checkSharingByAddedMember() { } private void createWorkspace(String workspaceName) { - createWorkspaceHelper.createWorkspaceFromStackWithProject(JAVA, workspaceName, PROJECT_NAME); + createWorkspaceHelper.createWorkspaceFromStackWithProject( + Stack.JAVA_MAVEN, workspaceName, PROJECT_NAME); ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceOwnerTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceOwnerTest.java index 790b223e546..dfb9a9c120e 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceOwnerTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/organization/ShareWorkspaceOwnerTest.java @@ -12,7 +12,6 @@ package org.eclipse.che.selenium.dashboard.organization; import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.SHARE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; @@ -29,6 +28,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.CheMultiuserAdminDashboard; import org.eclipse.che.selenium.pageobject.dashboard.NavigationBar; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceShare; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; @@ -164,7 +164,7 @@ private void createWorkspace(String organizationName, String workspaceName) { newWorkspace.waitToolbar(); newWorkspace.openOrganizationsList(); newWorkspace.selectOrganizationFromList(organizationName); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(workspaceName); newWorkspace.clickOnCreateButtonAndEditWorkspace(); workspaceDetails.waitToolbarTitleName(workspaceName); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/AddOrImportProjectFormTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/AddOrImportProjectFormTest.java index 6163616b0da..69d0c8ca1e0 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/AddOrImportProjectFormTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/AddOrImportProjectFormTest.java @@ -147,7 +147,7 @@ public void prepareToTestMethod() { public void checkOfCheckboxes() { // preparing newWorkspace.waitPageLoad(); - newWorkspace.selectStack(Stack.JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.waitAddOrImportFormOpened(); addOrImportForm.waitSamplesButtonSelected(); @@ -193,7 +193,7 @@ public void checkOfCheckboxes() { public void checkProjectSamples() { // preparing newWorkspace.waitPageLoad(); - newWorkspace.selectStack(Stack.JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.waitAddOrImportFormOpened(); addOrImportForm.waitSamplesButtonSelected(); @@ -341,8 +341,8 @@ public void checkProjectSamples() { public void checkProjectsBlank() throws Exception { // preparing newWorkspace.waitPageLoad(); - newWorkspace.selectStack(Stack.BLANK); - newWorkspace.waitStackSelected(Stack.BLANK); + newWorkspace.selectStack(Stack.JAVA_MAVEN); + newWorkspace.waitStackSelected(Stack.JAVA_MAVEN); addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.waitAddOrImportFormOpened(); addOrImportForm.clickOnBlankButton(); @@ -401,7 +401,6 @@ public void checkProjectsBlank() throws Exception { addOrImportForm.waitAddOrImportFormOpened(); addOrImportForm.clickOnGitHubButton(); - newWorkspace.setMachineRAM("dev-machine", 5.0); newWorkspace.typeWorkspaceName(WORKSPACE_NAME); newWorkspace.clickOnCreateButtonAndEditWorkspace(); @@ -421,14 +420,10 @@ public void checkCreatingProject() throws Exception { newWorkspace.waitStackSelected(Stack.DOT_NET); assertEquals(newWorkspace.getWorkspaceNameValue(), TEST_BLANK_WORKSPACE_NAME); - newWorkspace.selectStack(Stack.JAVA); - newWorkspace.waitStackSelected(Stack.JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); + newWorkspace.waitStackSelected(Stack.JAVA_MAVEN); assertEquals(newWorkspace.getWorkspaceNameValue(), TEST_BLANK_WORKSPACE_NAME); - // add workspace with specified "RAM" value - newWorkspace.setMachineRAM("dev-machine", 3.0); - newWorkspace.waitRamValue("dev-machine", 3.0); - addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.waitAddOrImportFormOpened(); @@ -499,8 +494,8 @@ private void prepareJavaWorkspace(String workspaceName) { newWorkspace.waitPageLoad(); newWorkspace.typeWorkspaceName(workspaceName); - newWorkspace.selectStack(Stack.JAVA); - newWorkspace.waitStackSelected(Stack.JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); + newWorkspace.waitStackSelected(Stack.JAVA_MAVEN); addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.waitAddOrImportFormOpened(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/NewWorkspacePageTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/NewWorkspacePageTest.java index 6e9e01d68e8..e8e48d1fbd9 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/NewWorkspacePageTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/NewWorkspacePageTest.java @@ -13,57 +13,15 @@ import static java.util.Arrays.asList; import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ANDROID; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.BLANK; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CAMEL_SPRINGBOOT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CAMEL_SPRINGBOOT_CHE7; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_BLANK; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_GO; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_NODEJS; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_WILDFLY_SWARM; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CEYLON_WITH_JAVA_JAVASCRIPT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_PREVIEW; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_PREVIEW_DEV; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_THEIA_DEV; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CPP; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.DOT_NET; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.DOT_NET_DEFAULT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ECLIPSE_CHE; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ECLIPSE_VERTX; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.GO; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.GO_DEFAULT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_CENTOS; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_GRADLE; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MAVEN; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL_CENTOS; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL_THEIA_ON_KUBERNETES; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_THEIA_DOCKER; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.KOTLIN; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.NODE; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.NODEJS_AND_POSTGRES; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PHP; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PHP_CHE7; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PHP_MYSQL_CHE7; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PYTHON; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PYTHON_DEFAULT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.RAILS; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.SPRING_BOOT; -import static org.openqa.selenium.Keys.ARROW_DOWN; -import static org.openqa.selenium.Keys.ARROW_UP; -import static org.openqa.selenium.Keys.ESCAPE; import static org.testng.Assert.assertEquals; import com.google.inject.Inject; import java.util.List; import org.eclipse.che.selenium.core.SeleniumWebDriver; -import org.eclipse.che.selenium.core.TestGroup; import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; -import org.openqa.selenium.Keys; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -71,297 +29,9 @@ /** @author Ihor Okhrimenko */ public class NewWorkspacePageTest { private static final String EXPECTED_WORKSPACE_NAME_PREFIX = "wksp-"; - private static final String MACHINE_NAME = "dev-machine"; - private static final double MAX_RAM_VALUE = 100.0; - private static final double MIN_RAM_VALUE = 0.1; - private static final double RAM_CHANGE_STEP = 0.1; - private static final String JDK_SUGGESTION_TITLE = "JDK"; - private static final String JAVA_SUGGESTION_TITLE = "JAVA"; - private static final String JAVA_1_8_SUGGESTION_TITLE = "JAVA 1.8"; - private static final String JAVA_TOMCAT_MYSQL_SUGGESTION_TITLE = "JAVA 1.8, TOMCAT 8, MYSQL 5.7"; private static final String NAME_WITH_ONE_HUNDRED_SYMBOLS = generate("wksp-", 95); private static final List NOT_VALID_NAMES = asList("wksp-", "-wksp", "wk sp", "wk_sp", "wksp@", "wksp$", "wksp&", "wksp*"); - private static final String LETTER_FOR_SEARCHING = "j"; - private static final List EXPECTED_JDK_STACKS = asList(JAVA, ECLIPSE_CHE); - - private static List EXPECTED_OPENSHIFT_QUICK_START_STACKS = - asList( - BLANK, - JAVA, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CPP, - CHE_7_PREVIEW, - CHE_7_PREVIEW_DEV, - CHE_7_THEIA_DEV, - ECLIPSE_CHE, - GO_DEFAULT, - GO, - JAVA_MYSQL_THEIA_ON_KUBERNETES, - JAVA_GRADLE, - JAVA_MAVEN, - NODE, - PHP, - PHP_MYSQL_CHE7, - PHP_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS); - - private static List EXPECTED_K8S_QUICK_START_STACKS = - asList( - BLANK, - JAVA, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CPP, - CHE_7_PREVIEW, - CHE_7_PREVIEW_DEV, - CHE_7_THEIA_DEV, - ECLIPSE_CHE, - GO_DEFAULT, - GO, - JAVA_MYSQL_THEIA_ON_KUBERNETES, - JAVA_GRADLE, - JAVA_MAVEN, - NODE, - PHP, - PHP_CHE7, - PHP_MYSQL_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS); - - private static final List EXPECTED_DOCKER_QUICK_START_STACKS = - asList( - BLANK, - JAVA, - JAVA_MYSQL, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CPP, - ECLIPSE_CHE, - GO_DEFAULT, - GO, - JAVA_GRADLE, - JAVA_MAVEN, - NODE, - PHP, - PHP_CHE7, - PHP_MYSQL_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS, - JAVA_THEIA_DOCKER); - - private static List EXPECTED_OPENSHIFT_SINGLE_MACHINE_STACKS = - asList( - BLANK, - JAVA, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CAMEL_SPRINGBOOT, - CPP, - CENTOS_BLANK, - CENTOS_GO, - CENTOS_NODEJS, - CENTOS_WILDFLY_SWARM, - CEYLON_WITH_JAVA_JAVASCRIPT, - CHE_7_PREVIEW, - CHE_7_PREVIEW_DEV, - CHE_7_THEIA_DEV, - ECLIPSE_CHE, - ECLIPSE_VERTX, - GO_DEFAULT, - GO, - JAVA_CENTOS, - JAVA_GRADLE, - JAVA_MAVEN, - KOTLIN, - NODE, - PHP, - PHP_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS, - SPRING_BOOT); - - private static List EXPECTED_K8S_SINGLE_MACHINE_STACKS = - asList( - BLANK, - JAVA, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CAMEL_SPRINGBOOT, - CPP, - CENTOS_BLANK, - CENTOS_GO, - CENTOS_NODEJS, - CENTOS_WILDFLY_SWARM, - CEYLON_WITH_JAVA_JAVASCRIPT, - CHE_7_PREVIEW, - CHE_7_PREVIEW_DEV, - CHE_7_THEIA_DEV, - ECLIPSE_CHE, - ECLIPSE_VERTX, - GO_DEFAULT, - GO, - JAVA_CENTOS, - JAVA_GRADLE, - JAVA_MAVEN, - KOTLIN, - NODE, - PHP, - PHP_CHE7, - PHP_MYSQL_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS, - SPRING_BOOT); - - private static List EXPECTED_DOCKER_SINGLE_MACHINE_STACKS = - asList( - BLANK, - JAVA, - DOT_NET_DEFAULT, - DOT_NET, - ANDROID, - CAMEL_SPRINGBOOT_CHE7, - CAMEL_SPRINGBOOT, - CPP, - CENTOS_BLANK, - CENTOS_GO, - CENTOS_NODEJS, - CENTOS_WILDFLY_SWARM, - CEYLON_WITH_JAVA_JAVASCRIPT, - ECLIPSE_CHE, - ECLIPSE_VERTX, - GO_DEFAULT, - GO, - JAVA_CENTOS, - JAVA_GRADLE, - JAVA_MAVEN, - KOTLIN, - NODE, - PHP, - PHP_CHE7, - PYTHON_DEFAULT, - PYTHON, - RAILS, - SPRING_BOOT); - - private static final List EXPECTED_OPENSHIFT_MULTI_MACHINE_STACKS = - asList(JAVA_MYSQL_THEIA_ON_KUBERNETES, NODEJS_AND_POSTGRES, PHP_MYSQL_CHE7); - - private static final List EXPECTED_K8S_MULTI_MACHINE_STACKS = - asList(JAVA_MYSQL_THEIA_ON_KUBERNETES, NODEJS_AND_POSTGRES); - - private static final List EXPECTED_DOCKER_MULTI_MACHINE_STACKS = - asList(JAVA_MYSQL, JAVA_MYSQL_CENTOS, JAVA_THEIA_DOCKER); - - private static final List - EXPECTED_OPENSHIFT_QUICK_START_STACKS_REVERSE_ORDER = - asList( - JAVA, - BLANK, - RAILS, - PYTHON, - PYTHON_DEFAULT, - PHP_CHE7, - PHP_MYSQL_CHE7, - PHP, - NODE, - JAVA_MAVEN, - JAVA_GRADLE, - JAVA_MYSQL_THEIA_ON_KUBERNETES, - GO, - GO_DEFAULT, - ECLIPSE_CHE, - CHE_7_THEIA_DEV, - CHE_7_PREVIEW_DEV, - CHE_7_PREVIEW, - CPP, - CAMEL_SPRINGBOOT_CHE7, - ANDROID, - DOT_NET, - DOT_NET_DEFAULT); - - private static final List EXPECTED_K8S_QUICK_START_STACKS_REVERSE_ORDER = - asList( - JAVA, - BLANK, - RAILS, - PYTHON, - PYTHON_DEFAULT, - PHP, - PHP_CHE7, - PHP_MYSQL_CHE7, - NODE, - JAVA_MAVEN, - JAVA_GRADLE, - JAVA_MYSQL_THEIA_ON_KUBERNETES, - GO, - GO_DEFAULT, - ECLIPSE_CHE, - CHE_7_THEIA_DEV, - CHE_7_PREVIEW_DEV, - CHE_7_PREVIEW, - CPP, - CAMEL_SPRINGBOOT_CHE7, - ANDROID, - DOT_NET, - DOT_NET_DEFAULT); - - private static final List EXPECTED_DOCKER_QUICK_START_STACKS_REVERSE_ORDER = - asList( - JAVA_MYSQL, - JAVA, - BLANK, - JAVA_THEIA_DOCKER, - RAILS, - PYTHON, - PYTHON_DEFAULT, - PHP_CHE7, - PHP_MYSQL_CHE7, - PHP, - NODE, - JAVA_MAVEN, - JAVA_GRADLE, - GO, - GO_DEFAULT, - ECLIPSE_CHE, - CPP, - CAMEL_SPRINGBOOT_CHE7, - ANDROID, - DOT_NET, - DOT_NET_DEFAULT); - - private static final List EXPECTED_OPENSHIFT_JAVA_STACKS = - asList(JAVA, ANDROID, ECLIPSE_CHE, JAVA_MYSQL_THEIA_ON_KUBERNETES); - - private static final List EXPECTED_DOCKER_JAVA_STACKS = - asList(JAVA, JAVA_MYSQL, ECLIPSE_CHE, ANDROID); - - private static final List EXPECTED_OPENSHIFT_FILTERS_SUGGESTIONS = - asList(JAVA_SUGGESTION_TITLE, JDK_SUGGESTION_TITLE, JAVA_1_8_SUGGESTION_TITLE); - - private static final List EXPECTED_K8S_FILTERS_SUGGESTIONS = - asList(JAVA_SUGGESTION_TITLE, JDK_SUGGESTION_TITLE); - - private static final List EXPECTED_DOCKER_FILTERS_SUGGESTIONS = - asList(JAVA_SUGGESTION_TITLE, JDK_SUGGESTION_TITLE, JAVA_TOMCAT_MYSQL_SUGGESTION_TITLE); - private static final List VALID_NAMES = asList("Wk-sp", "Wk-sp1", "9wk-sp", "5wk-sp0", "Wk19sp", "Wksp-01"); @@ -426,301 +96,6 @@ public void checkNameField() { checkValidNames(); } - @Test(groups = {TestGroup.OPENSHIFT}) - public void checkOpenshiftStackButtons() { - checkStackButtons( - EXPECTED_OPENSHIFT_QUICK_START_STACKS, - EXPECTED_OPENSHIFT_SINGLE_MACHINE_STACKS, - EXPECTED_OPENSHIFT_MULTI_MACHINE_STACKS, - EXPECTED_OPENSHIFT_QUICK_START_STACKS_REVERSE_ORDER); - } - - @Test(groups = {TestGroup.K8S}) - public void checkK8SStackButtons() { - checkStackButtons( - EXPECTED_K8S_QUICK_START_STACKS, - EXPECTED_K8S_SINGLE_MACHINE_STACKS, - EXPECTED_K8S_MULTI_MACHINE_STACKS, - EXPECTED_K8S_QUICK_START_STACKS_REVERSE_ORDER); - } - - @Test(groups = TestGroup.DOCKER) - public void checkDockerStackButtons() { - checkStackButtons( - EXPECTED_DOCKER_QUICK_START_STACKS, - EXPECTED_DOCKER_SINGLE_MACHINE_STACKS, - EXPECTED_DOCKER_MULTI_MACHINE_STACKS, - EXPECTED_DOCKER_QUICK_START_STACKS_REVERSE_ORDER); - } - - @Test(groups = {TestGroup.OPENSHIFT}) - public void checkOpenshiftFiltersButton() { - checkFiltersButton( - EXPECTED_OPENSHIFT_FILTERS_SUGGESTIONS, EXPECTED_OPENSHIFT_QUICK_START_STACKS); - } - - @Test(groups = {TestGroup.K8S}) - public void checkK8SFiltersButton() { - checkFiltersButton(EXPECTED_K8S_FILTERS_SUGGESTIONS, EXPECTED_K8S_QUICK_START_STACKS); - } - - @Test(groups = TestGroup.DOCKER) - public void checkDockerFiltersButton() { - checkFiltersButton(EXPECTED_DOCKER_FILTERS_SUGGESTIONS, EXPECTED_DOCKER_QUICK_START_STACKS); - } - - @Test - public void checkAddStackButton() { - newWorkspace.waitPageLoad(); - - // close form by "ESCAPE" button - newWorkspace.clickOnAddStackButton(); - newWorkspace.waitCreateStackDialog(); - seleniumWebDriverHelper.sendKeys(ESCAPE.toString()); - newWorkspace.waitCreateStackDialogClosing(); - - // close form by clicking on outside of form bounds - newWorkspace.clickOnAddStackButton(); - newWorkspace.waitCreateStackDialog(); - newWorkspace.clickOnTitlePlaceCoordinate(); - newWorkspace.waitCreateStackDialogClosing(); - - // close form by "Close" button - newWorkspace.clickOnAddStackButton(); - newWorkspace.waitCreateStackDialog(); - newWorkspace.closeCreateStackDialogByCloseButton(); - newWorkspace.waitCreateStackDialogClosing(); - - // close form by "Cancel" button - newWorkspace.clickOnAddStackButton(); - newWorkspace.waitCreateStackDialog(); - newWorkspace.clickOnNoButtonInCreateStackDialog(); - newWorkspace.waitCreateStackDialogClosing(); - } - - @Test(groups = TestGroup.OPENSHIFT) - public void checkOpenshiftSearchField() { - checkSearchField(EXPECTED_OPENSHIFT_JAVA_STACKS, EXPECTED_OPENSHIFT_QUICK_START_STACKS); - } - - @Test(groups = TestGroup.DOCKER) - public void checkDockerSearchField() { - checkSearchField(EXPECTED_DOCKER_JAVA_STACKS, EXPECTED_DOCKER_QUICK_START_STACKS); - } - - @Test - public void checkRamSelection() { - newWorkspace.waitPageLoad(); - - // empty RAM - newWorkspace.selectStack(JAVA); - newWorkspace.waitStackSelected(JAVA); - newWorkspace.waitRamValue(MACHINE_NAME, 2.0); - newWorkspace.typeToRamField(""); - newWorkspace.waitRedRamFieldBorders(); - newWorkspace.waitTopCreateWorkspaceButtonDisabled(); - newWorkspace.waitBottomCreateWorkspaceButtonDisabled(); - - // max valid value - newWorkspace.typeToRamField(Double.toString(MAX_RAM_VALUE)); - newWorkspace.waitRedRamFieldBordersDisappearance(); - newWorkspace.waitTopCreateWorkspaceButtonEnabled(); - newWorkspace.waitBottomCreateWorkspaceButtonEnabled(); - - // increment and decrement buttons with max valid value - newWorkspace.clickOnIncrementMemoryButton(MACHINE_NAME); - newWorkspace.waitRamValue(MACHINE_NAME, MAX_RAM_VALUE); - - newWorkspace.clickOnDecrementMemoryButton(MACHINE_NAME); - newWorkspace.waitRamValue(MACHINE_NAME, MAX_RAM_VALUE - RAM_CHANGE_STEP); - - // min valid value - newWorkspace.typeToRamField(""); - newWorkspace.waitRedRamFieldBorders(); - newWorkspace.waitTopCreateWorkspaceButtonDisabled(); - newWorkspace.waitBottomCreateWorkspaceButtonDisabled(); - - newWorkspace.typeToRamField(Double.toString(MIN_RAM_VALUE)); - newWorkspace.waitRedRamFieldBordersDisappearance(); - newWorkspace.waitTopCreateWorkspaceButtonEnabled(); - newWorkspace.waitBottomCreateWorkspaceButtonEnabled(); - - // increment and decrement buttons with min valid value - newWorkspace.clickOnDecrementMemoryButton(MACHINE_NAME); - newWorkspace.waitRamValue(MACHINE_NAME, MIN_RAM_VALUE); - newWorkspace.clickOnIncrementMemoryButton(MACHINE_NAME); - newWorkspace.waitRamValue(MACHINE_NAME, MIN_RAM_VALUE + RAM_CHANGE_STEP); - - // increment and decrement by click and hold - newWorkspace.clickAndHoldIncrementMemoryButton(MACHINE_NAME, 3); - newWorkspace.waitRamValueInSpecifiedRange(MACHINE_NAME, 3, MAX_RAM_VALUE); - - double currentRamAmount = newWorkspace.getRAM(MACHINE_NAME); - newWorkspace.clickAndHoldDecrementMemoryButton(MACHINE_NAME, 3); - newWorkspace.waitRamValueInSpecifiedRange(MACHINE_NAME, MIN_RAM_VALUE, currentRamAmount - 2); - } - - private void checkStackButtons( - List expectedQuickStartStacks, - List expectedSingleMachineStacks, - List expectedMultiMachineStacks, - List expectedQuickStartStacksReverseOrder) { - - newWorkspace.waitPageLoad(); - newWorkspace.waitQuickStartButton(); - newWorkspace.waitStacks(expectedQuickStartStacks); - newWorkspace.waitStacksCount(expectedQuickStartStacks.size()); - - // single machine stacks - newWorkspace.clickOnSingleMachineButton(); - newWorkspace.waitStacks(expectedSingleMachineStacks); - newWorkspace.waitStacksCount(expectedSingleMachineStacks.size()); - - // multi-machine stacks - newWorkspace.clickOnMultiMachineButton(); - newWorkspace.waitStacks(expectedMultiMachineStacks); - newWorkspace.waitStacksCount(expectedMultiMachineStacks.size()); - - // check that only expected stacks are displayed and no duplicates are presented and also checks - // "All" stacks - newWorkspace.clickOnAllButton(); - newWorkspace.waitStacks(expectedSingleMachineStacks); - newWorkspace.waitStacks(expectedMultiMachineStacks); - newWorkspace.waitStacksCount( - expectedSingleMachineStacks.size() + expectedMultiMachineStacks.size()); - - // quick start stacks - newWorkspace.clickOnQuickStartButton(); - newWorkspace.waitStacksOrder(expectedQuickStartStacks); - newWorkspace.clickNameButton(); - newWorkspace.waitStacksOrder(expectedQuickStartStacksReverseOrder); - - newWorkspace.clickNameButton(); - newWorkspace.waitStacksOrder(expectedQuickStartStacks); - } - - private void checkFiltersButton( - List expectedSuggestions, List expectedQuickStartStacks) { - newWorkspace.waitPageLoad(); - - // close by "Escape" button - newWorkspace.clickOnFiltersButton(); - newWorkspace.waitFiltersFormOpened(); - seleniumWebDriverHelper.sendKeys(ESCAPE.toString()); - newWorkspace.waitFiltersFormClosed(); - - // close by clicking on the outside of the "Filters" form - newWorkspace.clickOnFiltersButton(); - newWorkspace.waitFiltersFormOpened(); - newWorkspace.clickOnTitlePlaceCoordinate(); - newWorkspace.waitFiltersFormClosed(); - - // check suggestion list - newWorkspace.clickOnFiltersButton(); - newWorkspace.waitFiltersFormOpened(); - newWorkspace.typeToFiltersInput(LETTER_FOR_SEARCHING); - newWorkspace.waitFiltersSuggestionsNames(expectedSuggestions); - - assertEquals( - newWorkspace.getSelectedFiltersSuggestionName(), - newWorkspace.getFiltersSuggestionsNames().get(0)); - - // check navigation by keyboard arrows between suggested tags - seleniumWebDriverHelper.sendKeys(ARROW_DOWN.toString()); - newWorkspace.waitSelectedFiltersSuggestion(JDK_SUGGESTION_TITLE); - - seleniumWebDriverHelper.sendKeys(ARROW_UP.toString()); - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - - // interaction with suggested tads by mouse clicking - newWorkspace.clickOnFiltersSuggestions(JAVA_SUGGESTION_TITLE); - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - - newWorkspace.clickOnFiltersSuggestions(JDK_SUGGESTION_TITLE); - newWorkspace.waitSelectedFiltersSuggestion(JDK_SUGGESTION_TITLE); - - newWorkspace.doubleClickOnFiltersSuggestion(JDK_SUGGESTION_TITLE); - newWorkspace.waitFiltersInputTags(asList(JDK_SUGGESTION_TITLE)); - - newWorkspace.deleteLastTagFromInputTagsField(); - newWorkspace.waitFiltersInputIsEmpty(); - - // delete tags from input - newWorkspace.typeToFiltersInput(LETTER_FOR_SEARCHING); - newWorkspace.waitFiltersSuggestionsNames(expectedSuggestions); - - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - newWorkspace.doubleClickOnFiltersSuggestion(JAVA_SUGGESTION_TITLE); - newWorkspace.waitFiltersInputTags(asList(JAVA_SUGGESTION_TITLE)); - newWorkspace.deleteTagByRemoveButton(JAVA_SUGGESTION_TITLE); - newWorkspace.waitFiltersInputIsEmpty(); - - newWorkspace.typeToFiltersInput(LETTER_FOR_SEARCHING); - newWorkspace.waitFiltersSuggestionsNames(expectedSuggestions); - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - newWorkspace.chooseFilterSuggestionByPlusButton(JDK_SUGGESTION_TITLE); - newWorkspace.waitFiltersInputTags(asList(JDK_SUGGESTION_TITLE)); - newWorkspace.clickOnInputFieldTag(JDK_SUGGESTION_TITLE); - seleniumWebDriverHelper.sendKeys(Keys.DELETE.toString()); - newWorkspace.waitFiltersInputIsEmpty(); - - newWorkspace.typeToFiltersInput(LETTER_FOR_SEARCHING); - newWorkspace.waitFiltersSuggestionsNames(expectedSuggestions); - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - newWorkspace.chooseFilterSuggestionByPlusButton(JAVA_SUGGESTION_TITLE); - newWorkspace.waitFiltersInputTags(asList(JAVA_SUGGESTION_TITLE)); - newWorkspace.clickOnInputFieldTag(JAVA_SUGGESTION_TITLE); - seleniumWebDriverHelper.sendKeys(Keys.DELETE.toString()); - newWorkspace.waitFiltersInputIsEmpty(); - newWorkspace.deleteLastTagFromInputTagsField(); - - // navigation by "Tab" button - newWorkspace.typeToFiltersInput(LETTER_FOR_SEARCHING); - newWorkspace.waitSelectedFiltersSuggestion(JAVA_SUGGESTION_TITLE); - seleniumWebDriverHelper.sendKeys(Keys.TAB.toString()); - newWorkspace.waitSelectedFiltersSuggestion(JDK_SUGGESTION_TITLE); - seleniumWebDriverHelper.sendKeys(Keys.ENTER.toString()); - newWorkspace.waitFiltersInputTags(asList(JDK_SUGGESTION_TITLE)); - newWorkspace.clickOnTitlePlaceCoordinate(); - newWorkspace.waitFiltersFormClosed(); - - newWorkspace.getAvailableStacks(); - newWorkspace.waitStacks(EXPECTED_JDK_STACKS); - - newWorkspace.clickOnFiltersButton(); - newWorkspace.waitFiltersFormOpened(); - newWorkspace.waitFiltersInputTags(asList(JDK_SUGGESTION_TITLE)); - newWorkspace.deleteLastTagFromInputTagsField(); - newWorkspace.waitFiltersInputIsEmpty(); - newWorkspace.clickOnTitlePlaceCoordinate(); - newWorkspace.waitFiltersFormClosed(); - newWorkspace.waitStacks(expectedQuickStartStacks); - } - - private void checkSearchField( - List expectedJavaStacks, - List expectedQuickStartStacks) { - newWorkspace.waitPageLoad(); - - newWorkspace.typeToSearchInput("Java"); - newWorkspace.waitStacks(expectedJavaStacks); - - newWorkspace.typeToSearchInput(""); - newWorkspace.waitStacks(expectedQuickStartStacks); - - newWorkspace.typeToSearchInput("java"); - newWorkspace.waitStacks(expectedJavaStacks); - - newWorkspace.typeToSearchInput(""); - newWorkspace.waitStacks(expectedQuickStartStacks); - - newWorkspace.typeToSearchInput("JAVA"); - newWorkspace.waitStacks(expectedJavaStacks); - - newWorkspace.typeToSearchInput(""); - newWorkspace.waitStacks(expectedQuickStartStacks); - } - private void checkNotValidNames() { NOT_VALID_NAMES.forEach( name -> { diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/WorkspacesListTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/WorkspacesListTest.java index 704eb2d74e8..81307858259 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/WorkspacesListTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/WorkspacesListTest.java @@ -15,7 +15,6 @@ import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR; import static org.eclipse.che.selenium.core.project.ProjectTemplates.MAVEN_SPRING; import static org.eclipse.che.selenium.core.workspace.WorkspaceTemplate.UBUNTU_JDK8; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.BLANK; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; @@ -34,6 +33,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.DocumentationPage; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceConfig; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceOverview; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceProjects; @@ -339,7 +339,7 @@ public void checkWorkspaceActions() throws Exception { workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); newWorkspace.typeWorkspaceName(NEWEST_CREATED_WORKSPACE_NAME); - newWorkspace.selectStack(BLANK); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.clickOnCreateButtonAndEditWorkspace(); workspaceOverview.checkNameWorkspace(NEWEST_CREATED_WORKSPACE_NAME); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsComposeTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsComposeTest.java deleted file mode 100644 index d71be245d9b..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsComposeTest.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.dashboard.workspaces.details; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL; -import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.StateWorkspace.STOPPED; -import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.ENV_VARIABLES; -import static org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails.WorkspaceDetailsTab.MACHINES; -import static org.testng.Assert.assertTrue; -import static org.testng.Assert.fail; - -import com.google.common.collect.ImmutableMap; -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.TestGroup; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.utils.WaitUtils; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.Loader; -import org.eclipse.che.selenium.pageobject.ToastLoader; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; -import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceDetails; -import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceEnvVariables; -import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceMachines; -import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; -import org.openqa.selenium.TimeoutException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -@Test(groups = {TestGroup.DOCKER}) -public class WorkspaceDetailsComposeTest { - - private static final String WORKSPACE = generate("java-mysql", 4); - private static final ImmutableMap EXPECTED_VARIABLES = - ImmutableMap.of( - "MYSQL_DATABASE", "petclinic", - "MYSQL_PASSWORD", "password", - "MYSQL_ROOT_PASSWORD", "password", - "MYSQL_USER", "petclinic"); - - @Inject private DefaultTestUser testUser; - @Inject private Loader loader; - @Inject private NewWorkspace newWorkspace; - @Inject private Dashboard dashboard; - @Inject private WorkspaceDetails workspaceDetails; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - @Inject private Consoles consoles; - @Inject private Workspaces workspaces; - @Inject private WorkspaceMachines workspaceMachines; - @Inject private WorkspaceEnvVariables workspaceEnvVariables; - @Inject private Ide ide; - @Inject private ToastLoader toastLoader; - - @BeforeClass - public void setUp() throws Exception { - createWsFromJavaMySqlStack(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE, testUser.getName()); - } - - @Test - public void workingWithEnvVariables() { - workspaceDetails.selectTabInWorkspaceMenu(ENV_VARIABLES); - - // create a new variable, save changes and check it exists - workspaceMachines.selectMachine("Environment variables", "dev-machine"); - createVariable("logi", "admin"); - clickOnSaveButton(); - assertTrue(workspaceEnvVariables.checkEnvVariableExists("logi")); - - // rename the variable, save changes and check it is renamed - assertTrue(workspaceEnvVariables.checkValueExists("logi", "admin")); - workspaceEnvVariables.clickOnEditEnvVariableButton("logi"); - workspaceEnvVariables.enterEnvVariableName("login"); - workspaceDetails.clickOnUpdateButtonInDialogWindow(); - clickOnSaveButton(); - assertTrue(workspaceEnvVariables.checkEnvVariableExists("login")); - assertTrue(workspaceEnvVariables.checkValueExists("login", "admin")); - - // delete the variable, save changes and check it is not exists - deleteVariable("login", "admin"); - clickOnSaveButton(); - workspaceEnvVariables.checkValueIsNotExists("login", "admin"); - - workspaceMachines.selectMachine("Environment variables", "db"); - // add variables to 'db' machine, check they exist and save changes - EXPECTED_VARIABLES.forEach( - (name, value) -> { - WaitUtils.sleepQuietly(1); - createVariable(name, value); - assertTrue(workspaceEnvVariables.checkEnvVariableExists(name)); - assertTrue(workspaceEnvVariables.checkValueExists(name, value)); - }); - clickOnSaveButton(); - - // delete all variables from the 'db' machine, check they don't exist and save changes - EXPECTED_VARIABLES.forEach( - (name, value) -> { - deleteVariable(name, value); - }); - - clickOnSaveButton(); - } - - @Test(groups = UNDER_REPAIR) - public void workingWithMachines() { - String machineName = "new_machine"; - - // check that all machines of the Java-MySql stack created by default exist - workspaceDetails.selectTabInWorkspaceMenu(MACHINES); - workspaceMachines.checkMachineExists("db"); - workspaceMachines.checkMachineExists("dev-machine"); - - // create a new machine, delete and check it is not exist - createMachine(machineName); - workspaceMachines.clickOnDeleteMachineButton(machineName); - workspaceDetails.clickOnCloseButtonInDialogWindow(); - WaitUtils.sleepQuietly(1); - workspaceMachines.clickOnDeleteMachineButton(machineName); - workspaceDetails.clickOnDeleteButtonInDialogWindow(); - workspaceMachines.checkMachineIsNotExists(machineName); - - // create a new machine, edit(change the name) and save changes - createMachine(machineName); - workspaceMachines.clickOnEditMachineButton(machineName); - workspaceMachines.checkEditTheMachineDialogIsOpen(); - workspaceMachines.setMachineNameInDialog("machine"); - WaitUtils.sleepQuietly(2); - workspaceMachines.clickOnSaveNameDialogButton(); - workspaceMachines.checkMachineExists("machine"); - clickOnSaveButton(); - workspaceMachines.checkMachineExists("machine"); - } - - @Test(priority = 1, groups = UNDER_REPAIR) - public void startWorkspaceAndCheckChanges() { - // check that created machine exists in the Process Console tree - workspaceDetails.clickOpenInIdeWsBtn(); - seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); - toastLoader.waitToastLoaderAndClickStartButton(); - ide.waitOpenedWorkspaceIsReadyToUse(); - consoles.waitProcessInProcessConsoleTree("machine"); - consoles.waitTabNameProcessIsPresent("machine"); - } - - private void clickOnSaveButton() { - workspaceDetails.clickOnSaveChangesBtn(); - dashboard.waitNotificationMessage("Workspace updated"); - dashboard.waitNotificationIsClosed(); - } - - private void createWsFromJavaMySqlStack() { - // create and start a workspace from the Java-MySql stack - dashboard.open(); - dashboard.waitDashboardToolbarTitle(); - dashboard.selectWorkspacesItemOnDashboard(); - dashboard.waitToolbarTitleName("Workspaces"); - workspaces.clickOnAddWorkspaceBtn(); - newWorkspace.waitToolbar(); - loader.waitOnClosed(); - newWorkspace.selectStack(JAVA_MYSQL); - newWorkspace.typeWorkspaceName(WORKSPACE); - newWorkspace.clickOnCreateButtonAndEditWorkspace(); - - workspaceDetails.waitToolbarTitleName(WORKSPACE); - workspaceDetails.checkStateOfWorkspace(STOPPED); - } - - private void createMachine(String machineName) { - // add new machine and check it exists - workspaceMachines.clickOnAddMachineButton(); - workspaceMachines.checkAddNewMachineDialogIsOpen(); - - // wait for 'Name:' input field is ready text changing - WaitUtils.sleepQuietly(2); - - workspaceMachines.setMachineNameInDialog(machineName); - workspaceDetails.clickOnAddButtonInDialogWindow(); - - try { - workspaceMachines.checkMachineExists(machineName); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/8909"); - } - } - - private void createVariable(String varName, String varValue) { - workspaceEnvVariables.clickOnAddEnvVariableButton(); - workspaceEnvVariables.checkAddNewEnvVarialbleDialogIsOpen(); - workspaceEnvVariables.addNewEnvironmentVariable(varName, varValue); - workspaceDetails.clickOnAddButtonInDialogWindow(); - } - - private void deleteVariable(String varName, String varValue) { - workspaceEnvVariables.clickOnDeleteEnvVariableButton(varName); - workspaceDetails.clickOnDeleteButtonInDialogWindow(); - workspaceEnvVariables.checkValueIsNotExists(varName, varValue); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsOverviewTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsOverviewTest.java index dbe1b146c12..26454c8c0d8 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsOverviewTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/dashboard/workspaces/details/WorkspaceDetailsOverviewTest.java @@ -12,8 +12,6 @@ package org.eclipse.che.selenium.dashboard.workspaces.details; import static java.util.Arrays.asList; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ANDROID; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_CENTOS; import static org.openqa.selenium.Keys.ESCAPE; import com.google.inject.Inject; @@ -23,6 +21,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.AddOrImportForm; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.WorkspaceOverview; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.Test; @@ -112,14 +111,12 @@ public void shouldCreateWorkspaceAndOpenOverviewPage() { workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitPageLoad(); newWorkspace.typeWorkspaceName(WORKSPACE_NAME); - newWorkspace.clickOnAllStacksTab(); - selectStackAndCheckWorkspaceName(ANDROID); + selectStackAndCheckWorkspaceName(Stack.APACHE_CAMEL); - selectStackAndCheckWorkspaceName(JAVA_CENTOS); + selectStackAndCheckWorkspaceName(Stack.JAVA_GRADLE); // create workspace - newWorkspace.setMachineRAM(MACHINE_NAME, 3.0); addOrImportForm.clickOnAddOrImportProjectButton(); addOrImportForm.addSampleToWorkspace(SAMPLE_NAME); newWorkspace.clickOnCreateButtonAndEditWorkspace(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java index a40a7eff6eb..2a836ee8a05 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginExistedUserWithOpenShiftOAuthTest.java @@ -12,7 +12,6 @@ package org.eclipse.che.selenium.site.ocpoauth; import static java.lang.String.format; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import static org.testng.Assert.assertEquals; import com.google.inject.Inject; @@ -30,6 +29,7 @@ import org.eclipse.che.selenium.pageobject.ToastLoader; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.eclipse.che.selenium.pageobject.ocp.AuthorizeOpenShiftAccessPage; import org.eclipse.che.selenium.pageobject.ocp.OpenShiftLoginPage; @@ -140,8 +140,7 @@ public void checkExistedCheUserOcpProjectCreationAndRemoval() throws Exception { dashboard.selectWorkspacesItemOnDashboard(); workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE_NAME); newWorkspace.clickOnCreateButtonAndOpenInIDE(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java index 93151a5ea9f..a9db2c143b8 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/site/ocpoauth/LoginNewUserWithOpenShiftOAuthTest.java @@ -11,8 +11,6 @@ */ package org.eclipse.che.selenium.site.ocpoauth; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; - import com.google.inject.Inject; import org.eclipse.che.api.core.BadRequestException; import org.eclipse.che.api.core.ConflictException; @@ -32,6 +30,7 @@ import org.eclipse.che.selenium.pageobject.ToastLoader; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.eclipse.che.selenium.pageobject.ocp.AuthorizeOpenShiftAccessPage; import org.eclipse.che.selenium.pageobject.ocp.OpenShiftLoginPage; @@ -127,8 +126,7 @@ public void checkNewCheUserOcpProjectCreationAndRemoval() { dashboard.selectWorkspacesItemOnDashboard(); workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.typeWorkspaceName(WORKSPACE_NAME); newWorkspace.clickOnCreateButtonAndOpenInIDE(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromAndroidStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromAndroidStackTest.java deleted file mode 100644 index d3396342080..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromAndroidStackTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ANDROID; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromAndroidStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String MOBILE_ANDROID_HELLO_WORLD = "mobile-android-hello-world"; - private static final String MOBILE_ANDROID_SIMPLE = "mobile-android-simple"; - - private List projects = - ImmutableList.of(MOBILE_ANDROID_HELLO_WORLD, MOBILE_ANDROID_SIMPLE); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromAndroidStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - ANDROID, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(MOBILE_ANDROID_HELLO_WORLD); - projectExplorer.waitProjectInitialization(MOBILE_ANDROID_SIMPLE); - consoles.waitJDTLSProjectResolveFinishedMessage( - MOBILE_ANDROID_HELLO_WORLD, MOBILE_ANDROID_SIMPLE); - } - - @Test(priority = 1) - public void checkMobileAndroidHelloWorldProjectCommands() { - consoles.executeCommandFromProjectExplorer( - MOBILE_ANDROID_HELLO_WORLD, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - MOBILE_ANDROID_HELLO_WORLD, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(MOBILE_ANDROID_HELLO_WORLD), - BUILD_SUCCESS); - } - - @Test(priority = 1) - public void checkMobileAndroidSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - MOBILE_ANDROID_SIMPLE, - RUN_GOAL, - BUILD_COMMAND_ITEM.getItem(MOBILE_ANDROID_SIMPLE), - BUILD_SUCCESS); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromBlankStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromBlankStackTest.java deleted file mode 100644 index 0346caa0282..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromBlankStackTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.BLANK; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CodenvyEditor; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromBlankStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "blank-project"; - - @Inject private Ide ide; - @Inject private Dashboard dashboard; - @Inject private CodenvyEditor editor; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromBlankStackTest() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - BLANK, WORKSPACE_NAME, PROJECT_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(PROJECT_NAME); - } - - @Test(priority = 1) - public void checkBlankProjectCommands() { - projectExplorer.openItemByPath(PROJECT_NAME); - projectExplorer.openItemByPath(PROJECT_NAME + "/README.md"); - editor.waitActive(); - editor.waitTabIsPresent("README.md"); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCamelStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCamelStackTest.java deleted file mode 100644 index 22530f82175..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCamelStackTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CAMEL_SPRINGBOOT; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class CreateWorkspaceFromCamelStackTest { - - private static final String WORKSPACE_NAME = generate("workspaceCamel", 4); - private static final String LS_INIT_MESSAGE = - "Initialized language server 'org.eclipse.che.plugin.camel.server.languageserver'"; - - @Inject private Ide ide; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - @Inject private Consoles consoles; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromCamelStackTest() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithoutProject( - CAMEL_SPRINGBOOT, WORKSPACE_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - consoles.selectProcessByTabName("dev-machine"); - consoles.waitExpectedTextIntoConsole(LS_INIT_MESSAGE); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosBlankStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosBlankStackTest.java deleted file mode 100644 index d3dd2656144..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosBlankStackTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_BLANK; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CodenvyEditor; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCentosBlankStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "blank-project"; - - @Inject private Ide ide; - @Inject private Dashboard dashboard; - @Inject private CodenvyEditor editor; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromCentosBlankStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - CENTOS_BLANK, WORKSPACE_NAME, PROJECT_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(PROJECT_NAME); - } - - @Test(priority = 1) - public void checkBlankProjectCommands() { - projectExplorer.openItemByPath(PROJECT_NAME); - projectExplorer.openItemByPath(PROJECT_NAME + "/README.md"); - editor.waitActive(); - editor.waitTabIsPresent("README.md"); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosGoStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosGoStackTest.java deleted file mode 100644 index dfb1f6ec159..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosGoStackTest.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_GO; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCentosGoStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String DESKTOP_GO_PROJECT = "desktop-go-simple"; - private static final String WEB_GO_PROJECT = "web-go-simple"; - - private List projects = ImmutableList.of(DESKTOP_GO_PROJECT, WEB_GO_PROJECT); - private By textOnPreviewPage = By.xpath("//pre[contains(text(),'Hello there')]"); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromCentosGoStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - CENTOS_GO, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(DESKTOP_GO_PROJECT); - projectExplorer.waitProjectInitialization(WEB_GO_PROJECT); - } - - @Test(priority = 1) - public void checkDesktopGoSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - DESKTOP_GO_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(DESKTOP_GO_PROJECT), - "Hello, world. Sqrt(2) = 1.4142135623730951"); - } - - @Test(priority = 1) - public void checkWebGoSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - WEB_GO_PROJECT, RUN_GOAL, RUN_COMMAND, "listening on"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProjectExplorer( - WEB_GO_PROJECT, RUN_GOAL, RUN_COMMAND_ITEM.getItem(WEB_GO_PROJECT), "listening on"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(WEB_GO_PROJECT)); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosNodeStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosNodeStackTest.java deleted file mode 100644 index d1d57cc073f..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosNodeStackTest.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.INSTALL_DEPENDENCIES_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_NODEJS; -import static org.testng.Assert.fail; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.openqa.selenium.TimeoutException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCentosNodeStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String ANGULAR_PROJECT = "angular-patternfly-starter"; - private static final String NODE_JS_PROJECT = "nodejs-hello-world"; - private static final String WEB_NODE_JS_PROJECT = "web-nodejs-simple"; - - private List projects = - ImmutableList.of(ANGULAR_PROJECT, NODE_JS_PROJECT, WEB_NODE_JS_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromCentosNodeStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - CENTOS_NODEJS, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(ANGULAR_PROJECT); - projectExplorer.waitProjectInitialization(NODE_JS_PROJECT); - projectExplorer.waitProjectInitialization(WEB_NODE_JS_PROJECT); - } - - @Test(priority = 1, groups = UNDER_REPAIR) - public void checkAngularPatternfyStarterProjectCommands() { - By textOnPreviewPage = By.xpath("//span[text()='UNIFIED MANAGEMENT EXPERIENCE']"); - - try { - consoles.executeCommandFromProjectExplorer( - ANGULAR_PROJECT, - BUILD_GOAL, - INSTALL_DEPENDENCIES_COMMAND_ITEM.getItem(ANGULAR_PROJECT), - "bower_components/font-awesome"); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/12259"); - } - - consoles.executeCommandFromProjectExplorer( - ANGULAR_PROJECT, RUN_GOAL, RUN_COMMAND_ITEM.getItem(ANGULAR_PROJECT), "Waiting..."); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(ANGULAR_PROJECT)); - } - - @Test(priority = 1) - public void checkNodejsHelloWorldProjectCommands() { - By textOnPreviewPage = By.xpath("//*[text()='Hello World!']"); - - consoles.executeCommandFromProjectExplorer( - NODE_JS_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(NODE_JS_PROJECT), - "Example app listening on port 3000!"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(NODE_JS_PROJECT)); - } - - @Test(priority = 1) - public void checkWebNodejsSimpleProjectCommands() { - By textOnPreviewPage = By.xpath("//p[text()=' from the Yeoman team']"); - - consoles.executeCommandFromProjectExplorer( - WEB_NODE_JS_PROJECT, - BUILD_GOAL, - INSTALL_DEPENDENCIES_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT), - "bower_components/angular"); - - consoles.executeCommandFromProjectExplorer( - WEB_NODE_JS_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT), - "Started connect web server"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT)); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosWildFlySwarmStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosWildFlySwarmStackTest.java deleted file mode 100644 index 79ae8ce2150..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCentosWildFlySwarmStackTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CENTOS_WILDFLY_SWARM; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCentosWildFlySwarmStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "wfswarm-rest-http"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromCentosWildFlySwarmStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - CENTOS_WILDFLY_SWARM, WORKSPACE_NAME, PROJECT_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(PROJECT_NAME); - - consoles.waitJDTLSProjectResolveFinishedMessage(PROJECT_NAME); - } - - @Test(priority = 1) - public void checkWfswarmRestHttpProjectCommands() { - By textOnPreviewPage = By.xpath("//h2[text()='Thorntail REST API Level 0 Example']"); - - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, RUN_COMMAND, "Thorntail is Ready"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCeylonWithJavaStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCeylonWithJavaStackTest.java deleted file mode 100644 index 73b1cdb1c8e..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCeylonWithJavaStackTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CEYLON_WITH_JAVA_JAVASCRIPT; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCeylonWithJavaStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "ceylon-hello-world"; - private static final String MODULE_COMPILED_MESSAGE = - "Note: Created module che.ceylon.samples.helloWorld"; - private static final String MODULE_STARTED_MESSAGE = - "Hello World from Ceylon on the following backend : "; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromCeylonWithJavaStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - CEYLON_WITH_JAVA_JAVASCRIPT, WORKSPACE_NAME, PROJECT_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(PROJECT_NAME); - } - - @Test(priority = 1) - public void checkCeylonHelloWorldProjectCommands() { - // compile and start project on JVM - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, BUILD_GOAL, "compile for JVM", MODULE_COMPILED_MESSAGE); - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, "Run on JVM", MODULE_STARTED_MESSAGE + "jvm !"); - - // compile and start project on NodeJS - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, BUILD_GOAL, "compile for JS", MODULE_COMPILED_MESSAGE); - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, "Run on NodeJS", MODULE_STARTED_MESSAGE + "js !"); - - // compile and start project on Dart - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, BUILD_GOAL, "compile for Dart", MODULE_COMPILED_MESSAGE); - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, "Run on Dart", MODULE_STARTED_MESSAGE + "dartvm !"); - - // clean all created modules - projectExplorer.openItemByPath(PROJECT_NAME); - projectExplorer.waitVisibleItem(PROJECT_NAME + "/modules"); - projectExplorer.invokeCommandWithContextMenu(BUILD_GOAL, PROJECT_NAME, "clean module"); - projectExplorer.waitItemIsNotPresentVisibleArea(PROJECT_NAME + "/modules"); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCppStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCppStackTest.java deleted file mode 100644 index a3714d71c81..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromCppStackTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_AND_RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CPP; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromCppStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String CONSOLE_CPP_PROJECT = "console-cpp-simple"; - private static final String C_SIMPLE_CONSOLE_PROJECT = "c-simple-console"; - private static final String EXPECTED_MESSAGE_IN_CONSOLE = "Hello World"; - - private List projects = ImmutableList.of(CONSOLE_CPP_PROJECT, C_SIMPLE_CONSOLE_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromCppStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects(CPP, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(CONSOLE_CPP_PROJECT); - projectExplorer.waitProjectInitialization(C_SIMPLE_CONSOLE_PROJECT); - } - - @Test(priority = 1) - public void checkConsoleCppSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - CONSOLE_CPP_PROJECT, RUN_GOAL, RUN_COMMAND, EXPECTED_MESSAGE_IN_CONSOLE); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_CPP_PROJECT, - RUN_GOAL, - BUILD_AND_RUN_COMMAND_ITEM.getItem(CONSOLE_CPP_PROJECT), - EXPECTED_MESSAGE_IN_CONSOLE); - } - - @Test(priority = 1) - public void checkCSimpleConsoleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - C_SIMPLE_CONSOLE_PROJECT, - RUN_GOAL, - BUILD_AND_RUN_COMMAND_ITEM.getItem(C_SIMPLE_CONSOLE_PROJECT), - EXPECTED_MESSAGE_IN_CONSOLE); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseCheStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseCheStackTest.java deleted file mode 100644 index 0dd11a64720..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseCheStackTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_AND_RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ECLIPSE_CHE; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromEclipseCheStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String CONSOLE_JAVA_PROJECT = "console-java-simple"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromJavaStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - ECLIPSE_CHE, WORKSPACE_NAME, CONSOLE_JAVA_PROJECT); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - consoles.waitJDTLSProjectResolveFinishedMessage(CONSOLE_JAVA_PROJECT); - - projectExplorer.waitProjectInitialization(CONSOLE_JAVA_PROJECT); - projectExplorer.waitProjectInitialization(CONSOLE_JAVA_PROJECT); - } - - @Test(priority = 1) - public void checkConsoleJavaSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - BUILD_GOAL, - MAVEN_BUILD_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - RUN_GOAL, - MAVEN_BUILD_AND_RUN_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - "Hello World Che!"); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseVertxStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseVertxStackTest.java deleted file mode 100644 index e257b4eab34..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromEclipseVertxStackTest.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.DEBUG_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.DEBUG_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.LOADER_TIMEOUT_SEC; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ECLIPSE_VERTX; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.SeleniumWebDriver; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromEclipseVertxStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String HEALTH_CHECKS_BOOSTER_PROJECT = "vertx-health-checks-booster"; - private static final String HEALTH_HTTP_BOOSTER_PROJECT = "vertx-http-booster"; - - private List projects = - ImmutableList.of(HEALTH_CHECKS_BOOSTER_PROJECT, HEALTH_HTTP_BOOSTER_PROJECT); - private String currentWindow; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private SeleniumWebDriver seleniumWebDriver; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromEclipseVertxStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - ECLIPSE_VERTX, WORKSPACE_NAME, projects); - - currentWindow = ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(HEALTH_CHECKS_BOOSTER_PROJECT); - projectExplorer.waitProjectInitialization(HEALTH_HTTP_BOOSTER_PROJECT); - - consoles.waitJDTLSProjectResolveFinishedMessage( - HEALTH_CHECKS_BOOSTER_PROJECT, HEALTH_HTTP_BOOSTER_PROJECT); - } - - @Test(priority = 1) - public void checkVertxHealthChecksBoosterProjectCommands() { - By textOnPreviewPage = By.id("_vert_x_health_check_booster"); - - // build and run web application - consoles.executeCommandFromProjectExplorer( - HEALTH_CHECKS_BOOSTER_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - consoles.executeCommandFromProjectExplorer( - HEALTH_CHECKS_BOOSTER_PROJECT, - RUN_GOAL, - RUN_COMMAND, - "[INFO] INFO: Succeeded in deploying verticle"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProcessesArea( - "dev-machine", - DEBUG_GOAL, - DEBUG_COMMAND, - "[INFO] Listening for transport dt_socket at address: 5005"); - consoles.closeProcessTabWithAskDialog(DEBUG_COMMAND); - } - - @Test(priority = 2) - public void checkVertxHttpBoosterProjectCommands() { - By textOnPreviewPage = By.id("_http_booster"); - - // build and run web application - consoles.executeCommandFromProjectExplorer( - HEALTH_HTTP_BOOSTER_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - consoles.executeCommandFromProjectExplorer( - HEALTH_HTTP_BOOSTER_PROJECT, - RUN_GOAL, - RUN_COMMAND, - "[INFO] INFO: Succeeded in deploying verticle"); - - // refresh application web page and check visibility of web element on opened page - checkApplicationPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProcessesArea( - "dev-machine", - DEBUG_GOAL, - DEBUG_COMMAND, - "[INFO] Listening for transport dt_socket at address: 5005"); - consoles.closeProcessTabWithAskDialog(DEBUG_COMMAND); - } - - private void checkApplicationPage(By webElement) { - consoles.waitPreviewUrlIsPresent(); - consoles.waitPreviewUrlIsResponsive(10); - consoles.clickOnPreviewUrl(); - - seleniumWebDriverHelper.switchToNextWindow(currentWindow); - - seleniumWebDriver.navigate().refresh(); - seleniumWebDriverHelper.waitVisibility(webElement, LOADER_TIMEOUT_SEC); - - seleniumWebDriver.close(); - seleniumWebDriver.switchTo().window(currentWindow); - seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromGoStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromGoStackTest.java deleted file mode 100644 index b8a292f1fe2..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromGoStackTest.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.GO_DEFAULT; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromGoStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String DESKTOP_GO_PROJECT = "desktop-go-simple"; - private static final String WEB_GO_PROJECT = "web-go-simple"; - - private List projects = ImmutableList.of(DESKTOP_GO_PROJECT, WEB_GO_PROJECT); - private By textOnPreviewPage = By.xpath("//pre[contains(text(),'Hello there')]"); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromGoStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - GO_DEFAULT, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(DESKTOP_GO_PROJECT); - projectExplorer.waitProjectInitialization(WEB_GO_PROJECT); - } - - @Test(priority = 1) - public void checkDesktopGoSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - DESKTOP_GO_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(DESKTOP_GO_PROJECT), - "Hello, world. Sqrt(2) = 1.4142135623730951"); - } - - @Test(priority = 1) - public void checkWebGoSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - WEB_GO_PROJECT, RUN_GOAL, RUN_COMMAND, "listening on"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProjectExplorer( - WEB_GO_PROJECT, RUN_GOAL, RUN_COMMAND_ITEM.getItem(WEB_GO_PROJECT), "listening on"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(WEB_GO_PROJECT)); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaCentosStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaCentosStackTest.java deleted file mode 100644 index 08af5f452ce..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaCentosStackTest.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_AND_RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_CENTOS; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromJavaCentosStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String CONSOLE_JAVA_PROJECT = "console-java-simple"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromJavaCentosStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - JAVA_CENTOS, WORKSPACE_NAME, CONSOLE_JAVA_PROJECT); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(CONSOLE_JAVA_PROJECT); - - consoles.waitJDTLSProjectResolveFinishedMessage(CONSOLE_JAVA_PROJECT); - } - - @Test(priority = 1) - public void checkConsoleJavaSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - BUILD_GOAL, - MAVEN_BUILD_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - RUN_GOAL, - MAVEN_BUILD_AND_RUN_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - "Hello World Che!"); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlCentosStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlCentosStackTest.java deleted file mode 100644 index e0cef5148d9..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlCentosStackTest.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.LISTENING_AT_ADDRESS_8000; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_AND_DEPLOY_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.DEBUG_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.STOP_TOMCAT_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.COMMON_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.DEBUG_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL_CENTOS; -import static org.openqa.selenium.Keys.ENTER; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.TestGroup; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -@Test(groups = {TestGroup.DOCKER}) -public class CreateWorkspaceFromJavaMySqlCentosStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String WEB_JAVA_PROJECT = "web-java-petclinic"; - private static final String DEV_MACHINE_NAME = "dev-machine"; - private static final String DB_MACHINE_NAME = "db"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromJavaMySqlCentosStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - JAVA_MYSQL_CENTOS, WORKSPACE_NAME, WEB_JAVA_PROJECT); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(WEB_JAVA_PROJECT); - } - - @Test(priority = 1) - public void checkWebJavaPetclinicProjectCommands() { - By textOnPreviewPage = By.xpath("//h2[text()='Welcome']"); - String tomcatIsRunning = "$TOMCAT_HOME/bin/catalina.sh"; - - projectExplorer.openItemByPath(WEB_JAVA_PROJECT); - - // Select the db machine and perform 'show databases' command - consoles.executeCommandFromProcessesArea( - DB_MACHINE_NAME, COMMON_GOAL, "show databases", "information_schema"); - - // Build and deploy the web application - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, COMMON_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, BUILD_GOAL, BUILD_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), BUILD_SUCCESS); - - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, - RUN_GOAL, - BUILD_AND_DEPLOY_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - "Server startup in"); - - // Run the application - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - // execute 'stop tomcat' command and check that tomcat process is not running - projectExplorer.invokeCommandWithContextMenu( - RUN_GOAL, - WEB_JAVA_PROJECT, - STOP_TOMCAT_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - DEV_MACHINE_NAME); - consoles.selectProcessInProcessConsoleTreeByName("Terminal"); - terminal.typeIntoActiveTerminal("ps ax"); - terminal.typeIntoActiveTerminal(ENTER.toString()); - terminal.waitNoTextInFirstTerminal(tomcatIsRunning); - - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, - DEBUG_GOAL, - DEBUG_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - LISTENING_AT_ADDRESS_8000); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlStackTest.java deleted file mode 100644 index 02960d02741..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaMySqlStackTest.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.LISTENING_AT_ADDRESS_8000; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_AND_DEPLOY_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.DEBUG_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.STOP_TOMCAT_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.COMMON_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.DEBUG_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_MYSQL; -import static org.openqa.selenium.Keys.ENTER; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.TestGroup; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Aleksandr Shmaraev */ -@Test(groups = {TestGroup.DOCKER}) -public class CreateWorkspaceFromJavaMySqlStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String WEB_JAVA_PROJECT = "web-java-petclinic"; - private static final String DEV_MACHINE_NAME = "dev-machine"; - private static final String DB_MACHINE_NAME = "db"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromJavaMySqlStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - JAVA_MYSQL, WORKSPACE_NAME, WEB_JAVA_PROJECT); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(WEB_JAVA_PROJECT); - } - - @Test(priority = 1) - public void checkWebJavaPetclinicProjectCommands() { - By textOnPreviewPage = By.xpath("//h2[text()='Welcome']"); - String tomcatIsRunning = "$TOMCAT_HOME/bin/catalina.sh"; - - projectExplorer.openItemByPath(WEB_JAVA_PROJECT); - - // Select the db machine and perform 'show databases' command - consoles.executeCommandFromProcessesArea( - DB_MACHINE_NAME, COMMON_GOAL, "show databases", "information_schema"); - - // Build and deploy the web application - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, BUILD_GOAL, BUILD_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), BUILD_SUCCESS); - - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, - RUN_GOAL, - BUILD_AND_DEPLOY_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - "Server startup in"); - - // Run the application - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - // execute 'stop tomcat' command and check that tomcat process is not running - projectExplorer.invokeCommandWithContextMenu( - RUN_GOAL, - WEB_JAVA_PROJECT, - STOP_TOMCAT_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - DEV_MACHINE_NAME); - consoles.selectProcessInProcessConsoleTreeByName("Terminal"); - terminal.typeIntoActiveTerminal("ps ax"); - terminal.typeIntoActiveTerminal(ENTER.toString()); - terminal.waitNoTextInFirstTerminal(tomcatIsRunning); - - consoles.executeCommandFromProcessesArea( - DEV_MACHINE_NAME, - DEBUG_GOAL, - DEBUG_COMMAND_ITEM.getItem(WEB_JAVA_PROJECT), - LISTENING_AT_ADDRESS_8000); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaStackTest.java deleted file mode 100644 index 0e3b41aed36..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaStackTest.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.LISTENING_AT_ADDRESS_8000; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.SERVER_STARTUP_IN; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_AND_RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.DEBUG_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_AND_RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.MAVEN_BUILD_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_TOMCAT_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.STOP_TOMCAT_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.DEBUG_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; -import static org.openqa.selenium.Keys.ENTER; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromJavaStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String CONSOLE_JAVA_PROJECT = "console-java-simple"; - private static final String WEB_JAVA_SPRING_PROJECT = "web-java-spring"; - - private List projects = ImmutableList.of(CONSOLE_JAVA_PROJECT, WEB_JAVA_SPRING_PROJECT); - private By textOnPreviewPage = By.xpath("//span[text()='Enter your name: ']"); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromJavaStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects(JAVA, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(CONSOLE_JAVA_PROJECT); - projectExplorer.waitProjectInitialization(WEB_JAVA_SPRING_PROJECT); - consoles.waitJDTLSProjectResolveFinishedMessage(CONSOLE_JAVA_PROJECT); - consoles.waitJDTLSProjectResolveFinishedMessage(WEB_JAVA_SPRING_PROJECT); - } - - @Test(priority = 1) - public void checkConsoleJavaSimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - BUILD_GOAL, - MAVEN_BUILD_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - CONSOLE_JAVA_PROJECT, - RUN_GOAL, - MAVEN_BUILD_AND_RUN_COMMAND_ITEM.getItem(CONSOLE_JAVA_PROJECT), - "Hello World Che!"); - } - - @Test(priority = 2) - public void checkWebJavaSpringProjectCommands() { - String tomcatIsRunning = "/bin/bash -c $TOMCAT_HOME/bin/catalina.sh"; - - consoles.executeCommandFromProjectExplorer( - WEB_JAVA_SPRING_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - WEB_JAVA_SPRING_PROJECT, - BUILD_GOAL, - BUILD_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT), - BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - WEB_JAVA_SPRING_PROJECT, - RUN_GOAL, - BUILD_AND_RUN_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT), - SERVER_STARTUP_IN); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog( - BUILD_AND_RUN_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT)); - - consoles.executeCommandFromProjectExplorer( - WEB_JAVA_SPRING_PROJECT, - RUN_GOAL, - RUN_TOMCAT_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT), - SERVER_STARTUP_IN); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - // execute 'stop tomcat' command and check that tomcat process is not running - projectExplorer.invokeCommandWithContextMenu( - RUN_GOAL, - WEB_JAVA_SPRING_PROJECT, - STOP_TOMCAT_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT)); - consoles.selectProcessInProcessConsoleTreeByName("Terminal"); - terminal.typeIntoActiveTerminal("ps ax"); - terminal.typeIntoActiveTerminal(ENTER.toString()); - terminal.waitNoTextInFirstTerminal(tomcatIsRunning); - - consoles.executeCommandFromProjectExplorer( - WEB_JAVA_SPRING_PROJECT, - DEBUG_GOAL, - DEBUG_COMMAND_ITEM.getItem(WEB_JAVA_SPRING_PROJECT), - LISTENING_AT_ADDRESS_8000); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaDockerStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaDockerStackTest.java deleted file mode 100644 index 4f66f506c4e..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaDockerStackTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR; -import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.PREPARING_WS_TIMEOUT_SEC; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_THEIA_DOCKER; -import static org.testng.Assert.fail; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.TestGroup; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.eclipse.che.selenium.pageobject.theia.TheiaIde; -import org.openqa.selenium.By; -import org.openqa.selenium.TimeoutException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -@Test(groups = {TestGroup.DOCKER, UNDER_REPAIR}) -public class CreateWorkspaceFromJavaTheiaDockerStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - - @Inject private TheiaIde theiaIde; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromJavaTheiaDockerStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithoutProject( - JAVA_THEIA_DOCKER, WORKSPACE_NAME); - - seleniumWebDriverHelper.waitAndSwitchToFrame( - By.id("ide-application-iframe"), PREPARING_WS_TIMEOUT_SEC); - - // wait Theia is ready to use - try { - theiaIde.waitTheiaIde(); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/12218"); - } - - theiaIde.waitTheiaIdeTopPanel(); - theiaIde.waitLoaderInvisibility(); - theiaIde.waitNotificationPanelClosed(); - - // run 'About' command from 'Help' menu - theiaIde.runMenuCommand("Help", "About"); - - // wait 'About' dialog, check its content and close - theiaIde.waitAboutDialogIsOpen(); - theiaIde.waitAboutDialogContains("List of extensions"); - theiaIde.closeAboutDialog(); - theiaIde.waitAboutDialogIsClosed(); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaOpenshiftStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaOpenshiftStackTest.java deleted file mode 100644 index e2160ea7a47..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromJavaTheiaOpenshiftStackTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR; -import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.APPLICATION_START_TIMEOUT_SEC; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA_THEIA_OPENSHIFT; -import static org.testng.Assert.fail; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.TestGroup; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.eclipse.che.selenium.pageobject.theia.TheiaIde; -import org.openqa.selenium.By; -import org.openqa.selenium.TimeoutException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -@Test(groups = {TestGroup.OPENSHIFT, UNDER_REPAIR}) -public class CreateWorkspaceFromJavaTheiaOpenshiftStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - - @Inject private TheiaIde theiaIde; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromJavaTheiaOpenshiftStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithoutProject( - JAVA_THEIA_OPENSHIFT, WORKSPACE_NAME); - - seleniumWebDriverHelper.waitAndSwitchToFrame( - By.id("ide-application-iframe"), APPLICATION_START_TIMEOUT_SEC); - - // wait Theia is ready to use - try { - theiaIde.waitTheiaIde(); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/12218"); - } - - theiaIde.waitTheiaIdeTopPanel(); - theiaIde.waitLoaderInvisibility(); - theiaIde.waitNotificationPanelClosed(); - - // run 'About' command from 'Help' menu - theiaIde.runMenuCommand("Help", "About"); - - // wait 'About' dialog, check its content and close - theiaIde.waitAboutDialogIsOpen(); - theiaIde.waitAboutDialogContains("List of extensions"); - theiaIde.closeAboutDialog(); - theiaIde.waitAboutDialogIsClosed(); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromKotlinStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromKotlinStackTest.java deleted file mode 100644 index 97daf658a31..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromKotlinStackTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.KOTLIN; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromKotlinStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - - @Inject private Ide ide; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void createWorkspaceFromKotlinStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithoutProject(KOTLIN, WORKSPACE_NAME); - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNETStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNETStackTest.java deleted file mode 100644 index da48d8ad260..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNETStackTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.UPDATE_DEPENDENCIES_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.UPDATE_DEPENDENCIES_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.DOT_NET_DEFAULT; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromNETStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "dotnet-web-simple"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromNETStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - DOT_NET_DEFAULT, WORKSPACE_NAME, PROJECT_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(PROJECT_NAME); - } - - @Test(priority = 1) - public void checkDotnetWebSimpleProjectCommands() { - By textOnPreviewPage = By.xpath("//pre[text()='Hello World!']"); - - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, BUILD_GOAL, UPDATE_DEPENDENCIES_COMMAND, "Restore completed"); - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, - BUILD_GOAL, - UPDATE_DEPENDENCIES_COMMAND_ITEM.getItem(PROJECT_NAME), - "Restore completed"); - - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, RUN_COMMAND, "Application started."); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog("run"); - - consoles.executeCommandFromProjectExplorer( - PROJECT_NAME, RUN_GOAL, RUN_COMMAND_ITEM.getItem(PROJECT_NAME), "Application started."); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNodeStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNodeStackTest.java deleted file mode 100644 index 67f61bcaa4e..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromNodeStackTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.TestGroup.FLAKY; -import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.INSTALL_DEPENDENCIES_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.NODE; -import static org.testng.Assert.fail; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.SeleniumWebDriver; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.openqa.selenium.TimeoutException; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromNodeStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String ANGULAR_PROJECT = "angular-patternfly-starter"; - private static final String NODE_JS_PROJECT = "nodejs-hello-world"; - private static final String WEB_NODE_JS_PROJECT = "web-nodejs-simple"; - - private List projects = - ImmutableList.of(ANGULAR_PROJECT, NODE_JS_PROJECT, WEB_NODE_JS_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private SeleniumWebDriver seleniumWebDriver; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromNodeStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects(NODE, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(ANGULAR_PROJECT); - projectExplorer.waitProjectInitialization(NODE_JS_PROJECT); - projectExplorer.waitProjectInitialization(WEB_NODE_JS_PROJECT); - } - - @Test(priority = 1, groups = UNDER_REPAIR) - public void checkAngularPatternfyStarterProjectCommands() { - By textOnPreviewPage = By.xpath("//span[text()='UNIFIED MANAGEMENT EXPERIENCE']"); - - try { - consoles.executeCommandFromProjectExplorer( - ANGULAR_PROJECT, - BUILD_GOAL, - INSTALL_DEPENDENCIES_COMMAND_ITEM.getItem(ANGULAR_PROJECT), - "bower_components/font-awesome"); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/12259"); - } - - consoles.executeCommandFromProjectExplorer( - ANGULAR_PROJECT, RUN_GOAL, RUN_COMMAND_ITEM.getItem(ANGULAR_PROJECT), "Waiting..."); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(ANGULAR_PROJECT)); - } - - @Test(priority = 1) - public void checkNodejsHelloWorldProjectCommands() { - By textOnPreviewPage = By.xpath("//*[text()='Hello World!']"); - - consoles.executeCommandFromProjectExplorer( - NODE_JS_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(NODE_JS_PROJECT), - "Example app listening on port 3000!"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(NODE_JS_PROJECT)); - } - - @Test(priority = 1, groups = FLAKY) - public void checkWebNodejsSimpleProjectCommands() { - By textOnPreviewPage = By.xpath("//p[text()=' from the Yeoman team']"); - - projectExplorer.waitAndSelectItem(WEB_NODE_JS_PROJECT); - consoles.executeCommandInsideProcessesArea( - "dev-machine", - BUILD_GOAL, - INSTALL_DEPENDENCIES_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT), - "bower_components/angular"); - - consoles.executeCommandInsideProcessesArea( - "dev-machine", - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT), - "Started connect web server"); - - // Check the preview url is present after refreshing - consoles.waitPreviewUrlIsPresent(); - seleniumWebDriver.navigate().refresh(); - seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); - ide.waitOpenedWorkspaceIsReadyToUse(); - - try { - consoles.waitPreviewUrlIsPresent(); - } catch (TimeoutException ex) { - fail("Known random failure https://github.com/eclipse/che/issues/11419", ex); - } - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(WEB_NODE_JS_PROJECT)); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPHPStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPHPStackTest.java deleted file mode 100644 index d72464bce4b..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPHPStackTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RESTART_APACHE_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.START_APACHE_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.STOP_APACHE_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PHP; -import static org.openqa.selenium.Keys.ENTER; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CheTerminal; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromPHPStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String WEB_PHP_PROJECT = "web-php-simple"; - private static final String WEB_PHP_GAE_PROJECT = "web-php-gae-simple"; - private static final String PHP_FILE_NAME = "index.php"; - - private List projects = ImmutableList.of(WEB_PHP_PROJECT, WEB_PHP_GAE_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CheTerminal terminal; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromPHPStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects(PHP, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(WEB_PHP_PROJECT); - projectExplorer.waitProjectInitialization(WEB_PHP_GAE_PROJECT); - } - - @Test(priority = 1) - public void checkWebPhpSimpleCommands() { - By textOnPreviewPage = By.xpath("//*[text()='Hello World!']"); - String apacheIsRunning = "/usr/sbin/apache2 -k start"; - - projectExplorer.openItemByPath(WEB_PHP_PROJECT); - projectExplorer.openItemByPath(WEB_PHP_PROJECT + "/" + PHP_FILE_NAME); - - consoles.executeCommandFromProjectExplorer( - WEB_PHP_PROJECT, RUN_GOAL, "run php script", "Hello World!"); - - consoles.executeCommandFromProjectExplorer( - WEB_PHP_PROJECT, - RUN_GOAL, - START_APACHE_COMMAND, - "Starting Apache httpd web server apache2"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.executeCommandFromProjectExplorer( - WEB_PHP_PROJECT, RUN_GOAL, RESTART_APACHE_COMMAND, "...done"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - // start 'stop apache' command and check that apache not running - consoles.executeCommandFromProjectExplorer( - WEB_PHP_PROJECT, RUN_GOAL, STOP_APACHE_COMMAND, "Stopping Apache httpd web server apache2"); - consoles.selectProcessInProcessConsoleTreeByName("Terminal"); - terminal.typeIntoActiveTerminal("ps ax"); - terminal.typeIntoActiveTerminal(ENTER.toString()); - terminal.waitNoTextInFirstTerminal(apacheIsRunning); - } - - @Test(priority = 1) - public void checkWebPhpGaeSimpleCommands() { - By textOnPreviewPage = By.xpath("//input[@value='Sign Guestbook']"); - - consoles.executeCommandFromProjectExplorer( - WEB_PHP_GAE_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(WEB_PHP_GAE_PROJECT), - "Starting admin server"); - - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - - consoles.closeProcessTabWithAskDialog(RUN_COMMAND_ITEM.getItem(WEB_PHP_GAE_PROJECT)); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPythonStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPythonStackTest.java deleted file mode 100644 index 59691591934..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromPythonStackTest.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.ELEMENT_TIMEOUT_SEC; -import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.WIDGET_TIMEOUT_SEC; -import static org.eclipse.che.selenium.pageobject.ProjectExplorer.FolderTypes.PROJECT_FOLDER; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.PYTHON_DEFAULT; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CodenvyEditor; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.MavenPluginStatusBar; -import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.ToastLoader; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; -import org.eclipse.che.selenium.pageobject.dashboard.ProjectSourcePage; -import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromPythonStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String PROJECT_NAME = "console-python3-simple"; - private static final String PYTHON_FILE_NAME = "main.py"; - private static final String LS_INIT_MESSAGE = - "Initialized language server 'org.eclipse.che.plugin.python.languageserver"; - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private CodenvyEditor editor; - @Inject private Workspaces workspaces; - @Inject private ToastLoader toastLoader; - @Inject private NewWorkspace newWorkspace; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private ProjectSourcePage projectSourcePage; - @Inject private MavenPluginStatusBar mavenPluginStatusBar; - @Inject private NotificationsPopupPanel notificationsPopupPanel; - @Inject private SeleniumWebDriverHelper seleniumWebDriverHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromPythonStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProject( - PYTHON_DEFAULT, WORKSPACE_NAME, PROJECT_NAME); - - switchToIdeAndWaitWorkspaceIsReadyToUse(); - - waitProjectInitialization(PROJECT_NAME); - - startCommandAndCheckMessageInTerminal(PROJECT_NAME, RUN_GOAL, "run", "Hello, world!"); - startCommandAndCheckMessageInTerminal( - PROJECT_NAME, RUN_GOAL, "console-python3-simple:run", "Hello, world!"); - - checkLanguageServerInitialization(PROJECT_NAME, PYTHON_FILE_NAME, LS_INIT_MESSAGE); - } - - private void switchToIdeAndWaitWorkspaceIsReadyToUse() { - seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); - toastLoader.waitToastLoaderAndClickStartButton(); - ide.waitOpenedWorkspaceIsReadyToUse(); - } - - private void waitProjectInitialization(String projectName) { - projectExplorer.waitItem(projectName); - notificationsPopupPanel.waitPopupPanelsAreClosed(); - mavenPluginStatusBar.waitClosingInfoPanel(); - projectExplorer.waitDefinedTypeOfFolder(projectName, PROJECT_FOLDER); - notificationsPopupPanel.waitPopupPanelsAreClosed(); - } - - private void startCommandAndCheckMessageInTerminal( - String projectName, - ContextMenuCommandGoals commandsGoal, - String commandName, - String expectedMessage) { - projectExplorer.waitAndSelectItem(projectName); - projectExplorer.invokeCommandWithContextMenu(commandsGoal, projectName, commandName); - consoles.waitTabNameProcessIsPresent(commandName); - consoles.waitProcessInProcessConsoleTree(commandName); - consoles.waitExpectedTextIntoConsole(expectedMessage, WIDGET_TIMEOUT_SEC); - } - - private void checkLanguageServerInitialization( - String projectName, String fileName, String textInTerminal) { - projectExplorer.waitAndSelectItem(projectName); - projectExplorer.openItemByPath(projectName); - projectExplorer.openItemByPath(projectName + "/" + fileName); - editor.waitTabIsPresent(fileName); - - // check a language server initialized - consoles.selectProcessByTabName("dev-machine"); - consoles.waitExpectedTextIntoConsole(textInTerminal, ELEMENT_TIMEOUT_SEC); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromRailsStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromRailsStackTest.java deleted file mode 100644 index 25a623ca3be..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromRailsStackTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.INSTALL_DEPENDENCIES_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.INSTALL_DEPENDENCIES_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestIntelligentCommandsConstants.CommandItem.RUN_COMMAND_ITEM; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.RAILS; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromRailsStackTest { - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String CONSOLE_RUBY_PROJECT = "console-ruby-simple"; - private static final String WEB_RAILS_PROJECT = "web-rails-simple"; - - private List projects = ImmutableList.of(CONSOLE_RUBY_PROJECT, WEB_RAILS_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromRailsStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects(RAILS, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(CONSOLE_RUBY_PROJECT); - projectExplorer.waitProjectInitialization(WEB_RAILS_PROJECT); - } - - @Test(priority = 1) - public void checkConsoleRubySimpleProjectCommands() { - consoles.executeCommandFromProjectExplorer( - CONSOLE_RUBY_PROJECT, - RUN_GOAL, - RUN_COMMAND_ITEM.getItem(CONSOLE_RUBY_PROJECT), - "Hello world!"); - } - - @Test(priority = 1) - public void checkWebRailsSimpleProjectCommands() { - By textOnPreviewPage = By.xpath("//h1[text()='Yay! You’re on Rails!']"); - - consoles.executeCommandFromProjectExplorer( - WEB_RAILS_PROJECT, BUILD_GOAL, INSTALL_DEPENDENCIES_COMMAND, "Bundle complete!"); - consoles.executeCommandFromProjectExplorer( - WEB_RAILS_PROJECT, - BUILD_GOAL, - INSTALL_DEPENDENCIES_COMMAND_ITEM.getItem(WEB_RAILS_PROJECT), - "Bundle complete!"); - - consoles.executeCommandFromProjectExplorer( - WEB_RAILS_PROJECT, RUN_GOAL, RUN_COMMAND, "* Listening on"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProjectExplorer( - WEB_RAILS_PROJECT, RUN_GOAL, RUN_COMMAND_ITEM.getItem(WEB_RAILS_PROJECT), "* Listening on"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromSpringBootStackTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromSpringBootStackTest.java deleted file mode 100644 index 0aeb63101ba..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/CreateWorkspaceFromSpringBootStackTest.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.BUILD_SUCCESS; -import static org.eclipse.che.selenium.core.constant.TestBuildConstants.LISTENING_AT_ADDRESS; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.CLEAN_BUILD_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.DEBUG_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestCommandsConstants.RUN_COMMAND; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.BUILD_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.DEBUG_GOAL; -import static org.eclipse.che.selenium.core.constant.TestProjectExplorerContextMenuConstants.ContextMenuCommandGoals.RUN_GOAL; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.SPRING_BOOT; - -import com.google.common.collect.ImmutableList; -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.By; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Skoryk Serhii */ -public class CreateWorkspaceFromSpringBootStackTest { - - private static final String WORKSPACE_NAME = generate("workspace", 4); - private static final String SPRING_BOOT_HEALTH_CHECK_PROJECT = "spring-boot-health-check-booster"; - private static final String SPRING_BOOT_HTTP_PROJECT = "spring-boot-http-booster"; - - private List projects = - ImmutableList.of(SPRING_BOOT_HEALTH_CHECK_PROJECT, SPRING_BOOT_HTTP_PROJECT); - - @Inject private Ide ide; - @Inject private Consoles consoles; - @Inject private Dashboard dashboard; - @Inject private DefaultTestUser defaultTestUser; - @Inject private ProjectExplorer projectExplorer; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void setUp() { - dashboard.open(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkWorkspaceCreationFromSpringBootStack() { - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithProjects( - SPRING_BOOT, WORKSPACE_NAME, projects); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - - projectExplorer.waitProjectInitialization(SPRING_BOOT_HEALTH_CHECK_PROJECT); - projectExplorer.waitProjectInitialization(SPRING_BOOT_HTTP_PROJECT); - - consoles.waitJDTLSProjectResolveFinishedMessage( - SPRING_BOOT_HEALTH_CHECK_PROJECT, SPRING_BOOT_HTTP_PROJECT); - } - - @Test(priority = 1) - public void checkSpringBootHealthCheckBoosterProjectCommands() { - By textOnPreviewPage = By.xpath("//h2[text()='Health Check Booster']"); - - // build and run 'spring-boot-health-check-booster' project - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HEALTH_CHECK_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HEALTH_CHECK_PROJECT, BUILD_GOAL, CLEAN_BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HEALTH_CHECK_PROJECT, RUN_GOAL, RUN_COMMAND, "Started BoosterApplication in"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProcessesArea( - "dev-machine", DEBUG_GOAL, DEBUG_COMMAND, LISTENING_AT_ADDRESS); - consoles.closeProcessTabWithAskDialog(DEBUG_COMMAND); - } - - @Test(priority = 1) - public void checkSpringBooHttpBoosterProjectCommands() { - By textOnPreviewPage = By.xpath("//h2[text()='HTTP Booster']"); - - // build and run 'spring-boot-http-booster' project - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HTTP_PROJECT, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HTTP_PROJECT, BUILD_GOAL, CLEAN_BUILD_COMMAND, BUILD_SUCCESS); - - consoles.executeCommandFromProjectExplorer( - SPRING_BOOT_HTTP_PROJECT, - RUN_GOAL, - RUN_COMMAND, - "INFO: Setting the server's publish address to be"); - consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); - consoles.closeProcessTabWithAskDialog(RUN_COMMAND); - - consoles.executeCommandFromProcessesArea( - "dev-machine", DEBUG_GOAL, DEBUG_COMMAND, LISTENING_AT_ADDRESS); - consoles.closeProcessTabWithAskDialog(DEBUG_COMMAND); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/ImportAndValidateEclipseCheProjectTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/ImportAndValidateEclipseCheProjectTest.java deleted file mode 100644 index e2929b013fe..00000000000 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/stack/ImportAndValidateEclipseCheProjectTest.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2012-2018 Red Hat, Inc. - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -package org.eclipse.che.selenium.stack; - -import static org.eclipse.che.commons.lang.NameGenerator.generate; -import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR; -import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Workspace.IMPORT_PROJECT; -import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Workspace.WORKSPACE; -import static org.eclipse.che.selenium.pageobject.CodenvyEditor.MarkerLocator.ERROR; -import static org.eclipse.che.selenium.pageobject.Wizard.TypeProject.MAVEN; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.ECLIPSE_CHE; -import static org.openqa.selenium.Keys.DELETE; -import static org.openqa.selenium.Keys.ESCAPE; -import static org.testng.Assert.fail; - -import com.google.inject.Inject; -import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; -import org.eclipse.che.selenium.core.user.DefaultTestUser; -import org.eclipse.che.selenium.core.workspace.TestWorkspace; -import org.eclipse.che.selenium.pageobject.CodenvyEditor; -import org.eclipse.che.selenium.pageobject.Consoles; -import org.eclipse.che.selenium.pageobject.Ide; -import org.eclipse.che.selenium.pageobject.ImportProjectFromLocation; -import org.eclipse.che.selenium.pageobject.InformationDialog; -import org.eclipse.che.selenium.pageobject.Loader; -import org.eclipse.che.selenium.pageobject.MavenPluginStatusBar; -import org.eclipse.che.selenium.pageobject.Menu; -import org.eclipse.che.selenium.pageobject.ProjectExplorer; -import org.eclipse.che.selenium.pageobject.Wizard; -import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; -import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; -import org.openqa.selenium.TimeoutException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -/** @author Aleksandr Shmaraev */ -@Test(groups = UNDER_REPAIR) -public class ImportAndValidateEclipseCheProjectTest { - - private static final Logger LOG = - LoggerFactory.getLogger(ImportAndValidateEclipseCheProjectTest.class); - private static final String WORKSPACE_NAME = generate("EclipseCheWs", 4); - private static final String PROJECT_NAME = "eclipse-che"; - private static final String PACKAGE_NAME = "org.eclipse.che.selenium.pageobject"; - private static final String ECLIPSE_CHE_PROJECT_URL = "https://github.com/eclipse/che.git"; - private static final String PATH_TO_JAVA_FILE = - PROJECT_NAME - + "/selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/CodenvyEditor.java"; - private static final String PATH_TO_POM_FILE = PROJECT_NAME + "/dashboard/pom.xml"; - private static final String PATH_TO_TS_FILE = PROJECT_NAME + "/dashboard/src/app/index.module.ts"; - - @Inject private Ide ide; - @Inject private Menu menu; - @Inject private ImportProjectFromLocation importProject; - @Inject private Loader loader; - @Inject private Consoles consoles; - @Inject private ProjectExplorer projectExplorer; - @Inject private Wizard projectWizard; - @Inject private MavenPluginStatusBar mavenPluginStatusBar; - @Inject private InformationDialog informationDialog; - @Inject private CodenvyEditor editor; - @Inject private Dashboard dashboard; - @Inject private CreateWorkspaceHelper createWorkspaceHelper; - @Inject private TestWorkspaceServiceClient workspaceServiceClient; - @Inject private DefaultTestUser defaultTestUser; - - // it is used to read workspace logs on test failure - private TestWorkspace testWorkspace; - - @BeforeClass - public void prepare() { - dashboard.open(); - - // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() - // possible to read logs in case of test failure - testWorkspace = - createWorkspaceHelper.createWorkspaceFromStackWithoutProject(ECLIPSE_CHE, WORKSPACE_NAME); - - ide.switchToIdeAndWaitWorkspaceIsReadyToUse(); - ide.waitOpenedWorkspaceIsReadyToUse(); - consoles.waitJDTLSStartedMessage(); - } - - @AfterClass - public void tearDown() throws Exception { - workspaceServiceClient.delete(WORKSPACE_NAME, defaultTestUser.getName()); - } - - @Test - public void checkImportAndResolveDependenciesEclipseCheProject() { - final int timeoutToOpenInfoPanelInSec = 500; - final int timeoutToClosingInfoPanelInSec = 1200; - - // import the eclipse-che project - projectExplorer.waitProjectExplorer(); - menu.runCommand(WORKSPACE, IMPORT_PROJECT); - importProject.waitAndTypeImporterAsGitInfo(ECLIPSE_CHE_PROJECT_URL, PROJECT_NAME); - - // config the project - projectWizard.waitCreateProjectWizardForm(); - projectWizard.selectTypeProject(MAVEN); - projectWizard.clickSaveButton(); - loader.waitOnClosed(); - projectWizard.waitCreateProjectWizardFormIsClosed(); - loader.waitOnClosed(); - - // waits on project resolving message - consoles.waitJDTLSProjectResolveFinishedMessage(PROJECT_NAME); - - // waits while the 'Import Maven project(s)' info bar is closed - mavenPluginStatusBar.waitClosingInfoPanel(timeoutToClosingInfoPanelInSec); - - // expand the project - projectExplorer.waitItem(PROJECT_NAME); - projectExplorer.openItemByPath(PROJECT_NAME); - loader.waitOnClosed(); - - // waits the text in the progress info bar - loader.waitOnClosed(); - mavenPluginStatusBar.waitExpectedTextInInfoPanel( - "Building workspace", timeoutToOpenInfoPanelInSec); - - // should close the progress monitor form by Esc - mavenPluginStatusBar.clickOnInfoPanel(); - mavenPluginStatusBar.waitProgressMonitorFormToOpen(); - mavenPluginStatusBar.closeProgressMonitorFormByKeys(ESCAPE.toString()); - - // then open it again - mavenPluginStatusBar.clickOnInfoPanel(); - mavenPluginStatusBar.waitProgressMonitorFormToOpen(); - - // wait while progress info is closed - mavenPluginStatusBar.waitClosingInfoPanel(timeoutToClosingInfoPanelInSec); - mavenPluginStatusBar.waitProgressMonitorFormToClose(); - - // then open files - // open a java file - quickRevealToItemWithJavaScriptAndOpenFile(PATH_TO_JAVA_FILE); - editor.waitActive(); - - // checks packages in project Explorer - try { - projectExplorer.waitVisibilityByName(PACKAGE_NAME); - } catch (TimeoutException ex) { - // remove try-catch block after issue has been resolved - fail("Known permanent failure https://github.com/eclipse/che/issues/11537"); - } - - // open a xml file - quickRevealToItemWithJavaScriptAndOpenFile(PATH_TO_POM_FILE); - editor.waitActive(); - - // open a ts file - quickRevealToItemWithJavaScriptAndOpenFile(PATH_TO_TS_FILE); - editor.waitActive(); - - // wait the project and the files - projectExplorer.waitItem(PROJECT_NAME); - editor.waitTabIsPresent("CodenvyEditor"); - editor.waitTabIsPresent("che-dashboard-war"); - editor.waitTabIsPresent("index.module.ts"); - } - - @Test(priority = 1) - public void checkErrorMarkersInEditor() { - // check an error marker in the pom.xml file - projectExplorer.openItemByPath(PATH_TO_POM_FILE); - editor.waitActive(); - editor.waitAllMarkersInvisibility(ERROR); - editor.typeTextIntoEditor("q"); - editor.goToPosition(1, 1); - editor.waitMarkerInPosition(ERROR, 1); - editor.typeTextIntoEditor(DELETE.toString()); - editor.waitMarkerInvisibility(ERROR, 1); - - // check error marker in the java file - projectExplorer.openItemByPath(PATH_TO_JAVA_FILE); - editor.waitActive(); - editor.waitAllMarkersInvisibility(ERROR); - editor.setCursorToLine(12); - editor.typeTextIntoEditor("q"); - editor.goToPosition(12, 1); - editor.waitMarkerInPosition(ERROR, 12); - editor.typeTextIntoEditor(DELETE.toString()); - editor.waitMarkerInvisibility(ERROR, 12); - - // check error marker in the ts file - projectExplorer.openItemByPath(PATH_TO_TS_FILE); - editor.waitActive(); - editor.typeTextIntoEditor("q"); - editor.waitMarkerInPosition(ERROR, 1); - } - - private void quickRevealToItemWithJavaScriptAndOpenFile(String pathToItem) { - projectExplorer.quickRevealToItemWithJavaScript(pathToItem); - projectExplorer.openItemByPath(pathToItem); - } -} diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/Che7PreviewStackStartTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/Che7PreviewStackStartTest.java index 4b4e4a060c1..fbb68a05f57 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/Che7PreviewStackStartTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/Che7PreviewStackStartTest.java @@ -12,7 +12,6 @@ package org.eclipse.che.selenium.theia; import static org.eclipse.che.selenium.core.TestGroup.OPENSHIFT; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_PREVIEW; import com.google.inject.Inject; import org.eclipse.che.commons.lang.NameGenerator; @@ -20,6 +19,7 @@ import org.eclipse.che.selenium.core.user.DefaultTestUser; import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.theia.TheiaIde; import org.eclipse.che.selenium.pageobject.theia.TheiaProjectTree; import org.testng.annotations.AfterClass; @@ -43,7 +43,7 @@ public void tearDown() throws Exception { @Test(groups = {OPENSHIFT}) public void workspaceShouldBeStarted() { dashboard.open(); - createWorkspaceHelper.createWorkspaceFromStackWithoutProject(CHE_7_PREVIEW, WORKSPACE_NAME); + createWorkspaceHelper.createWorkspaceFromStackWithoutProject(Stack.GO, WORKSPACE_NAME); theiaIde.switchToIdeFrame(); theiaIde.waitTheiaIde(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/TheiaBuildPluginTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/TheiaBuildPluginTest.java index 0b6ae9daab5..9b6475ebecb 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/TheiaBuildPluginTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/theia/TheiaBuildPluginTest.java @@ -15,7 +15,6 @@ import static org.eclipse.che.selenium.core.TestGroup.UNDER_REPAIR; import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.LOADER_TIMEOUT_SEC; import static org.eclipse.che.selenium.core.constant.TestTimeoutsConstants.UPDATING_PROJECT_TIMEOUT_SEC; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.CHE_7_PREVIEW; import static org.testng.Assert.fail; import com.google.inject.Inject; @@ -27,6 +26,7 @@ import org.eclipse.che.selenium.pageobject.dashboard.CreateWorkspaceHelper; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.eclipse.che.selenium.pageobject.theia.TheiaEditor; import org.eclipse.che.selenium.pageobject.theia.TheiaHostedPluginSelectPathForm; @@ -65,7 +65,7 @@ public class TheiaBuildPluginTest { @BeforeClass public void prepare() { dashboard.open(); - createWorkspaceHelper.createWorkspaceFromStackWithoutProject(CHE_7_PREVIEW, WORKSPACE_NAME); + createWorkspaceHelper.createWorkspaceFromStackWithoutProject(Stack.GO, WORKSPACE_NAME); theiaIde.switchToIdeFrame(); theiaIde.waitTheiaIde(); diff --git a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/CreateWorkspaceOnDashboardTest.java b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/CreateWorkspaceOnDashboardTest.java index 86eda5dbb53..c7246714b66 100644 --- a/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/CreateWorkspaceOnDashboardTest.java +++ b/selenium/che-selenium-test/src/test/java/org/eclipse/che/selenium/workspaces/CreateWorkspaceOnDashboardTest.java @@ -17,7 +17,6 @@ import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Workspace.WORKSPACE; import static org.eclipse.che.selenium.pageobject.ProjectExplorer.FolderTypes.PROJECT_FOLDER; import static org.eclipse.che.selenium.pageobject.Wizard.SamplesName.WEB_JAVA_SPRING; -import static org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack.JAVA; import com.google.inject.Inject; import org.eclipse.che.selenium.core.client.TestWorkspaceServiceClient; @@ -34,6 +33,7 @@ import org.eclipse.che.selenium.pageobject.Wizard; import org.eclipse.che.selenium.pageobject.dashboard.Dashboard; import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace; +import org.eclipse.che.selenium.pageobject.dashboard.NewWorkspace.Stack; import org.eclipse.che.selenium.pageobject.dashboard.workspaces.Workspaces; import org.testng.annotations.AfterClass; import org.testng.annotations.Test; @@ -81,8 +81,7 @@ public void createWorkspaceOnDashboardTest() { workspaces.clickOnAddWorkspaceBtn(); newWorkspace.waitToolbar(); newWorkspace.typeWorkspaceName(WS_NAME); - newWorkspace.clickOnAllStacksTab(); - newWorkspace.selectStack(JAVA); + newWorkspace.selectStack(Stack.JAVA_MAVEN); newWorkspace.clickOnCreateButtonAndOpenInIDE(); // store info about created workspace to make SeleniumTestHandler.captureTestWorkspaceLogs() diff --git a/selenium/che-selenium-test/src/test/resources/suites/CheSuite.xml b/selenium/che-selenium-test/src/test/resources/suites/CheSuite.xml index ef604e2d4df..25f9d10bcea 100644 --- a/selenium/che-selenium-test/src/test/resources/suites/CheSuite.xml +++ b/selenium/che-selenium-test/src/test/resources/suites/CheSuite.xml @@ -37,7 +37,6 @@ - @@ -230,13 +229,6 @@ - - - - - - - From f7e7d530a18124374cf1868cc808eb78d0e95206 Mon Sep 17 00:00:00 2001 From: Anna Shumilova Date: Mon, 10 Jun 2019 14:48:30 +0300 Subject: [PATCH 4/5] Enable devfile registry by default Signed-off-by: Anna Shumilova Fix the run workspace button Signed-off-by: Anna Shumilova Fix adding projects to devfile Signed-off-by: Anna Shumilova Fix adding projects to devfile Signed-off-by: Anna Shumilova --- dashboard/src/app/ide/ide.service.ts | 2 +- .../create-workspace.controller.ts | 2 +- .../create-workspace.service.ts | 17 +++++++++++++++-- .../workspace-status.controller.ts | 5 ++--- .../workspace-details-projects.controller.ts | 6 ++++-- .../api/workspace/workspace-data-manager.ts | 11 +++++++++-- deploy/openshift/deploy_che.sh | 2 +- 7 files changed, 33 insertions(+), 12 deletions(-) diff --git a/dashboard/src/app/ide/ide.service.ts b/dashboard/src/app/ide/ide.service.ts index fc89df87e6f..48b1882d10a 100644 --- a/dashboard/src/app/ide/ide.service.ts +++ b/dashboard/src/app/ide/ide.service.ts @@ -122,7 +122,7 @@ class IdeSvc { } startWorkspace(data: any): ng.IPromise { - let startWorkspacePromise = this.cheAPI.getWorkspace().startWorkspace(data.id, data.config.defaultEnv); + let startWorkspacePromise = this.cheAPI.getWorkspace().startWorkspace(data.id, data.config ? data.config.defaultEnv: null); return startWorkspacePromise; } diff --git a/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts b/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts index 99415db7ecc..4c92bdb28d3 100644 --- a/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts +++ b/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts @@ -299,7 +299,7 @@ export class CreateWorkspaceController { */ createWorkspace(): ng.IPromise { // update workspace name - this.selectedDevfile.name = this.workspaceName; + this.selectedDevfile.metadata.name = this.workspaceName; return this.createWorkspaceSvc.createWorkspaceFromDevfile(this.selectedDevfile, null); } diff --git a/dashboard/src/app/workspaces/create-workspace/create-workspace.service.ts b/dashboard/src/app/workspaces/create-workspace/create-workspace.service.ts index 25d7fddde28..ceb3b40c1cd 100644 --- a/dashboard/src/app/workspaces/create-workspace/create-workspace.service.ts +++ b/dashboard/src/app/workspaces/create-workspace/create-workspace.service.ts @@ -193,9 +193,22 @@ export class CreateWorkspaceSvc { const namespaceId = this.namespaceSelectorSvc.getNamespaceId(), projectTemplates = this.projectSourceSelectorService.getProjectTemplates(); + let projects = []; + projectTemplates.forEach((template: che.IProjectTemplate) => { + let project = { + name: template.displayName, + source: { + type: template.source.type, + location: template.source.location + } + }; + projects.push(project); + }); + return this.checkEditingProgress().then(() => { - workspaceDevfile.projects = projectTemplates; - this.addProjectCommands({devfile: workspaceDevfile}, projectTemplates); + workspaceDevfile.projects = projects; + //TODO waits for fix https://github.com/eclipse/che/issues/13514 + //this.addProjectCommands({devfile: workspaceDevfile}, projectTemplates); return this.cheWorkspace.createWorkspaceFromDevfile(namespaceId, workspaceDevfile, attributes).then((workspace: che.IWorkspace) => { return this.cheWorkspace.fetchWorkspaces().then(() => this.cheWorkspace.getWorkspaceById(workspace.id)); }) diff --git a/dashboard/src/app/workspaces/list-workspaces/workspace-status-action/workspace-status.controller.ts b/dashboard/src/app/workspaces/list-workspaces/workspace-status-action/workspace-status.controller.ts index 2c8abd347be..7e339c587ea 100644 --- a/dashboard/src/app/workspaces/list-workspaces/workspace-status-action/workspace-status.controller.ts +++ b/dashboard/src/app/workspaces/list-workspaces/workspace-status-action/workspace-status.controller.ts @@ -50,13 +50,13 @@ export class WorkspaceStatusController { return; } const workspace = this.cheWorkspace.getWorkspaceById(this.workspaceId); - if (!workspace || !workspace.config) { + if (!workspace) { return; } const status = this.getWorkspaceStatus(); const isRunButton = status !== WorkspaceStatus.RUNNING && status !== WorkspaceStatus.STOPPING && status !== WorkspaceStatus.STARTING; - const environment = workspace.config.defaultEnv; + const environment = workspace.config ? workspace.config.defaultEnv : null; if (isRunButton) { this.updateRecentWorkspace(this.workspaceId); @@ -65,7 +65,6 @@ export class WorkspaceStatusController { this.cheWorkspace.fetchStatusChange(this.workspaceId, 'ERROR').then((data: any) => { this.cheNotification.showError(data.error); }); - const promise = isRunButton ? this.cheWorkspace.startWorkspace(this.workspaceId, environment) : this.cheWorkspace.stopWorkspace(this.workspaceId); promise.catch((error: any) => { this.cheNotification.showError(`${isRunButton ? 'Run' : 'Stop'} workspace error.`, error); diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-projects/workspace-details-projects.controller.ts b/dashboard/src/app/workspaces/workspace-details/workspace-projects/workspace-details-projects.controller.ts index 09e67b37278..1f725990fbf 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-projects/workspace-details-projects.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/workspace-projects/workspace-details-projects.controller.ts @@ -190,11 +190,13 @@ export class WorkspaceDetailsProjectsCtrl { if (!projectTemplate.type && projectTemplate.projectType) { projectTemplate.type = projectTemplate.projectType; } - this.workspaceDetailsProjectsService.addProjectTemplate(projectTemplate); this.workspaceDataManager.addProject(this.workspaceDetails, projectTemplate); }); - this.createWorkspaceSvc.addProjectCommands(this.workspaceDetails, projectTemplates); + //TODO waits for fix https://github.com/eclipse/che/issues/13514 to enable for devfile + if (this.workspaceDetails.config) { + this.createWorkspaceSvc.addProjectCommands(this.workspaceDetails, projectTemplates); + } this.projectsOnChange(); } diff --git a/dashboard/src/components/api/workspace/workspace-data-manager.ts b/dashboard/src/components/api/workspace/workspace-data-manager.ts index cebe29247ea..7d3bada7c72 100644 --- a/dashboard/src/components/api/workspace/workspace-data-manager.ts +++ b/dashboard/src/components/api/workspace/workspace-data-manager.ts @@ -96,10 +96,17 @@ export class WorkspaceDataManager { * @param workspace workspace * @param project project to be added to pointed workspace */ - addProject(workspace: che.IWorkspace, project: any): void { + addProject(workspace: che.IWorkspace, projectTemplate: che.IProjectTemplate): void { if (workspace.config) { - workspace.config.projects.push(project); + workspace.config.projects.push(projectTemplate); } else if (workspace.devfile) { + let project = { + name: projectTemplate.displayName, + source: { + type: projectTemplate.source.type, + location: projectTemplate.source.location + } + }; workspace.devfile.projects.push(project); } } diff --git a/deploy/openshift/deploy_che.sh b/deploy/openshift/deploy_che.sh index 055fee426bb..879bad8988c 100755 --- a/deploy/openshift/deploy_che.sh +++ b/deploy/openshift/deploy_che.sh @@ -227,7 +227,7 @@ export DEVFILE_REGISTRY_IMAGE=${DEVFILE_REGISTRY_IMAGE:-${DEFAULT_DEVFILE_REGIST DEFAULT_DEVFILE_REGISTRY_IMAGE_PULL_POLICY="Always" export DEVFILE_REGISTRY_IMAGE_PULL_POLICY=${DEVFILE_REGISTRY_IMAGE_PULL_POLICY:-${DEFAULT_DEVFILE_REGISTRY_IMAGE_PULL_POLICY}} -DEFAULT_DEVFILE__REGISTRY__URL="NULL" +DEFAULT_DEVFILE__REGISTRY__URL="https://che-devfile-registry.openshift.io/" export DEVFILE__REGISTRY__URL=${DEVFILE__REGISTRY__URL:-${DEFAULT_DEVFILE__REGISTRY__URL}} From b6087e83d2ee307cba892a1828738519a085c29f Mon Sep 17 00:00:00 2001 From: Skorik Sergey Date: Thu, 13 Jun 2019 12:48:26 +0300 Subject: [PATCH 5/5] remove selenium tests that create workspaces from Che 6 stacks from selenium tests suites --- .../create-workspace/create-workspace.controller.ts | 3 +-- .../src/test/resources/suites/CheOneThreadTestsSuite.xml | 1 - .../che-selenium-test/src/test/resources/suites/CheSuite.xml | 4 ---- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts b/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts index 4c92bdb28d3..780408937df 100644 --- a/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts +++ b/dashboard/src/app/workspaces/create-workspace/create-workspace.controller.ts @@ -137,8 +137,7 @@ export class CreateWorkspaceController { // loader should be hidden and page content shown // when stacks selector is rendered // and default stack is selected - //TODO - this.hideLoader = true; + this.hideLoader = false; // header toolbar // dropdown button config diff --git a/selenium/che-selenium-test/src/test/resources/suites/CheOneThreadTestsSuite.xml b/selenium/che-selenium-test/src/test/resources/suites/CheOneThreadTestsSuite.xml index 970b9cd5d16..29c9aeca3a4 100644 --- a/selenium/che-selenium-test/src/test/resources/suites/CheOneThreadTestsSuite.xml +++ b/selenium/che-selenium-test/src/test/resources/suites/CheOneThreadTestsSuite.xml @@ -37,7 +37,6 @@ - diff --git a/selenium/che-selenium-test/src/test/resources/suites/CheSuite.xml b/selenium/che-selenium-test/src/test/resources/suites/CheSuite.xml index 25f9d10bcea..2ae94fafd8e 100644 --- a/selenium/che-selenium-test/src/test/resources/suites/CheSuite.xml +++ b/selenium/che-selenium-test/src/test/resources/suites/CheSuite.xml @@ -34,9 +34,6 @@ - - - @@ -225,7 +222,6 @@ -