Included page: .FrontPage.QA.Extensions.QA.Extensions2022.SetUp (edit)

import
TBOT.Generic.Database


ddt: SetUp
key value
ConnectionString Server=10.153.120.216,1600;database=AUTOTESTING;User Id=automation; password=automation*100
BytesColumn DataObject
FileExtension ZIP
ExpectedDirectory \\EC2AMAZ-2GFJSTU.a648727226388.amazonaws.com\TZAPPS01SS-QA\IntegrationTests-OTT\BaselineFiles\Baseline\files\QA\YrSpecSuites\2022\BatchAutomation\Extensions
DownloadPath \\EC2AMAZ-2GFJSTU.a648727226388.amazonaws.com\TZAPPS01SS-QA\AutomationQA\_QATeam\FitnesseTestArtifacts\files\Actuals\QA\YrSpecSuites\2022\BatchAutomation\Extensions\Actuals
SourceDirectory \\EC2AMAZ-2GFJSTU.a648727226388.amazonaws.com\TZAPPS01SS-QA\AutomationQA\_QATeam\FitnesseTestArtifacts\files\Actuals\QA\YrSpecSuites\2022\BatchAutomation\Extensions\Actuals
TargetDirectory \\EC2AMAZ-2GFJSTU.a648727226388.amazonaws.com\TZAPPS01SS-QA\OTTDataQA\TrustElf\acks\EFTPS\incoming
CompareResultDir \\EC2AMAZ-2GFJSTU.a648727226388.amazonaws.com\TZAPPS01SS-QA\AutomationQA\_QATeam\FitnesseTestArtifacts\files\Results\QA\YrSpecSuites\2022\BatchAutomation\Extensions
ignorePathValidations false
DeleteFile true
variable defined: PAN=5010
variable defined: TaxYear=2022

Import Necessary Libraries

import
TBOT.Business
TBOT.Generic.Database

Execute BTMDB..Package

ddt: DynamicQuery SELECT LTRIM(RTRIM(Server)) AS Server,LTRIM(RTRIM(DB_NAME)) as DB_NAME ,AcctNo,'{{TaxYear}}' AS Tax_Year ,CONVERT(varchar(10),getdate(),111) as ActionDate from BTMDB..Package where AcctNo='{{PAN}}'
Comments# PAN TaxYear DB_NAME? AcctNo? Tax_Year? ActionDate? Server?
Test0001 5010 2022 $DBName1= $AcctNo1= $Tax_Year1= $Action_DT1= $Server1=


Download Bankdata record


ddt: KeywordFixture use {{DB_NAME}} select Action_Cd,DataObject,CONVERT(varchar(10),Action_DT,111) as Action_DT from bankdata where acctno='{{PAN}}' and year={{Year}} and state='' and prodopt=27 and Product_Cd='N'
Server DB_NAME PAN Year FileName DOWNLOAD? UNZIP? GETFILES? Action_Cd? Action_DT? DataObject?
$Server1 $DBName1 $AcctNo1 $Tax_Year1 5010_2022_EFTPS_Extension_Payment_1.zip True True $EDIFile1= 1 $Action_DT1 System.Byte[]


Generate EFTPSAck


ddt: BusinessKeyword
EDIPath AckDirPath EFTPSACK?
$EDIFile1 True



Move File to execute EFTPS-IN


ddt: KeywordFixture
sourcefilename EXTN FILECOPYNEW?
5010_2022_EFTPS_Extension_Payment_1 EDI True

******!

Run EFTPS-IN JOb


ddt: Dynamic Query exec OPERATIONSDB.OPERATIONSDB_P.QueueProcess @que_name = 'TEZIN-FST', @param_str = ' A=PRD', @ProdOpt = 0,@Key_Field = '{{JobName}}', @Trust_Key = 0, @Product_Code = '{{ProductCode}}', @Seq_Yr = 0, @process_code = 531, @locator='', @PermSeq = 0, @Mode = 'PRD'
JobName ProductCode
EFTPSIN F


Download Csv File

!*****> Download Block
DDT: KeywordFixture WAITFOR DELAY '00:00:15';use {{DataBaseName}} select Action_Cd,DataObject,CONVERT(varchar(10),Action_DT,111) as Action_DT from bankdata where acctno='{{PAN}}' and year='{{TaxYear}}' and state='' and prodopt=28 and SeqNo=1 and Product_CD='N'
Comment PAN TaxYear SeqNumber DataBaseName FileName DOWNLOAD? UNZIP? GETFILES?
Test0001 $AcctNo1 $Tax_Year1 $Seq_Number1 $DBName1 5010_2022_EFTPS_Extension_Payment_Report_1.zip True True $CSVFile1=

!*****> Assert EFTPS Filing

Validate Filing Assertions

ddt: DynamicQuery use {{DataBaseName}} select Action_Cd,DataObject,CONVERT(varchar(10),Action_DT,111) as Action_DT from bankdata where acctno='5010' and year=2022 and state='' and prodopt=27 and SeqNo=1 and Product_CD='N'
Comments# DataBaseName PAN TaxYear SeqNumber Action_Cd? Action_DT? DataObject?
Test0001 $DBName1 $AcctNo1 $Tax_Year1 $Seq_Number1 1 $Action_DT1 System.Byte[]


Checking Filing Status


