@@ -305,13 +305,16 @@ export class Mitchell_Importer extends Importer {
305305 ) => {
306306 const hasSelectedItemized = selectedTypeForCommit === 'Itemized' ;
307307 const hasSelectedBundled = selectedTypeForCommit === 'Bundled' ;
308+ const hasSeletedGrouped = selectedTypeForCommit === 'Grouped' ;
308309 const numberOfInputs = forgettables . length * 8 ;
309310 const percentagePerCell = VERIFICATION_PROGRESS_BREAKPOINT / numberOfInputs ;
310311 this . progressUpdater . setStep ( percentagePerCell ) ;
311312 if ( hasSelectedItemized ) {
312313 await this . populateItemized ( forgettables ) ;
313314 } else if ( hasSelectedBundled ) {
314315 await this . populateBundled ( forgettables ) ;
316+ } else if ( hasSeletedGrouped ) {
317+ await this . populateGrouped ( forgettables ) ;
315318 }
316319 } ;
317320
@@ -446,6 +449,64 @@ export class Mitchell_Importer extends Importer {
446449 await snooze ( 4000 ) ; // wait until modal is closed
447450 } ;
448451
452+ private populateGrouped = async ( forgettables : MitchellForgettable [ ] ) => {
453+ for ( let i = 0 ; i < forgettables . length ; i ++ ) {
454+ const { description, extPrice, consumableLineNote } = forgettables [ i ] ;
455+ await this . typeMitchellValue ( description ) ;
456+ this . progressUpdater . update ( ) ;
457+
458+ await times ( 4 ) . pressKey ( Key . Tab ) ;
459+ await times ( 2 ) . pressKey ( Key . Down ) ; // Selecting Part Type to be Aftermarket New
460+
461+
462+ await keyboard . pressKey ( Key . Enter ) ; // Select it
463+ await keyboard . releaseKey ( Key . Enter ) ;
464+ this . progressUpdater . update ( ) ;
465+ await snooze ( 250 ) ;
466+
467+ await keyboard . pressKey ( Key . LeftShift ) ; // Hold Left Shift
468+
469+ for ( let i = 0 ; i < 5 ; i ++ ) {
470+ await keyboard . pressKey ( Key . Tab ) ;
471+ await keyboard . releaseKey ( Key . Tab ) ;
472+ }
473+
474+ await keyboard . releaseKey ( Key . LeftShift ) ; // Release Left Shift
475+ this . progressUpdater . update ( ) ;
476+
477+
478+ await this . typeMitchellValue ( extPrice ) ; // type totalPrice;
479+ this . progressUpdater . update ( ) ;
480+ await snooze ( 250 )
481+
482+ await this . pressTabButton ( 2 ) ; // go to (+More) button
483+ this . progressUpdater . update ( ) ;
484+
485+ await keyboard . pressKey ( Key . Enter ) ; // press Add Line with Enter to open Dropdown
486+ await keyboard . releaseKey ( Key . Enter ) ;
487+ await snooze ( 250 )
488+
489+
490+ await times ( 4 ) . pressKey ( Key . Down ) ; // Select Add New explanation
491+ await keyboard . pressKey ( Key . Enter ) ; // Press Add new explanation to open the textarea
492+ await keyboard . releaseKey ( Key . Enter ) ;
493+
494+ await this . typeMitchellValue ( consumableLineNote ) ; // Write the consumableLineNote
495+ this . progressUpdater . update ( ) ;
496+
497+ await this . pressTabButton ( 4 ) ; // go to Add Line
498+ await keyboard . pressKey ( Key . Enter ) ; // press Add Line with Enter
499+ await keyboard . releaseKey ( Key . Enter ) ;
500+ this . progressUpdater . update ( ) ;
501+ await snooze ( 6000 ) ; // wait until modal is closed
502+
503+ if ( i < forgettables . length - 1 ) {
504+ await mouse . leftClick ( ) ; // open the modal again for the next line
505+ }
506+ }
507+ } ;
508+
509+
449510 private commitMitchellData = async ( commitButtonCoordinates : Point , electronWindow : BrowserWindow ) => {
450511 await mouse . setPosition ( commitButtonCoordinates ) ;
451512 await mouse . leftClick ( ) ;
0 commit comments