Example #1
0
        /// <summary>
        /// Set QC Test properties.
        /// </summary>
        /// <param name="QCTest"></param>
        /// <param name="tc"></param>
        /// <returns></returns>
        private bool ChangeTestCase(ExcelTest tc)
        {
            bool blnResult = false;

            if (ActiveTest != null)
            {
                try
                {
                    ActiveTest.Name = tc.Name;
                    ActiveTest["TS_DESCRIPTION"] = tc.Message;
                    ActiveTest["TS_STATUS"] = "5 - Ready";
                    ActiveTest.Post();
                    blnResult = true;
                }
                catch (Exception ex)
                {
                    Message = "Could not change properties of test" + ActiveTest.Name + "\n" + ex.Message;
                }
            }

            return blnResult;
        }
        ///=================================================================================================================
        /// Test cases
        ///=================================================================================================================
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        /// 
        public static bool PutTestCase(ExcelTest test)
        {
            bool blnResult = false;

            if (Framework._type == REPOSITORY_TYPE.ALM)
            {
                blnResult = Framework._qc.SaveTest(test);
            }
            else if (Framework._type == REPOSITORY_TYPE.NETWORK)
            {
                blnResult = Framework._nw.SaveTest(test);
            }
            else
            {
                // log
            }

            return blnResult;
        }
Example #3
0
        public override bool SaveTest(ExcelTest source)
        {
            bool blnResult = false;

            if (UploadTestCase(source))
            {
                blnResult = true;
            }

            return blnResult;
        }
Example #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="TestCase"></param>
        /// <returns></returns>
        public bool UploadTestCase(ExcelTest TestCase)
        {
            bool blnFound = false;
            bool blnResult = false;
            Message = "";

            // Check if testcase is found. Set active test
            if (FindTestCase(TestCase.Name))
            {
                blnFound = true;
            }
            // copy test case
            else
            {
                if (CopyTestCase(TestCase))
                {
                    blnFound = true;
                }
            }

            if (blnFound)
            {
                if (ChangeTestCase(TestCase))
                {
                    if (AddToTestSet())
                    {
                        blnResult = true;
                    }
                }
            }

            return blnResult;
        }
Example #5
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="TestCase"></param>
        /// <returns></returns>
        public bool CopyTestCase(ExcelTest TestCase)
        {
            bool blnResult = false;

            try
            {
                // Copy template
                ISupportCopyPaste copy = (ISupportCopyPaste)ProjectFactory;
                string clipboard = copy.CopyToClipBoard(ProcessTemplate.ID, 0, "");

                // Paste template
                ISupportCopyPaste paste = (ISupportCopyPaste)ProcessFactory;
                paste.PasteFromClipBoard(clipboard, ProcessFolder.NodeID.ToString(), 0, 0);

                // find the just pasted process template;
                blnResult = FindTestCase("Process_template");
            }
            catch (Exception ex)
            {
                Message = "Could not paste Process_template from " + Framework.ActiveApplication.QCTestPlan + " to " + Framework.ActiveProcess.QCTestPlan + " in ALM.";
            }

            return blnResult;
        }
        public bool DoWork(ExcelTest test)
        {
            bool blnResult = false;

            // Read flow
            // Read test data
            if (Prepare())
            {
                // Convert flow
                if (Convert())
                {
                    blnResult = true;
                }
            }

            Finish();

            return blnResult;
        }
        public virtual bool SaveTest(ExcelTest source)
        {
            bool blnResult = false;

            return blnResult;
        }
 public CompiledTest(ExcelTest test)
 {
     this.Base = test;
 }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private bool ReadTestCases()
        {
            bool blnResult = true;

            for (long row = PROCESS_ROWS.Testcase; row <= shtTestcases.RowMax; row++)
            {
                if (!string.IsNullOrEmpty(shtTestcases.Values[row,PROCESS_COLUMNS.ID]))
                {
                    ExcelTest exceltest = new ExcelTest();

                    exceltest.ID = shtTestcases.Values[row, PROCESS_COLUMNS.ID];
                    exceltest.Description = shtTestcases.Values[row, PROCESS_COLUMNS.Description];
                    exceltest.ExpectedResult = shtTestcases.Values[row, PROCESS_COLUMNS.ExpectedResult];
                    exceltest.ResourceID = shtTestcases.Values[row, PROCESS_COLUMNS.RepositoryID];
                    exceltest.Flow = DetermineBasicFlow(shtTestcases.Values[row, PROCESS_COLUMNS.Flow]);

                    for (long col = PROCESS_COLUMNS.Data; col <= shtTestcases.ColMax; col++)
                    {
                        if (!string.IsNullOrEmpty(shtTestcases.Values[row, col]))
                        {
                            ExcelData data = new ExcelData();
                            data.Name = shtTestcases.Values[PROCESS_ROWS.Header,col];
                            data.Value = shtTestcases.Values[row,col];
                            exceltest.Data.Add(data);
                        }
                    }

                    exceltest.Row = row;
                    this.TestCases.Add(exceltest);
                }
            }

            return blnResult;
        }