38
38
import org .labkey .test .TestFileUtils ;
39
39
import org .labkey .test .TestTimeoutException ;
40
40
import org .labkey .test .categories .Daily ;
41
+ import org .labkey .test .components .assay .AssayConstants ;
41
42
import org .labkey .test .components .ext4 .Checkbox ;
42
43
import org .labkey .test .pages .ReactAssayDesignerPage ;
43
44
import org .labkey .test .pages .admin .ExportFolderPage ;
68
69
@ BaseWebDriverTest .ClassTimeout (minutes = 10 )
69
70
public class AssayExportImportTest extends BaseWebDriverTest
70
71
{
72
+ public static final String INSTRUMENT_SETTING_FIELD_NAME = "instrumentSetting" ;
73
+ public static final String RUN_FILE_FIELD_NAME = "runFileField" ;
74
+ public static final String OPERATOR_EMAIL_FIELD_NAME = "operatorEmail" ;
75
+ public static final String INSTRUMENT_FIELD_NAME = "instrument" ;
71
76
private final String ASSAY_PROJECT_FOR_EXPORT_01 = "Assay_Project_For_Export_ByFilesWebPart" ;
72
77
private final String ASSAY_PROJECT_FOR_IMPORT_01 = "Assay_Project_For_Import_ByFilesWebPart" ;
73
78
private final String ASSAY_PROJECT_FOR_EXPORT_02 = "Assay_Project_For_Export_ByFile" ;
@@ -170,16 +175,16 @@ private Integer createSimpleProjectAndAssay(String projectName, String assayName
170
175
protocol .getDomains ().forEach (domain -> domains .put (domain .getName (), domain ));
171
176
172
177
Domain batchDomain = domains .get ("Batch Fields" );
173
- batchDomain .getFields ().add (new FieldDefinition ("operatorEmail" , ColumnType .String ));
174
- batchDomain .getFields ().add (new FieldDefinition ("instrument" , ColumnType .String )
178
+ batchDomain .getFields ().add (new FieldDefinition (OPERATOR_EMAIL_FIELD_NAME , ColumnType .String ));
179
+ batchDomain .getFields ().add (new FieldDefinition (INSTRUMENT_FIELD_NAME , ColumnType .String )
175
180
.setDescription ("The diagnostic test instrument." ));
176
181
177
182
Domain runDomain = domains .get ("Run Fields" );
178
183
List <PropertyDescriptor > runFields = runDomain .getFields ();
179
- runFields .add (new FieldDefinition ("instrumentSetting" , ColumnType .Integer )
184
+ runFields .add (new FieldDefinition (INSTRUMENT_SETTING_FIELD_NAME , ColumnType .Integer )
180
185
.setDescription ("The configuration setting on the instrument." ));
181
186
if (hasRunFileField )
182
- runFields .add (new FieldDefinition ("runFileField" , ColumnType .File )
187
+ runFields .add (new FieldDefinition (RUN_FILE_FIELD_NAME , ColumnType .File )
183
188
.setDescription ("File for the run." ));
184
189
domains .get ("Run Fields" ).setFields (runFields );
185
190
@@ -236,7 +241,7 @@ public void populateAssay(String projectName, String assayName, boolean useFiles
236
241
clickAndWait (Locator .lkButton ("Import Data" ));
237
242
}
238
243
239
- waitForElement (Locator . tagWithName ( "select" , "targetStudy" ) );
244
+ waitForElement (AssayConstants . TARGET_STUDY_FIELD_LOCATOR );
240
245
241
246
if (null != batchProperties )
242
247
{
@@ -267,7 +272,7 @@ public void populateAssay(String projectName, String assayName, boolean useFiles
267
272
if (fileIndex < runProperties .size ())
268
273
{
269
274
clickAndWait (Locator .lkButton ("Save and Import Another Run" ));
270
- waitForElement (Locator .tagWithName ("input" , "instrumentSetting" ));
275
+ waitForElement (Locator .tagWithName ("input" , INSTRUMENT_SETTING_FIELD_NAME ));
271
276
}
272
277
273
278
}
@@ -276,7 +281,7 @@ public void populateAssay(String projectName, String assayName, boolean useFiles
276
281
if (isElementPresent (Locator .lkButton ("Save and Import Another Run" )))
277
282
{
278
283
clickAndWait (Locator .lkButton ("Save and Import Another Run" ));
279
- waitForElement (Locator .tagWithName ("input" , "instrumentSetting" ));
284
+ waitForElement (Locator .tagWithName ("input" , INSTRUMENT_SETTING_FIELD_NAME ));
280
285
}
281
286
}
282
287
@@ -383,14 +388,14 @@ public void validateImportingFileUsingFilesWebPart() throws Exception
383
388
RUN04_FILE );
384
389
385
390
Map <String , String > batchProperties = new HashMap <>();
386
- batchProperties .put ("operatorEmail" , OPERATOR_EMAIL_01 );
387
- batchProperties .put ("instrument" , INSTRUMENT_NAME_01 );
391
+ batchProperties .put (OPERATOR_EMAIL_FIELD_NAME , OPERATOR_EMAIL_01 );
392
+ batchProperties .put (INSTRUMENT_FIELD_NAME , INSTRUMENT_NAME_01 );
388
393
389
394
List <Map <String , String >> runProperties = new ArrayList <>();
390
- runProperties .add (Maps .of ("name " , RUN01_NAME , "comments " , COMMENT_BASIC_01 + RUN01_NAME , "instrumentSetting" , INSTRUMENT_SETTING_01 ));
391
- runProperties .add (Maps .of ("name " , RUN02_NAME , "comments " , COMMENT_BASIC_01 + RUN02_NAME , "instrumentSetting" , INSTRUMENT_SETTING_01 ));
392
- runProperties .add (Maps .of ("name " , RUN03_NAME , "comments " , COMMENT_BASIC_01 + RUN03_NAME , "instrumentSetting" , INSTRUMENT_SETTING_01 ));
393
- runProperties .add (Maps .of ("name " , RUN04_NAME , "comments " , COMMENT_BASIC_01 + RUN04_NAME , "instrumentSetting" , INSTRUMENT_SETTING_01 ));
395
+ runProperties .add (Maps .of ("Name " , RUN01_NAME , "Comments " , COMMENT_BASIC_01 + RUN01_NAME , INSTRUMENT_SETTING_FIELD_NAME , INSTRUMENT_SETTING_01 ));
396
+ runProperties .add (Maps .of ("Name " , RUN02_NAME , "Comments " , COMMENT_BASIC_01 + RUN02_NAME , INSTRUMENT_SETTING_FIELD_NAME , INSTRUMENT_SETTING_01 ));
397
+ runProperties .add (Maps .of ("Name " , RUN03_NAME , "Comments " , COMMENT_BASIC_01 + RUN03_NAME , INSTRUMENT_SETTING_FIELD_NAME , INSTRUMENT_SETTING_01 ));
398
+ runProperties .add (Maps .of ("Name " , RUN04_NAME , "Comments " , COMMENT_BASIC_01 + RUN04_NAME , INSTRUMENT_SETTING_FIELD_NAME , INSTRUMENT_SETTING_01 ));
394
399
395
400
log ("Populate the assay '" + SIMPLE_ASSAY_FOR_EXPORT + "' by using files in the Files WebPart." );
396
401
populateAssay (ASSAY_PROJECT_FOR_EXPORT_01 , SIMPLE_ASSAY_FOR_EXPORT , true , runFiles , batchProperties , runProperties , SAMPLE_TXT_FILE );
@@ -478,14 +483,14 @@ public void validateImportingFileUsingRunProperties() throws Exception
478
483
RUN04_FILE );
479
484
480
485
Map <String , String > batchProperties = new HashMap <>();
481
- batchProperties .put ("operatorEmail" , OPERATOR_EMAIL_02 );
482
- batchProperties .put ("instrument" , INSTRUMENT_NAME_02 );
486
+ batchProperties .put (OPERATOR_EMAIL_FIELD_NAME , OPERATOR_EMAIL_02 );
487
+ batchProperties .put (INSTRUMENT_FIELD_NAME , INSTRUMENT_NAME_02 );
483
488
484
489
List <Map <String , String >> runProperties = new ArrayList <>();
485
- runProperties .add (Maps .of ("name " , RUN01_NAME , "comments " , COMMENT_BASIC_02 + RUN01_NAME , "instrumentSetting" , INSTRUMENT_SETTING_02 ));
486
- runProperties .add (Maps .of ("name " , RUN02_NAME , "comments " , COMMENT_BASIC_02 + RUN02_NAME , "instrumentSetting" , INSTRUMENT_SETTING_02 ));
487
- runProperties .add (Maps .of ("name " , RUN03_NAME , "comments " , COMMENT_BASIC_02 + RUN03_NAME , "instrumentSetting" , INSTRUMENT_SETTING_02 ));
488
- runProperties .add (Maps .of ("name " , RUN04_NAME , "comments " , COMMENT_BASIC_02 + RUN04_NAME , "instrumentSetting" , INSTRUMENT_SETTING_02 ));
490
+ runProperties .add (Maps .of ("Name " , RUN01_NAME , "Comments " , COMMENT_BASIC_02 + RUN01_NAME , INSTRUMENT_SETTING_FIELD_NAME , INSTRUMENT_SETTING_02 ));
491
+ runProperties .add (Maps .of ("Name " , RUN02_NAME , "Comments " , COMMENT_BASIC_02 + RUN02_NAME , INSTRUMENT_SETTING_FIELD_NAME , INSTRUMENT_SETTING_02 ));
492
+ runProperties .add (Maps .of ("Name " , RUN03_NAME , "Comments " , COMMENT_BASIC_02 + RUN03_NAME , INSTRUMENT_SETTING_FIELD_NAME , INSTRUMENT_SETTING_02 ));
493
+ runProperties .add (Maps .of ("Name " , RUN04_NAME , "Comments " , COMMENT_BASIC_02 + RUN04_NAME , INSTRUMENT_SETTING_FIELD_NAME , INSTRUMENT_SETTING_02 ));
489
494
490
495
log ("Populate the assay '" + SIMPLE_ASSAY_FOR_EXPORT + "' by importing the file through the 'Run Properties'." );
491
496
populateAssay (ASSAY_PROJECT_FOR_EXPORT_02 , SIMPLE_ASSAY_FOR_EXPORT , false , runFiles , batchProperties , runProperties , null );
@@ -583,8 +588,8 @@ private void createGeneralAssayWithoutTransform(String assayName)
583
588
ReactAssayDesignerPage assayDesignerPage = _assayHelper .createAssayDesign ("General" , assayName );
584
589
585
590
log ("Remove the batch fields we don't care about." );
586
- assayDesignerPage .goToBatchFields ().removeField ("ParticipantVisitResolver" )
587
- .removeField ("TargetStudy" );
591
+ assayDesignerPage .goToBatchFields ().removeField (AssayConstants . PARTICIPANT_VISIT_RESOLVER_FIELD_NAME )
592
+ .removeField (AssayConstants . TARGET_STUDY_FIELD_NAME );
588
593
589
594
assayDesignerPage .goToResultsFields ()
590
595
.removeAllFields (false )
@@ -665,25 +670,25 @@ public void testExportXarToPipeline() throws Exception
665
670
ImportRunCommand run1 = new ImportRunCommand (assayId , RUN01_FILE );
666
671
run1 .setName (RUN01_NAME );
667
672
run1 .setComment (commentPrefix + RUN01_NAME );
668
- run1 .setProperties (Maps .of ("instrumentSetting" , instrumentSetting ));
673
+ run1 .setProperties (Maps .of (INSTRUMENT_SETTING_FIELD_NAME , instrumentSetting ));
669
674
run1 .execute (cn , exportProject );
670
675
671
676
ImportRunCommand run2 = new ImportRunCommand (assayId , RUN02_FILE );
672
677
run2 .setName (RUN02_NAME );
673
678
run2 .setComment (commentPrefix + RUN02_NAME );
674
- run2 .setProperties (Maps .of ("instrumentSetting" , instrumentSetting ));
679
+ run2 .setProperties (Maps .of (INSTRUMENT_SETTING_FIELD_NAME , instrumentSetting ));
675
680
run2 .execute (cn , exportProject );
676
681
677
682
ImportRunCommand run3 = new ImportRunCommand (assayId , RUN03_FILE );
678
683
run3 .setName (RUN03_NAME );
679
684
run3 .setComment (commentPrefix + RUN03_NAME );
680
- run3 .setProperties (Maps .of ("instrumentSetting" , instrumentSetting ));
685
+ run3 .setProperties (Maps .of (INSTRUMENT_SETTING_FIELD_NAME , instrumentSetting ));
681
686
run3 .execute (cn , exportProject );
682
687
683
688
ImportRunCommand run4 = new ImportRunCommand (assayId , RUN04_XLSX_FILE );
684
689
run4 .setName (RUN04_NAME );
685
690
run4 .setComment (commentPrefix + RUN04_NAME );
686
- run4 .setProperties (Maps .of ("instrumentSetting" , instrumentSetting ));
691
+ run4 .setProperties (Maps .of (INSTRUMENT_SETTING_FIELD_NAME , instrumentSetting ));
687
692
run4 .execute (cn , exportProject );
688
693
689
694
List <String > runColumns = Arrays .asList ("adjustedM1" , "M2" );
0 commit comments