private void AddSendExecutionDataToExternalSourceAction(object sender, RoutedEventArgs e)
        {
            RunSetActionSendDataToExternalSource runSetActionSendDataToExternalSource = new RunSetActionSendDataToExternalSource();

            runSetActionSendDataToExternalSource.Name  = runSetActionSendDataToExternalSource.Type;
            runSetActionSendDataToExternalSource.RunAt = RunSetActionBase.eRunAt.ExecutionEnd;
            mRunSetConfig.RunSetActions.Add(runSetActionSendDataToExternalSource);
            RunSetActionsGrid.Grid.SelectedItem = runSetActionSendDataToExternalSource;

            RunSetActionSendDataToExternalSourceOperations runSetActionSendDataToExternalSourceOperations = new RunSetActionSendDataToExternalSourceOperations(runSetActionSendDataToExternalSource);

            runSetActionSendDataToExternalSource.RunSetActionSendDataToExternalSourceOperations = runSetActionSendDataToExternalSourceOperations;

            RunSetActionBaseOperations runSetActionBaseOperations = new RunSetActionBaseOperations(runSetActionSendDataToExternalSource);

            runSetActionSendDataToExternalSource.runSetActionBaseOperations = runSetActionBaseOperations;
        }
Exemple #2
0
        internal void ProcessRunSetActions(List <RunSetActionBase.eRunAt> runAtList)
        {
            //Not closing Ginger Helper and not executing all actions
            ReportInfo RI = new ReportInfo(RunsetExecutionEnvironment, this);

            foreach (RunSetActionBase RSA in RunSetConfig.RunSetActions)
            {
                //set Operations object to call execute, specific to runsetAtion
                if (RSA is RunSetActionHTMLReport)
                {
                    RunSetActionHTMLReportOperations runSetActionHTMLReport = new RunSetActionHTMLReportOperations((RunSetActionHTMLReport)RSA);
                    ((RunSetActionHTMLReport)RSA).RunSetActionHTMLReportOperations = runSetActionHTMLReport;
                }
                if (RSA is RunSetActionAutomatedALMDefects)
                {
                    RunSetActionAutomatedALMDefectsOperations runSetActionAutomatedALMDefects = new RunSetActionAutomatedALMDefectsOperations((RunSetActionAutomatedALMDefects)RSA);
                    ((RunSetActionAutomatedALMDefects)RSA).RunSetActionAutomatedALMDefectsOperations = runSetActionAutomatedALMDefects;
                }
                if (RSA is RunSetActionGenerateTestNGReport)
                {
                    RunSetActionGenerateTestNGReportOperations runSetActionGenerateTestNGReport = new RunSetActionGenerateTestNGReportOperations((RunSetActionGenerateTestNGReport)RSA);
                    ((RunSetActionGenerateTestNGReport)RSA).RunSetActionGenerateTestNGReportOperations = runSetActionGenerateTestNGReport;
                }
                if (RSA is RunSetActionHTMLReportSendEmail)
                {
                    RunSetActionHTMLReportSendEmailOperations runSetActionHTMLReportSendEmail = new RunSetActionHTMLReportSendEmailOperations((RunSetActionHTMLReportSendEmail)RSA);
                    ((RunSetActionHTMLReportSendEmail)RSA).RunSetActionHTMLReportSendEmailOperations = runSetActionHTMLReportSendEmail;
                }
                if (RSA is RunSetActionPublishToQC)
                {
                    RunSetActionPublishToQCOperations runSetActionPublishToQC = new RunSetActionPublishToQCOperations((RunSetActionPublishToQC)RSA);
                    ((RunSetActionPublishToQC)RSA).RunSetActionPublishToQCOperations = runSetActionPublishToQC;
                }
                if (RSA is RunSetActionSaveResults)
                {
                    RunSetActionSaveResultsOperations runSetActionSaveResults = new RunSetActionSaveResultsOperations((RunSetActionSaveResults)RSA);
                    ((RunSetActionSaveResults)RSA).RunSetActionSaveResultsOperations = runSetActionSaveResults;
                }
                if (RSA is RunSetActionScript)
                {
                    RunSetActionScriptOperations runSetActionScript = new RunSetActionScriptOperations((RunSetActionScript)RSA);
                    ((RunSetActionScript)RSA).RunSetActionScriptOperations = runSetActionScript;
                }
                if (RSA is RunSetActionJSONSummary)
                {
                    RunSetActionJSONSummaryOperations runSetActionJSONSummary = new RunSetActionJSONSummaryOperations((RunSetActionJSONSummary)RSA);
                    ((RunSetActionJSONSummary)RSA).RunSetActionJSONSummaryOperations = runSetActionJSONSummary;
                }
                if (RSA is RunSetActionSendDataToExternalSource)
                {
                    RunSetActionSendDataToExternalSourceOperations runSetActionSendDataToExternalSource = new RunSetActionSendDataToExternalSourceOperations((RunSetActionSendDataToExternalSource)RSA);
                    ((RunSetActionSendDataToExternalSource)RSA).RunSetActionSendDataToExternalSourceOperations = runSetActionSendDataToExternalSource;
                }
                if (RSA is RunSetActionSendEmail)
                {
                    RunSetActionSendEmailOperations runSetActionSendEmail = new RunSetActionSendEmailOperations((RunSetActionSendEmail)RSA);
                    ((RunSetActionSendEmail)RSA).RunSetActionSendEmailOperations = runSetActionSendEmail;
                }
                if (RSA is RunSetActionSendFreeEmail)
                {
                    RunSetActionSendFreeEmailOperations runSetActionSendFreeEmail = new RunSetActionSendFreeEmailOperations((RunSetActionSendFreeEmail)RSA);
                    ((RunSetActionSendFreeEmail)RSA).RunSetActionSendFreeEmailOperations = runSetActionSendFreeEmail;
                }
                if (RSA is RunSetActionSendSMS)
                {
                    RunSetActionSendSMSOperations runSetActionSendSMS = new RunSetActionSendSMSOperations((RunSetActionSendSMS)RSA);
                    ((RunSetActionSendSMS)RSA).RunSetActionSendSMSOperations = runSetActionSendSMS;
                }


                RunSetActionBaseOperations runSetActionBaseOperations = new RunSetActionBaseOperations(RSA);
                RSA.runSetActionBaseOperations = runSetActionBaseOperations;

                if (RSA.Active == true && runAtList.Contains(RSA.RunAt))
                {
                    switch (RSA.RunAt)
                    {
                    case RunSetActionBase.eRunAt.DuringExecution:
                        if (RSA is RunSetActions.RunSetActionPublishToQC)
                        {
                            RSA.PrepareDuringExecAction(Runners);
                        }
                        break;

                    case RunSetActionBase.eRunAt.ExecutionStart:
                    case RunSetActionBase.eRunAt.ExecutionEnd:
                        bool b = CheckRSACondition(RI, RSA);
                        if (b)
                        {
                            RSA.runSetActionBaseOperations.RunAction(RI);
                        }
                        break;
                    }
                }
            }
        }