示例#1
0
        public void SoapUICreateCopyTest()
        {
            //Arrange
            ActSoapUI actSoapUI = new ActSoapUI();

            actSoapUI.Description = "Soap Wrapper acttion test ";

            var xmlFilePath = TestResources.GetTestResourcesFile(@"XML\calculator_soapui_project.xml");

            actSoapUI.AddOrUpdateInputParamValue(ActSoapUI.Fields.ImportFile, xmlFilePath);
            actSoapUI.GetOrCreateInputParam(ActSoapUI.Fields.UIrelated, "False");
            actSoapUI.GetOrCreateInputParam(ActSoapUI.Fields.ImportFile, "True");
            actSoapUI.GetOrCreateInputParam(ActSoapUI.Fields.IgnoreValidation, "False");
            actSoapUI.GetOrCreateInputParam(ActSoapUI.Fields.TestCasePropertiesRequiered, "False");
            actSoapUI.GetOrCreateInputParam(ActSoapUI.Fields.AddXMLResponse, "False");
            actSoapUI.GetOrCreateInputParam(ActSoapUI.Fields.TestCasePropertiesRequieredControlEnabled, "False");


            //Act
            var duplicateAct = (ActSoapUI)actSoapUI.CreateCopy(true);

            //Assert
            Assert.AreEqual(actSoapUI.ActInputValues.Count, duplicateAct.ActInputValues.Count);
            Assert.AreEqual(actSoapUI.ActInputValues[1].Value.ToString(), duplicateAct.ActInputValues[1].Value.ToString());
        }
示例#2
0
        public ActSoapUIEditPage(GingerCore.Actions.ActSoapUI Act)
        {
            InitializeComponent();
            mAct = Act;

            Bind();
            mAct.SolutionFolder = App.UserProfile.Solution.Folder.ToUpper();
        }
示例#3
0
        public ActSoapUIEditPage(GingerCore.Actions.ActSoapUI act)
        {
            InitializeComponent();
            mAct     = act;
            mContext = Context.GetAsContext(act.Context);

            Bind();
            mAct.SolutionFolder = WorkSpace.Instance.Solution.Folder.ToUpper();
        }
示例#4
0
        public SoapUIUtils(Act act, string soapUIDirectoryPath, string reportExportDirectoryPath, string soapUISettingFile, string soapUISettingFilePassword, string projectPassword, bool RunSoapUIProcessAsAdmin, bool SoapUIProcessRedirectStandardError, bool SoapUIProcessRedirectStandardOutput, bool SoapUIProcessUseShellExecute, bool SoapUIProcessWindowStyle, bool SoapUIProcessCreateNoWindow)
        {
            //initializing components.
            mAct = (ActSoapUI)act;
            SoapUIDirectoryPath       = soapUIDirectoryPath;
            ReportExportDirectoryPath = reportExportDirectoryPath;
            SoapUISettingFile         = soapUISettingFile;
            SoapUISettingFilePassword = soapUISettingFilePassword;
            ProjectPassword           = projectPassword;

            mRunSoapUIProcessAsAdmin             = RunSoapUIProcessAsAdmin;
            mSoapUIProcessRedirectStandardError  = SoapUIProcessRedirectStandardError;
            mSoapUIProcessRedirectStandardOutput = SoapUIProcessRedirectStandardOutput;
            mSoapUIProcessUseShellExecute        = SoapUIProcessUseShellExecute;
            mSoapUIProcessWindowStyle            = SoapUIProcessWindowStyle;
            mSoapUIProcessCreateNoWindow         = SoapUIProcessCreateNoWindow;

            //Creating string for the report extract folder
            string XMLFileName = Path.GetFileName(mAct.GetInputParamCalculatedValue(ActSoapUI.Fields.XMLFile)).Replace(".xml", string.Empty);


            mTimestamp = DateTime.Now.ToString("yyyyMMdd-HHmmss");
            string SolutionFolder = mAct.SolutionFolder;

            //SoapUIDirectoryPath = SoapUIDirectoryPath.Replace(@"~\", SolutionFolder);
            SoapUIDirectoryPath = amdocs.ginger.GingerCoreNET.WorkSpace.Instance.SolutionRepository.ConvertSolutionRelativePath(SoapUIDirectoryPath);

            //Creating Directory to extract the reports.
            //string targetPath = ReportExportDirectoryPath.Replace(@"~\", SolutionFolder);
            string targetPath = amdocs.ginger.GingerCoreNET.WorkSpace.Instance.SolutionRepository.ConvertSolutionRelativePath(ReportExportDirectoryPath);

            if (!System.IO.Directory.Exists(targetPath))
            {
                System.IO.Directory.CreateDirectory(targetPath);
            }

            //ReportPathWithXMLFolder = System.IO.Path.Combine(ReportExportDirectoryPath.Replace(@"~\", SolutionFolder), mAct.Description + mTimestamp);
            ReportPathWithXMLFolder = System.IO.Path.Combine(amdocs.ginger.GingerCoreNET.WorkSpace.Instance.SolutionRepository.ConvertSolutionRelativePath(ReportExportDirectoryPath), mAct.Description + mTimestamp);

            ReportPath = ReportPathWithXMLFolder;
            Directory.CreateDirectory(ReportPath);
            mAct.LastExecutionFolderPath = ReportPath;
        }
示例#5
0
        public void WebServices_SoapWrapperActionTest()
        {
            WebServicesDriver mDriver = new WebServicesDriver(mBF);

            Agent           wsAgent         = new Agent();
            AgentOperations agentOperations = new AgentOperations(wsAgent);

            wsAgent.AgentOperations = agentOperations;

            wsAgent.DriverType = Agent.eDriverType.WebServices;
            ((AgentOperations)wsAgent.AgentOperations).Driver = mDriver;
            ApplicationAgent mAG = new ApplicationAgent();

            mAG.Agent = wsAgent;

            mGR          = new GingerRunner();
            mGR.Executor = new GingerExecutionEngine(mGR);

            ((GingerExecutionEngine)mGR.Executor).SolutionAgents = new ObservableList <Agent>();

            ((GingerExecutionEngine)mGR.Executor).SolutionAgents.Add(wsAgent);

            mGR.Executor.BusinessFlows.Add(mBF);

            Activity Activity2 = new Activity();

            Activity2.Active       = true;
            Activity2.ActivityName = "Soap UI Wrapper action";
            Activity2.CurrentAgent = wsAgent;
            mBF.Activities.Add(Activity2);

            ActSoapUI actSoapUi = new ActSoapUI();

            var xmlFilePath = TestResources.GetTestResourcesFile(@"XML" + Path.DirectorySeparatorChar + "calculator_soapui_project.xml");

            actSoapUi.AddNewReturnParams = true;
            actSoapUi.AddOrUpdateInputParamValue(ActSoapUI.Fields.ImportFile, xmlFilePath);

            mBF.Activities[0].Acts.Add(actSoapUi);

            Assert.AreEqual(1, actSoapUi.ActInputValues.Count);
            Assert.AreEqual(xmlFilePath, actSoapUi.ActInputValues[0].Value.ToString());
        }