Example #1
0
        private void LoadTestCases()
        {
            DButils tsdb = DButils.Instance;

            nTestCaseList = new List <TestCase>(tsdb.GetAllTestCases(nTestSuite.TestSuiteID));
            counter       = nTestCaseList.Count();
            bUpdate       = true;
            ClearControllers();
            TestCasesDG.ItemsSource = nTestCaseList;
            TSNameTB.Text           = nTestSuite.TestSuiteName;
            TSJiraTB.Text           = nTestSuite.JiraLink;
            BrandCB.SelectedItem    = nTestSuite.Brand;
            VersionCB.SelectedItem  = nTestSuite.Version;

            TSNameTB.IsEnabled  = false;
            TSJiraTB.IsEnabled  = false;
            BrandCB.IsEnabled   = false;
            VersionCB.IsEnabled = false;
            SaveTSInfo.Content  = "Change TS info";

            TestCasesDG.IsEnabled  = true;
            TCID_TB.IsEnabled      = true;
            KeywordLB.IsEnabled    = true;
            TCObj.IsEnabled        = true;
            TCPrecon.IsEnabled     = true;
            TCAction.IsEnabled     = true;
            TCExpecRes.IsEnabled   = true;
            TCExecCB.IsEnabled     = true;
            TCPriorityCB.IsEnabled = true;
            AddTC.IsEnabled        = true;
            EditTC.IsEnabled       = true;
            RemoveTC.IsEnabled     = true;
            CancelTC.IsEnabled     = true;
            SaveTS.IsEnabled       = true;
        }
Example #2
0
        private void DeleteTSButton_Click(object sender, RoutedEventArgs e)
        {
            Home _home    = null;
            bool bSuccess = false;

            _home = GetHome(out bSuccess);

            if (bSuccess)
            {
                TestSuite sTestSuite = (TestSuite)_home.TestSuiteDG.SelectedItem;
                if (sTestSuite is null)
                {
                    MessageBox.Show("Please select a test suite");
                }
                else
                {
                    DButils tsdb = DButils.Instance;
                    tsdb.DeleteTestSuite(sTestSuite);
                    _home.LoadTestSuites();
                }
            }
            else
            {
                MessageBox.Show("You need to be in home screen to edit a test suite");
            }
        }
Example #3
0
 private void SaveTS_Click(object sender, RoutedEventArgs e)
 {
     if (TestCasesDG.ItemsSource is null)
     {
         MessageBox.Show("You must add at least one test case before you save the test suite");
     }
     else
     {
         bool bSuccess           = true;
         List <XmlDocument> xmls = new List <XmlDocument>();
         DButils            tsdb = DButils.Instance;
         nTestSuite.TestCases = nTestCaseList;
         XMLCreator TestSuite = new XMLCreator();
         xmls = TestSuite.CreateXML(nTestSuite);
         nTestSuite.TestSuiteDefinition  = xmls[0].InnerXml;
         nTestSuite.RegressionDefinition = xmls[1].InnerXml;
         nTestSuite.SmokeDefinition      = xmls[2].InnerXml;
         bSuccess = tsdb.SaveTestSuite(nTestSuite, bUpdate);
         bUpdate  = false;
         if (bSuccess)
         {
             TestCasesDG.ItemsSource = null;
             TestCasesDG.Items.Refresh();
             TSNameTB.Clear();
             TSJiraTB.Clear();
             VersionCB.SelectedIndex = 0;
             BrandCB.SelectedIndex   = 0;
         }
     }
 }
Example #4
0
        public void LoadTestSuites()
        {
            DButils          tsdb   = DButils.Instance;
            List <TestSuite> TSinfo = tsdb.GetAllTestSuites();

            TestSuiteDG.ItemsSource = TSinfo;
        }
Example #5
0
        public void LoadEssentials()
        {
            DButils        tsdb     = DButils.Instance;
            List <Keyword> Keywords = new List <Keyword>(tsdb.GetAllKeywords());

            KeywordLB.ItemsSource = Keywords;

            List <Versions> Versions = new List <Versions>(tsdb.GetAllVersions());

            VersionCB.ItemsSource = Versions;

            List <Network> Networks = new List <Network>(tsdb.GetAllNetworks());

            BrandCB.ItemsSource = Networks;
        }
