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 ) ; const factoryUrl = `${ TestConstants . TS_SELENIUM_BASE_URL }/f?url=https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-maven/devfile.yaml` ; const workspaceSampleName = 'console-java-simple' ; const workspaceRootFolderName = 'src' ; let workspaceName ; suite ( 'Workspace creation via factory url' , async ( ) => { suite ( 'Open factory URL' , async ( ) => { test ( `Navigating to factory URL` , async ( ) => { await browserTabsUtil . navigateTo ( factoryUrl ) ; } ) ; } ) ; suite ( 'Wait workspace readyness' , async ( ) => { projectAndFileTests . waitWorkspaceReadiness ( workspaceSampleName , workspaceRootFolderName ) ; } ) ; suite ( 'Stopping and deleting the workspace' , async ( ) => { test ( 'Stop and remove workspace' , async ( ) => { workspaceName = await workspaceNameHandler . getNameFromUrl ( ) ; CheReporter . registerRunningWorkspace ( workspaceName ) ; await testWorkspaceUtils . cleanUpRunningWorkspace ( workspaceName ) ; } ) ; } ) ; } ) ;