/*********************************************************************
 * 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 { CLASSES } from '../../inversify.types' ; import 'reflect-metadata' ; import { LanguageServerTests } from '../../testsLibrary/LanguageServerTests' ; import { e2eContainer } from '../../inversify.config' ; import { CodeExecutionTests } from '../../testsLibrary/CodeExecutionTests' ; import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests' ; import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests' ; import CheReporter from '../../driver/CheReporter' ; const workspaceHandlingTests = e2eContainer . get ( CLASSES . WorkspaceHandlingTests ) ; const projectAndFileTests = e2eContainer . get ( CLASSES . ProjectAndFileTests ) ; const commonLanguageServerTests = e2eContainer . get ( CLASSES . LanguageServerTests ) ; const codeExecutionTests = e2eContainer . get ( CLASSES . CodeExecutionTests ) ; const workspaceStack = 'Python' ; const workspaceSampleName = 'python-hello-world' ; const taskRunName = 'run' ; const fileFolderPath = `${ workspaceSampleName }` ; const fileName = `hello-world.py` ; let workspaceName ; suite ( `${ workspaceStack } test` , async ( ) => { suite ( `Create ${ workspaceStack } workspace` , async ( ) => { workspaceHandlingTests . createAndOpenWorkspace ( workspaceStack ) ; test ( 'Register running workspace' , async ( ) => { workspaceName = WorkspaceHandlingTests . getWorkspaceName ( ) ; CheReporter . registerRunningWorkspace ( workspaceName ) ; } ) ; projectAndFileTests . waitWorkspaceReadinessNoSubfolder ( workspaceSampleName , false ) ; } ) ; suite ( 'Test opening file' , async ( ) => { projectAndFileTests . openFile ( fileFolderPath , fileName ) ; } ) ; suite . skip ( 'Run Python project' , async ( ) => { codeExecutionTests . runTask ( taskRunName , 30000 ) ; codeExecutionTests . closeTerminal ( taskRunName ) ; } ) ; suite ( 'Language server validation' , async ( ) => { commonLanguageServerTests . errorHighlighting ( fileName , `error_text;` , 7 ) ; commonLanguageServerTests . suggestionInvoking ( fileName , 9 , 22 , 'str' ) ; commonLanguageServerTests . autocomplete ( fileName , 9 , 4 , 'print' ) ; } ) ; suite ( 'Stopping and deleting the workspace' , async ( ) => { test ( `Stop and remowe workspace` , async ( ) => { await workspaceHandlingTests . stopAndRemoveWorkspace ( workspaceName ) ; } ) ; } ) ; } ) ;