@@ -3,6 +3,33 @@ import * as fs from 'fs';
33import type { Options , Capabilities } from '@wdio/types' ;
44import { projectRoot } from './tests/e2eTestUtils' ;
55
6+ const TEST_DATASETS = [
7+ {
8+ url : 'https://data.kitware.com/api/v1/file/6566aa81c5a2b36857ad1783/download' ,
9+ name : 'CT000085.dcm' ,
10+ } ,
11+ {
12+ url : 'https://data.kitware.com/api/v1/file/68e9807dbf0f869935e36481/download' ,
13+ name : 'minimal.dcm' ,
14+ } ,
15+ {
16+ url : 'https://data.kitware.com/api/v1/file/655d42a694ef39bf0a4a8bb3/download' ,
17+ name : '1-001.dcm' ,
18+ } ,
19+ {
20+ url : 'https://data.kitware.com/api/v1/item/63527c7311dab8142820a338/download' ,
21+ name : 'prostate.zip' ,
22+ } ,
23+ {
24+ url : 'https://data.kitware.com/api/v1/item/6352a2b311dab8142820a33b/download' ,
25+ name : 'MRA-Head_and_Neck.zip' ,
26+ } ,
27+ {
28+ url : 'https://data.kitware.com/api/v1/item/635679c311dab8142820a4f4/download' ,
29+ name : 'fetus.zip' ,
30+ } ,
31+ ] ;
32+
633export const WINDOW_SIZE = [ 1200 , 800 ] as const ;
734export const TEST_PORT = 4567 ;
835// for slow connections try:
@@ -39,8 +66,8 @@ export const config: Options.Testrunner = {
3966 // ===================
4067 logLevel : 'warn' ,
4168 bail : 0 ,
42- waitforTimeout : 30000 ,
43- connectionRetryTimeout : 120000 ,
69+ waitforTimeout : 10000 ,
70+ connectionRetryTimeout : 30000 ,
4471 connectionRetryCount : 3 ,
4572 services : [
4673 [
@@ -72,15 +99,26 @@ export const config: Options.Testrunner = {
7299 reporters : [ 'spec' , 'html-nice' ] ,
73100 mochaOpts : {
74101 ui : 'bdd' ,
75- timeout : 160 * 1000 ,
102+ timeout : 60000 ,
76103 } ,
77104
78105 //
79106 // Hooks
80107 //
81108
82- onPrepare ( ) {
109+ async onPrepare ( ) {
83110 fs . mkdirSync ( TEMP_DIR , { recursive : true } ) ;
111+
112+ const downloads = TEST_DATASETS . map ( async ( { url, name } ) => {
113+ const savePath = path . join ( TEMP_DIR , name ) ;
114+ if ( fs . existsSync ( savePath ) ) {
115+ return ;
116+ }
117+ const response = await fetch ( url ) ;
118+ const data = await response . arrayBuffer ( ) ;
119+ fs . writeFileSync ( savePath , Buffer . from ( data ) ) ;
120+ } ) ;
121+ await Promise . all ( downloads ) ;
84122 } ,
85123
86124 async before (
0 commit comments