Example #6
0
        private void ImportTSButton_Click(object sender, RoutedEventArgs e)
        {
            Home _home    = null;
            bool bSuccess = false;

            _home = GetHome(out bSuccess);

            if (bSuccess)
            {
                OpenFileDialog ofd = new OpenFileDialog();
                if (ofd.ShowDialog() == true)
                {
                    XmlDocument doc = new XmlDocument();
                    using (var myStream = ofd.OpenFile())
                    {
                        try
                        {
                            doc.Load(myStream);
                            XMLCreator xmlImporter = new XMLCreator();
                            TestSuite  nTestSuite  = xmlImporter.GetTestSuiteInformation(doc);

                            DButils tsdb = DButils.Instance;

                            nTestSuite.TestSuiteID = tsdb.getLastID("TestSuite") + 1;
                            tsdb.SaveTestSuite(nTestSuite, false);

                            _home.LoadTestSuites();
                        }
                        catch
                        {
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("You need to be in home screen to import a test suite");
            }
        }
Example #7
0
        private void SaveTSInfo_Click(object sender, RoutedEventArgs e)
        {
            if (SaveTSInfo.Content.ToString() == "Save TS Info")
            {
                if (TSNameTB.Text != "" && TSJiraTB.Text != "")
                {
                    DButils tsdb = DButils.Instance;
                    int     ID   = tsdb.getLastID("TestSuite");
                    try
                    {
                        //test comment
                        nTestSuite = new TestSuite()
                        {
                            TestSuiteID   = ++ID,
                            TestSuiteName = TSNameTB.Text,
                            JiraLink      = TSJiraTB.Text,
                            Brand         = ((Network)BrandCB.SelectedItem).NetworkTag.ToString(),
                            Version       = ((Versions)VersionCB.SelectedItem).VersionTag.ToString()
                        };
                        TSNameTB.IsEnabled  = false;
                        TSJiraTB.IsEnabled  = false;
                        BrandCB.IsEnabled   = false;
                        VersionCB.IsEnabled = false;
                        SaveTSInfo.Content  = "Change TS info";

                        TestCasesDG.IsEnabled  = true;
                        TCID_TB.IsEnabled      = true;
                        KeywordLB.IsEnabled    = true;
                        TCObj.IsEnabled        = true;
                        TCPrecon.IsEnabled     = true;
                        TCAction.IsEnabled     = true;
                        TCExpecRes.IsEnabled   = true;
                        TCExecCB.IsEnabled     = true;
                        TCPriorityCB.IsEnabled = true;
                        AddTC.IsEnabled        = true;
                        EditTC.IsEnabled       = true;
                        RemoveTC.IsEnabled     = true;
                        CancelTC.IsEnabled     = true;
                        SaveTS.IsEnabled       = true;
                    }
                    catch (NullReferenceException nre)
                    {
                        MessageBox.Show(nre.Message);
                    }
                }
                else
                {
                    MessageBox.Show("Please set a name and a jira link for the test suite");
                }
            }
            else
            {
                SaveTSInfo.Content  = "Save TS Info";
                TSNameTB.IsEnabled  = true;
                TSJiraTB.IsEnabled  = true;
                BrandCB.IsEnabled   = true;
                VersionCB.IsEnabled = true;

                TestCasesDG.IsEnabled  = false;
                TCID_TB.IsEnabled      = false;
                KeywordLB.IsEnabled    = false;
                TCObj.IsEnabled        = false;
                TCPrecon.IsEnabled     = false;
                TCAction.IsEnabled     = false;
                TCExpecRes.IsEnabled   = false;
                TCExecCB.IsEnabled     = false;
                TCPriorityCB.IsEnabled = false;
                AddTC.IsEnabled        = false;
                EditTC.IsEnabled       = false;
                RemoveTC.IsEnabled     = false;
                CancelTC.IsEnabled     = false;
                SaveTS.IsEnabled       = false;
            }
        }