import { e2eContainer } from '../../../inversify.config' ; import { CLASSES , TYPES } from '../../../inversify.types' ; import { TestConstants } from '../../../TestConstants' ; import { ProjectAndFileTests } from '../../../testsLibrary/ProjectAndFileTests' ; import CheReporter from '../../../driver/CheReporter' ; import { BrowserTabsUtil } from '../../../utils/BrowserTabsUtil' ; import { WorkspaceNameHandler } from '../../../utils/WorkspaceNameHandler' ; import { TestWorkspaceUtil } from '../../../utils/workspace/TestWorkspaceUtil' ; const projectAndFileTests = e2eContainer . get ( CLASSES . ProjectAndFileTests ) ; const browserTabsUtil = e2eContainer . get ( CLASSES . BrowserTabsUtil ) ; const workspaceNameHandler = e2eContainer . get ( CLASSES . WorkspaceNameHandler ) ; const testWorkspaceUtils = e2eContainer . get < TestWorkspaceUtil > ( TYPES . WorkspaceUtil ) ; let workspaceName ; suite ( 'Workspace creation via factory url' , async ( ) => { let factoryUrl = `${ TestConstants . TS_SELENIUM_BASE_URL }/f?url=https://github.com/che-samples/console-java-simple/tree/java1.11` ; const workspaceSampleName = 'console-java-simple' ; const workspaceRootFolderName = 'src' ; const fileFolderPath = `${ workspaceSampleName }/${ workspaceRootFolderName }/main/java/org/eclipse/che/examples` ; const tabTitle = 'HelloWorld.java' ; suite ( 'Open factory URL' , async ( ) => { test ( `Navigating to factory URL` , async ( ) => { await browserTabsUtil . navigateTo ( factoryUrl ) ; } ) ; } ) ; suite ( 'Wait workspace readyness' , async ( ) => { projectAndFileTests . waitWorkspaceReadiness ( workspaceSampleName , workspaceRootFolderName , true , true ) ; } ) ; suite ( 'Check imported project' , async ( ) => { projectAndFileTests . openFile ( fileFolderPath , tabTitle ) ; projectAndFileTests . checkProjectBranchName ( 'java1.11' ) ; } ) ; suite ( 'Stopping and deleting the workspace' , async ( ) => { test ( 'Stop and remove workspace' , async ( ) => { workspaceName = await workspaceNameHandler . getNameFromUrl ( ) ; CheReporter . registerRunningWorkspace ( workspaceName ) ; await testWorkspaceUtils . cleanUpRunningWorkspace ( workspaceName ) ; } ) ; } ) ; } ) ;