@@ -14,11 +14,6 @@ import {ServerReadyData} from './api';
1414import { BrowserFeature , ToolName } from '../constants' ;
1515import type { TestplaneToolAdapter } from '../adapters/tool/testplane' ;
1616import { ToolRunnerTree } from './tool-runner' ;
17- import {
18- getSnapshotHashWithoutAttempt ,
19- snapshotsInProgress ,
20- TestContext
21- } from '../adapters/event-handling/testplane/snapshots' ;
2217
2318interface CustomGuiError {
2419 response : {
@@ -149,8 +144,13 @@ export const start = async (args: ServerArgs): Promise<ServerReadyData> => {
149144 } ) ;
150145
151146 server . get ( '/running-test-data' , async ( req , res ) : Promise < void > => {
147+ if ( toolAdapter . toolName !== ToolName . Testplane ) {
148+ res . status ( 500 ) . json ( { error : `Getting running test data supports only in Testplane tool` } ) ;
149+ }
150+
152151 try {
153152 const { testPath, browserId} = req . query ;
153+ const { getSnapshotHashWithoutAttempt, snapshotsInProgress} = await import ( '../adapters/event-handling/testplane/snapshots' ) ;
154154
155155 if ( ! testPath || ! browserId ) {
156156 res . status ( 400 ) . json ( { error : `Missing one of the required GET parameters: testPath or browserId. Received testPath: ${ testPath } , browserId: ${ browserId } ` } ) ;
@@ -169,7 +169,7 @@ export const start = async (args: ServerArgs): Promise<ServerReadyData> => {
169169 return ;
170170 }
171171
172- const context : TestContext = { testPath : parsedTestPath , browserId : browserId as string } ;
172+ const context = { testPath : parsedTestPath , browserId : browserId as string } ;
173173 const snapshotKey = getSnapshotHashWithoutAttempt ( context ) ;
174174
175175 const snapshots = snapshotsInProgress [ snapshotKey ] || [ ] ;
0 commit comments