ddt:DynamicQuery WAITFOR DELAY '00:00:10'; WAITFOR DELAY '00:00:10'; DECLARE @AssetID NVARCHAR(20) IF OBJECT_ID('tempdb..#tempPrepareExtensions') IS NOT NULL DROP TABLE #tempPrepareExtensions CREATE TABLE #tempPrepareExtensions ( Filing VARCHAR(200), StateCode VARCHAR(3), ProdOpt SMALLINT, Product_Cd CHAR(1), IsRowEnabled BIT, IsEstimatedEnabled BIT, SettlementDate DateTime, IsSettlementDateEnabled BIT, PrepareStatus VARCHAR(100), IsPrepareStatusEnabled BIT, PreparedDate DateTime, IsPreparedDateEnabled BIT, PreparedBy Varchar(3), IsPreparedByEnabled BIT, IsDoFileEnabled BIT, IsFiled BIT, IsFiledEnabled BIT, IsFiledVisible BIT, FiledDate DateTime, IsFiledDateEnabled BIT, FiledBy VARCHAR(3), IsFiledByEnabled BIT, FiledStatus VARCHAR(100), IsFiledStausEnabled BIT, ID INT, SeqNo SMALLINT, PreparedSettlementDate datetime, BatchOpt SMALLINT, Comments VARCHAR(255), ActionCode TINYINT ) select @AssetID=LTRIM(RTRIM(AssetID)) from BANKDB25.dbo.bankdata where acctno = '{{PAN}} 'and year = '{{YEAR}} 'and prodopt = '27' and Product_Cd='N' insert into #tempPrepareExtensions EXEC bankdb25.BANKDB_P.spGetExtensionFilingData '5010',2022,1 select CASE WHEN (CONVERT(VARCHAR(10),FiledDate,101) =CONVERT(VARCHAR(10),getDate(),101) AND IsFiled=1 AND FiledBy is not null) THEN 'Complete' ELSE 'Not Complete' END As FilingStatus, REPLACE(CONVERT(VARCHAR(15),FiledDate,12),':','') as FiledDateRegEx, REPLACE(CONVERT(VARCHAR(5),FiledDate,108),':','') as FiledDateTimeRegEx, CONVERT(nvarchar(6),PreparedDate,12) AS PreparedDateDateRegEx, CONVERT(nvarchar(15),SettlementDate,12) AS SettlementDateRegEx, Convert(nvarchar(10), PreparedDate, 101) AS PreparedDate1, Convert(nvarchar(10), SettlementDate, 101) AS SettlementDate1, @AssetID as AssetID from #tempPrepareExtensions where Filing like 'Federal%' IF OBJECT_ID('tempdb..#tempPrepareExtensions') IS NOT NULL DROP TABLE #tempPrepareExtensions
PAN YEAR FilingType FilingStatus? FiledDateRegEx? FiledDateTimeRegEx? PreparedDateDateRegEx? SettlementDateRegEx? AssetID? SettlementDate1? PreparedDate1?
5010 2022 Federal EFTPS (1041) Complete $FiledDateRegEx1= $FiledDateTimeRegEx1= $PreparedDateDateRegEx1= $SettlementDateRegEx1= $AssetID1= $SettlementDate1= $PreparedDate1=


Settlement date in csv file

!*****> Get Data from Package Table
ddt: DynamicQuery declare @dt DATETIME set @dt='{{settilementDate}}' select RTRIM(LTRIM(CAST(DATEPART(MM,convert(date,GETDATE())) as CHAR(2))))+'/' + RTRIM(LTRIM(CAST(DATEPART(DD,convert(date,GETDATE())) as CHAR(2)))) +'/' + CAST(DATEPART(YEAR,convert(date,GETDATE())) as CHAR(4)) as csvCurrentDate, RTRIM(LTRIM(CAST(DATEPART(MM,convert(date,@dt)) as CHAR(2))))+'/' + RTRIM(LTRIM(CAST(DATEPART(DD,convert(date,@dt)) as CHAR(2)))) +'/' + CAST(DATEPART(YEAR,convert(date,@dt)) as CHAR(4)) as csvSettlementDate
Comments# settilementDate csvCurrentDate? csvSettlementDate?
Test0001 $SettlementDateRegEx1 $csvCurrentDate1= $csvsettlementdate1=



File Compare for EDI file

!*****> File Compare Block
TBOT.Generic.SFTP
Comments sourceFile destinationFile destinationFullFilePath resultFileName IgnorePattern compareFiles?
Test0001 FederalEFTPS1041And990.edi $EDIFile1 Yes $AssetID1;290727570;230822;230823;0755;ST~813~\d*\\;SE~\d*~\d*\\;$FiledDateRegEx1;$FiledDateTimeRegEx1;$PreparedDateDateRegEx1;$SettlementDateRegEx1 Both Files are Equal




File Compare for CSV file

File Compare Block

TBOT.Generic.SFTP
Comments sourceFile destinationFile destinationFullFilePath resultFileName IgnorePattern compareFiles?
Test0001 FederalEFTPS1041And990CSV.txt $CSVFile1 Yes 08/22/2023;08/23/2023;$confirmationDate1;$SettlementDate1;$PreparedDate1;[0-9]{1,}:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1} [AMPM]{2};[0-9]{9}-[0-9]{1} Both Files are Equal