/*********************************************************************
 * Copyright (c) 2020 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
 **********************************************************************/ import 'reflect-metadata' ; import { CLASSES } from '../../inversify.types' ; import CheReporter from '../../driver/CheReporter' ; import { e2eContainer } from '../../inversify.config' ; import { PreferencesHandler } from '../../utils/PreferencesHandler' ; import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests' ; import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests' ; import { NavigationBar } from '../../pageobjects/ide/NavigationBar' ; import { Dashboard } from '../../pageobjects/dashboard/Dashboard' ; const workspaceHandlingTests = e2eContainer . get ( CLASSES . WorkspaceHandlingTests ) ; const preferencesHandler = e2eContainer . get ( CLASSES . PreferencesHandler ) ; const projectAndFileTests = e2eContainer . get ( CLASSES . ProjectAndFileTests ) ; const navigationBar = e2eContainer . get ( CLASSES . NavigationBar ) ; const dashboard = e2eContainer . get ( CLASSES . Dashboard ) ; const workspaceSampleName = 'console-java-simple' ; const workspaceRootFolderName = 'src' ; const stack = 'Java Maven' ; let workspaceName ; suite ( `${ stack } test` , async ( ) => { suite ( `Create ${ stack } workspace` , async ( ) => { workspaceHandlingTests . createAndOpenWorkspace ( stack ) ; test ( 'Register running workspace' , async ( ) => { workspaceName = WorkspaceHandlingTests . getWorkspaceName ( ) ; CheReporter . registerRunningWorkspace ( workspaceName ) ; } ) ; projectAndFileTests . waitWorkspaceReadiness ( workspaceSampleName , workspaceRootFolderName , false ) ; test ( 'Set application.confirmExit user preferences to "never"' , async ( ) => { await preferencesHandler . setPreferenceUsingUI ( 'application.confirmExit' , 'never' ) ; } ) ; } ) ; suite ( 'Stopping and deleting the workspace' , async ( ) => { test ( `Stop and remowe workspace` , async ( ) => { await navigationBar . openNavigationBar ( ) ; await dashboard . stopAndRemoveWorkspaceByUI ( workspaceName ) ; } ) ; } ) ; } ) ;