public void ViewBudget()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC02_ViewBudget");
                FpBudgetAdministrationPage budgetAdministrationPage = new FpBudgetAdministrationPage();

                strTestCaseNo = "TC002_Reg";
                strtblname    = "automation_budgetadministration";
                strTestType   = "Regression";

                var connection     = new ConnectToMySQL_Fetch_TestData();
                var testdataBudget = connection.Select(strtblname, strTestCaseNo, strTestType);

                string strBudgetName = testdataBudget[3];
                string strOrgGroup   = testdataBudget[5];

                try
                {
                    budgetAdministrationPage.ViewBudget(strOrgGroup, strBudgetName);
                    PropertiesCollection.test.Log(Status.Pass, "VIEW BUDGET => BUDGET: " + strBudgetName + " is successful");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Pass, "VIEW BUDGET => BUDGET: " + strBudgetName + " is unsuccessful");
                }
            }
        public void NavigateShiftAdminBeforeSave()
        {
            strTestCaseNo = "TC006_Reg";
            strtblname    = "automation_shiftadministration";
            strTestType   = "Regression";

            PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC06_NavigateShiftAdminBeforeSave");
            FpAdminMenus adminmenus = new FpAdminMenus();

            adminmenus.AdminClick();
            adminmenus.LnkShiftAdministration.Click();

            clsShiftAdministration shiftadmin = new clsShiftAdministration();

            var connection    = new ConnectToMySQL_Fetch_TestData();
            var testdataShift = connection.Select(strtblname, strTestCaseNo, strTestType);

            strShiftName = testdataShift[4];

            shiftadmin.NavigateShiftAdminBeforeSave(strShiftName);
            adminmenus.AdminClick();
            adminmenus.LnkShiftAdministration.Click();
            if (shiftadmin.btnConfirmationOK.Displayed == true && shiftadmin.btnConfirmationOK.Enabled == true)
            {
                shiftadmin.btnConfirmationOK.Click();
            }
        }
        public void TC01_ReadStripDoc_ReadDoc()
        {
            String strTestCaseNo = "Read_TC003";

            PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC01_ReadStripDoc_ReadDoc");

            //Fetching data from My SQL Database
            var connection = new ConnectToMySQL_Fetch_TestData();
            var testData   = connection.Select(strtblname, strTestCaseNo, strTestType);

            IRestResponse response = ReadRestRequest(strTestCaseNo);

            PropertiesCollection.test.Log(Status.Pass, "Response" + response.Content);

            //Retrieving & printing the Response code
            int intRespCode = Get_StatusCode(response);

            try
            {
                Console.WriteLine("intResponse: " + intRespCode);
                Assert.AreEqual(intRespCode, 200);
                PropertiesCollection.test.Log(Status.Pass, "Status Response is 200 OK");
            }
            catch
            {
                PropertiesCollection.test.Log(Status.Fail, "Status Response is not 200 OK");
            }
        }
        public IRestResponse CreateRestRequest(String TestCaseNo)
        {
            //Fetching data from My SQL Database
            var connection = new ConnectToMySQL_Fetch_TestData();
            var testData   = connection.Select(strtblname, TestCaseNo, strTestType);

            //Code to get current date & time and replace minutes with 05 starts
            if (TestCaseNo == "TC006_Asset")
            {
                plannedEndTime   = DateTime.Now.ToUniversalTime();
                plannedStartTime = plannedEndTime.AddHours(2);
            }
            else
            {
                plannedStartTime = DateTime.Now.ToUniversalTime();
                plannedEndTime   = plannedStartTime.AddHours(2);
            }

            strPlannedStartTime = plannedStartTime.ToString("yyyy-MM-ddThh:mm:ss.fffZ");
            strPlannedEndTime   = plannedEndTime.ToString("yyyy-MM-ddThh:mm:ss.fffZ");

            strPlannedStartTime = strPlannedStartTime.Remove(14, 2);
            strPlannedStartTime = strPlannedStartTime.Insert(14, "05");

            strPlannedEndTime = strPlannedEndTime.Remove(14, 2);
            strPlannedEndTime = strPlannedEndTime.Insert(14, "05");
            //Code to get current date & time and replace minutes with 05 ends

            var client  = new RestClient(ConfigurationManager.AppSettings["InsertStripEndPoint"]);
            var request = new RestRequest(ConfigurationManager.AppSettings["InsertStripResource"], Method.POST);

            //Adding headers to the POST request
            request.AddHeader("Content-Type", ConfigurationManager.AppSettings["Content-Type"]);
            request.AddHeader("X-ExternalRequest-ID", ConfigurationManager.AppSettings["X-ExternalRequest-ID"]);
            request.AddHeader("X-ExternalSystem-ID", ConfigurationManager.AppSettings["X-ExternalSystem-ID"]);
            request.AddHeader("X-Date", ConfigurationManager.AppSettings["X-Date"]);

            //Adding XML Body
            if (TestCaseNo == "TC001_Asset" || TestCaseNo == "TC006_Asset" || TestCaseNo == "TC005_Asset")
            {
                request.AddParameter("undefined", "<?xml version=\"1.0\"?>\n<Strip>\n  <AssetID>" + testData[4] + "</AssetID>\n  <SubTypeID>" + testData[5] + "</SubTypeID>\n  <Details>" + testData[6] + "</Details>\n  <Details2>" + testData[7] + "</Details2>\n  <PlannedStartTime>" + strPlannedStartTime + "</PlannedStartTime>\n  <PlannedEndTime>" + strPlannedEndTime + "</PlannedEndTime>\n  <Type>" + testData[8] + "</Type>\n</Strip>", ParameterType.RequestBody);
            }
            else if (TestCaseNo == "TC002_Asset")
            {
                request.AddParameter("undefined", "<?xml version=\"1.0\"?>\n<Strip>\n  <SubTypeID>" + testData[5] + "</SubTypeID>\n  <Details>" + testData[6] + "</Details>\n  <Details2>" + testData[7] + "</Details2>\n  <PlannedStartTime>" + strPlannedStartTime + "</PlannedStartTime>\n  <PlannedEndTime>" + strPlannedEndTime + "</PlannedEndTime>\n  <Type>" + testData[8] + "</Type>\n</Strip>", ParameterType.RequestBody);
            }
            else if (TestCaseNo == "TC003_Asset")
            {
                request.AddParameter("undefined", "<?xml version=\"1.0\"?>\n<Strip>\n  <AssetID>" + testData[4] + "</AssetID>\n  <Details>" + testData[6] + "</Details>\n  <Details2>" + testData[7] + "</Details2>\n  <PlannedStartTime>" + strPlannedStartTime + "</PlannedStartTime>\n  <PlannedEndTime>" + strPlannedEndTime + "</PlannedEndTime>\n  <Type>" + testData[8] + "</Type>\n</Strip>", ParameterType.RequestBody);
            }
            else if (TestCaseNo == "TC004_Asset")
            {
                request.AddParameter("undefined", "<?xml version=\"1.0\"?>\n<Strip>\n  <AssetID>" + testData[4] + "</AssetID>\n  <SubTypeID>" + testData[5] + "</SubTypeID>\n  <Details>" + testData[6] + "</Details>\n  <Details2>" + testData[7] + "</Details2>\n  <PlannedStartTime>" + strPlannedStartTime + "</PlannedStartTime>\n  <PlannedEndTime>" + strPlannedEndTime + "</PlannedEndTime>\n</Strip>", ParameterType.RequestBody);
            }

            //Triggering the Request
            IRestResponse response = client.Execute(request);

            return(response);
        }
            public void DeleteBudget()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC06_DeleteBudget");
                FpBudgetAdministrationPage budgetAdministrationPage = new FpBudgetAdministrationPage();

                strTestCaseNo = "TC006_Reg";
                strtblname    = "automation_budgetadministration";
                strTestType   = "Regression";

                var connection     = new ConnectToMySQL_Fetch_TestData();
                var testdataBudget = connection.Select(strtblname, strTestCaseNo, strTestType);

                string strBudgetName = testdataBudget[3];
                string strOrgGroup   = testdataBudget[5];

                Console.WriteLine(strBudgetName);
                Console.WriteLine(strOrgGroup);

                budgetAdministrationPage.DeleteBudget(strOrgGroup, strBudgetName);

                string[] strBudgetDetails = budgetAdministrationPage.RetrieveBudgetDetails(strBudgetName);

                try
                {
                    Console.WriteLine("Budget name retrieved is: " + strBudgetDetails);
                    Assert.AreNotEqual(strBudgetDetails, strBudgetName);
                    PropertiesCollection.test.Log(Status.Pass, "DELETE BUDGET => Budget Deletion is successful");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "DELETE BUDGET => Budget Deletion is not successful");
                }
            }
            public void DeletePlanningBoard()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC05_DeletePlanningBoard");
                FpDefinePlanningBoardsPage planningBoardsPage = new FpDefinePlanningBoardsPage();

                strTestCaseNo = "TC005_Reg";
                strtblname    = "automation_defineplanningboard";
                strTestType   = "Regression";

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataDefinePlanningBoard = connection.Select(strtblname, strTestCaseNo, strTestType);

                strTDPlanningBoardName = testdataDefinePlanningBoard[3];
                strTDOrganisationGroup = testdataDefinePlanningBoard[5];

                PropertiesCollection.driver.Navigate().Refresh();
                planningBoardsPage.DeletePlanningBoard(strTDPlanningBoardName, strTDOrganisationGroup);

                Thread.Sleep(3000);
                string[] strFPwebPlanningBoardName = planningBoardsPage.RetrievePlanningBoarddetails(strTDPlanningBoardName);

                try
                {
                    Assert.AreNotEqual(strTDPlanningBoardName, strFPwebPlanningBoardName);
                    PropertiesCollection.test.Log(Status.Pass, "DELETE PLANNING BOARD => Planning Board: " + strTDPlanningBoardName + " has been deleted");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "DELETE PLANNING BOARD => Planning Board deletion has failed");
                }
            }
            public void AddPlanningBoard()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC01_AddPlanningBoard");
                FpDefinePlanningBoardsPage planningBoardsPage = new FpDefinePlanningBoardsPage();

                strTestCaseNo = "TC001_Reg";
                strtblname    = "automation_defineplanningboard";
                strTestType   = "Regression";

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataDefinePlanningBoard = connection.Select(strtblname, strTestCaseNo, strTestType);

                strTDPlanningBoardName = testdataDefinePlanningBoard[3];
                strTDOrganisationGroup = testdataDefinePlanningBoard[5];
                strTDSelectOrgGroup    = testdataDefinePlanningBoard[6];

                planningBoardsPage.AddPlanningBoard(strTDPlanningBoardName, strTDOrganisationGroup, strTDSelectOrgGroup);
                Thread.Sleep(5000);
                String[] strFPwebPlanningBoardName = planningBoardsPage.RetrievePlanningBoarddetails(strTDPlanningBoardName);

                try
                {
                    Assert.AreEqual(strTDPlanningBoardName, strFPwebPlanningBoardName[0]);
                    PropertiesCollection.test.Log(Status.Pass, "ADD PLANNING BOARD => Planning Board: " + strFPwebPlanningBoardName[0] + " created and validated");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "ADD PLANNING BOARD => Planning Board creation has failed");
                }
            }
Example #8
0
            public void DeleteActivityType()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC05_DeleteActivityType");
                FpActivityTypesPage activityTypesPage = new FpActivityTypesPage();

                strTestCaseNo = "TC005_Reg";
                strtblname    = "automation_activitytype";
                strTestType   = "Regression";

                var connection            = new ConnectToMySQL_Fetch_TestData();
                var testdataActivityBoard = connection.Select(strtblname, strTestCaseNo, strTestType);

                strTDActivityTypeName = testdataActivityBoard[4];

                activityTypesPage.DeleteActivity(strTDActivityTypeName);
                string[] strActivityTypesName = activityTypesPage.RetrieveActivitydetails(strTDActivityTypeName);
                Console.WriteLine("Activity type name retrieved from web is: " + strActivityTypesName[1]);

                Thread.Sleep(4000);

                try
                {
                    Assert.AreNotEqual(strActivityTypesName[1], strTDActivityTypeName);
                    PropertiesCollection.test.Log(Status.Pass, "DELETE ACTIVITY TYPE => Acitivity type: " + strTDActivityTypeName + " has been deleted successfully.");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "DELETE ACTIVITY TYPE => Acitivity type: " + strTDActivityTypeName + "  Deletion has failed");
                }
            }
        public void TC01_ReadStripDoc_ReadDoc_InvalidStripReportID()
        {
            String strTestCaseNo = "Read_TC004";

            PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC01_ReadStripDoc_ReadDoc");

            //Fetching data from My SQL Database
            var connection = new ConnectToMySQL_Fetch_TestData();
            var testData   = connection.Select(strtblname, strTestCaseNo, strTestType);

            IRestResponse response = ReadRestRequest(strTestCaseNo);

            PropertiesCollection.test.Log(Status.Pass, "Response" + response.Content);

            try
            {
                // Fetching the response content to check that the StripReportID has invalid format
                var responseContent = response.Content;
                Assert.IsTrue(responseContent.Contains("FP101"));
                PropertiesCollection.test.Log(Status.Pass, "Status Response is not 400 due to invalid format of StripReportID");
            }
            catch
            {
                PropertiesCollection.test.Log(Status.Fail, "Status Response is not 400");
            }
        }
        public void TC07_ReadStripTaskTemplate_InvalidFormat_AssetTypeID()
        {
            String strTestCaseNo = "Read_TC007";

            PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC07_ReadStripTaskTemplate_InvalidFormat_AssetTypeID");

            //Fetching data from My SQL Database
            var connection = new ConnectToMySQL_Fetch_TestData();

            var testdata_details = connection.Select(strtblname, strTestCaseNo, strTestType);

            string strTDPaneID      = testdata_details[3];
            string strTDAssetTypeID = testdata_details[4];
            string strTDCode        = testdata_details[6];

            var client  = new RestClient(ConfigurationManager.AppSettings["BaseURL"]);
            var request = new RestRequest("StripTaskTemplates/", Method.GET);

            //Adding headers to the request
            request.AddHeader("Content-Type", ConfigurationManager.AppSettings["Content-Type"]);
            request.AddHeader("X-ExternalRequest-ID", ConfigurationManager.AppSettings["X-ExternalRequest-ID"]);
            request.AddHeader("X-ExternalSystem-ID", ConfigurationManager.AppSettings["X-ExternalSystem-ID"]);
            request.AddHeader("X-Date", ConfigurationManager.AppSettings["X-Date"]);

            //Adding parameter to the request
            request.AddParameter("PaneID", strTDPaneID);
            request.AddParameter("AssetTypeID", strTDAssetTypeID);

            //Executing the Request and getting the response
            var response = client.Execute(request);
            var doc      = new XmlDocument();

            doc.LoadXml(response.Content);
            var Code = doc.GetElementsByTagName("Code")[0].InnerText;

            //Retrieving & printing the Response code

            HttpStatusCode statusCode  = response.StatusCode;
            int            intRespCode = (int)statusCode;

            try
            {
                Assert.AreEqual(intRespCode, 400);
                PropertiesCollection.test.Log(Status.Pass, "Status Response is " + intRespCode);
            }
            catch
            {
                PropertiesCollection.test.Log(Status.Fail, "Status Response is " + intRespCode);
            }

            try
            {
                Assert.AreEqual(Code, strTDCode);
                PropertiesCollection.test.Log(Status.Pass, "Error Code is " + Code);
            }
            catch
            {
                PropertiesCollection.test.Log(Status.Fail, "Error Code is " + Code);
            }
        }
Example #11
0
            public void TS05_PlanningBoard_TC06_DeleteActivity()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS05_PlanningBoard_TC06_DeleteActivity");

                String strTestCaseNo = "TC001";
                String strtblname = "automation_planningboard";
                String strTestType = "Smoke";

                string strTDActivityCode = String.Empty;
                string strTDActivityName = String.Empty;
                string strTDOrganisationGroupName = String.Empty;

                /* Get test data from MySQL */

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataDefinePlanningBoard = connection.Select(strtblname, strTestCaseNo, strTestType);

                strTDOrganisationGroupName = testdataDefinePlanningBoard[8];

                FpPlanningBoardPage PlanningBoard = new FpPlanningBoardPage();
                PlanningBoard.DeleteActivity(strTDOrganisationGroupName);
                
                try
                {

                    Assert.IsFalse(PlanningBoard.ActivitySelected.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Activity deleted successfully on Planning Board");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Activity not deleted on Planning Board");
                    throw;
                }
            }
Example #12
0
            public void AddActivityType()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC01_AddActivityType");
                FpActivityTypesPage activityTypesPage = new FpActivityTypesPage();

                strTestCaseNo = "TC001_Reg";
                strtblname    = "automation_activitytype";
                strTestType   = "Regression";

                var connection            = new ConnectToMySQL_Fetch_TestData();
                var testdataActivityBoard = connection.Select(strtblname, strTestCaseNo, strTestType);

                string strTDShortCode        = testdataActivityBoard[3];
                string strTDActivityTypeName = testdataActivityBoard[4];
                string strTDColour           = testdataActivityBoard[5];

                activityTypesPage.AddActivitydetails(strTDShortCode, strTDActivityTypeName, strTDColour);

                Thread.Sleep(5000);
                string[] strFPActivityName = activityTypesPage.RetrieveActivitydetails(strTDActivityTypeName);

                try
                {
                    Assert.AreEqual(strFPActivityName[1], strTDActivityTypeName);
                    PropertiesCollection.test.Log(Status.Pass, "ADD ACTIVITY TYPE => Activity Type: " + strTDActivityTypeName + " created and validated");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "ADD ACTIVITY TYPE => Activity Type creation has failed");
                }
            }
            public void EditPlanningBoard()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC02_EditPlanningBoard");
                FpDefinePlanningBoardsPage planningBoardsPage = new FpDefinePlanningBoardsPage();

                strTestCaseNo = "TC002_Reg";
                strtblname    = "automation_defineplanningboard";
                strTestType   = "Regression";

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataDefinePlanningBoard = connection.Select(strtblname, strTestCaseNo, strTestType);

                strTDPlanningBoardName = testdataDefinePlanningBoard[3];
                strTDOrganisationGroup = testdataDefinePlanningBoard[5];

                string SupportingOrgGroup = planningBoardsPage.EditPlanningBoard(strTDPlanningBoardName, strTDOrganisationGroup);

                try
                {
                    Assert.AreEqual(SupportingOrgGroup, "true");
                    PropertiesCollection.test.Log(Status.Pass, "EDIT PLANNING BOARD => Planning Board: " + strTDPlanningBoardName + " has been edited successfully");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "EDIT PLANNING BOARD => Planning Board editing has failed");
                }

                Thread.Sleep(4000);
            }
Example #14
0
            public void TS05_PlanningBoard_TC03_AssignPlanningBoardToSecurityGroup()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS05_PlanningBoard_TC03_AssignPlanningBoardToSecurityGroup");

                String strTestCaseNo = "TC001";
                String strtblname = "automation_defineplanningboard";
                String strTestType = "Smoke";

                string strTDPlanningBoardName = String.Empty;
                string strTDPlanningSecurityGroupName = String.Empty;

                /* Get test data from MySQL */

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataDefinePlanningBoard = connection.Select(strtblname, strTestCaseNo, strTestType);

                strTDPlanningBoardName = testdataDefinePlanningBoard[3];
                strTDPlanningSecurityGroupName = testdataDefinePlanningBoard[4];
                
                //var conn = new ConnectToSQLServer();
                //bool result = conn.AssignPlanningBoardToSecurityGroup(strTDPlanningBoardName, strTDPlanningSecurityGroupName);
                                            
                try
                {
                    //Assert.AreEqual(result, true);
                    PropertiesCollection.test.Log(Status.Pass, "Planning Board assigned to Security Group");            
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Pass, "Planning Board: " + strTDPlanningBoardName + " is assigned to" + strTDPlanningSecurityGroupName);
                    throw;
                }
                
            }
Example #15
0
            public void TS05_PlanningBoard_TC02_AddPlanningBoard()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS05_PlanningBoard_TC02_AddPlanningBoard");
                                
                String strTestCaseNo = "TC001";
                String strtblname = "automation_defineplanningboard";
                String strTestType = "Smoke";

                                             
                /* Get test data from MySQL */

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataDefinePlanningBoard = connection.Select(strtblname, strTestCaseNo, strTestType);

                string strTDPlanningBoardName = testdataDefinePlanningBoard[3];
                string strTDOrganisationGroup = testdataDefinePlanningBoard[5];
                string strTDSelectOrgGroup = testdataDefinePlanningBoard[6];

                FpDefinePlanningBoardsPage PlanningBoard = new FpDefinePlanningBoardsPage();
                PlanningBoard.AddPlanningBoard(strTDPlanningBoardName, strTDOrganisationGroup, strTDSelectOrgGroup);
                String[] strFPwebPlanningBoardName = PlanningBoard.RetrievePlanningBoarddetails(strTDPlanningBoardName);

                try
                {
                    Assert.AreEqual(strTDPlanningBoardName, strFPwebPlanningBoardName[0]);
                    PropertiesCollection.test.Log(Status.Pass, "Planning Board: " + strFPwebPlanningBoardName[0] + " created and validated");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Planning Board Name is not matching");
                    throw;
                }

            }
Example #16
0
        public void VerifyErrorMessages()
        {
            string strTestCaseNo = "TC002_Reg";

            strTestType = "Regression";
            PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC02_VerifyErrorMessages");
            string[] list;
            var      connection     = new ConnectToMySQL_Fetch_TestData();
            var      testdataRoster = connection.Select(strtblname, strTestCaseNo, strTestType);

            list = connection.Select(strtblname, strTestCaseNo, strTestType);
            var TopbarMenu = new clsMainPage_TopbarMenu();

            System.Threading.Thread.Sleep(2000);
            var RosterAdministration = new clsRosterAdministration();

            TopbarMenu.NavigatetoRosterAdministration();
            String strTDRosterName         = testdataRoster[4];
            String strTDPane               = testdataRoster[5];
            String strTDTimeZoneorLocation = testdataRoster[6];
            String strTDTimeZone           = testdataRoster[7];
            String strTDLocation           = testdataRoster[8];
            String strTDPeople             = testdataRoster[9];
            String strTDShiftDetails       = testdataRoster[10];
            String strTDStatus             = testdataRoster[11];

            RosterAdministration.VerifyErrorMessages(strTDRosterName, strTDPane, strTDTimeZoneorLocation, strTDTimeZone, strTDLocation, strTDPeople, strTDShiftDetails, strTDStatus);
        }
        public void TC03_DeleteStripDoc_InvalidURL()
        {
            String strTestCaseNo = "Delete_TC003";

            PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC03_DeleteStripDoc_InvalidURL");
            Object[] ObjDBResponse = new object[7];

            //Fetching data from My SQL Database
            var connection = new ConnectToMySQL_Fetch_TestData();
            var testData   = connection.Select(strtblname, strTestCaseNo, strTestType);

            //Connecting to application database and retrieving the current count of documents attached to the strip
            string        strConnectionString = "Data Source=" + ConfigurationManager.AppSettings["SQLServerDataSource"] + ";Initial Catalog=" + ConfigurationManager.AppSettings["SQLServerInitialCatalog"] + ";Integrated Security=" + ConfigurationManager.AppSettings["SQLServerIntegratedSecurity"] + ';';
            SqlConnection myConnection        = new SqlConnection(strConnectionString);

            myConnection.Open();

            IRestResponse response = DeleteRestRequest(strTestCaseNo);
            var           doc      = new XmlDocument();

            doc.LoadXml(response.Content);
            String        query;
            SqlCommand    command;
            SqlDataReader reader = null;

            //Retrieving & printing the Response code
            int intRespCode = Get_StatusCode(response);


            if (intRespCode == 400)
            {
                Object[] dbResponse = new object[7];

                query   = "select count(*) from dbo.tblstripreport where StripReportID = '" + testData[3] + "'";
                command = new SqlCommand(query, myConnection);
                reader  = command.ExecuteReader();

                try
                {
                    Assert.AreNotEqual(query, 0);
                    PropertiesCollection.test.Log(Status.Pass, "Strip Document has not been deleted from the Database");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Strip Document has been deleted from the Database");
                }

                try
                {
                    Assert.AreEqual(doc.GetElementsByTagName("Code")[0].InnerText, "FP101");
                    PropertiesCollection.test.Log(Status.Pass, "Validation of the Code has passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Validation of the Code has failed");
                }
            }
        }
            public void EditBudget()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC03_EditBudget");
                FpBudgetAdministrationPage budgetAdministrationPage = new FpBudgetAdministrationPage();

                strTestCaseNo = "TC003_Reg";
                strtblname    = "automation_budgetadministration";
                strTestType   = "Regression";
                Int64  intDBAllocation = 0;
                string strDBBudgetDesc = "";

                var connection     = new ConnectToMySQL_Fetch_TestData();
                var testdataBudget = connection.Select(strtblname, strTestCaseNo, strTestType);

                string strBudgetName  = testdataBudget[3];
                string strDescription = testdataBudget[4];
                string strOrgGroup    = testdataBudget[5];
                string strAllocation  = testdataBudget[13];

                budgetAdministrationPage.EditBudget(strOrgGroup, strBudgetName, strDescription, strAllocation);

                connectionString = "Data Source=" + ConfigurationManager.AppSettings["SQLServerDataSource"] + ";Initial Catalog=" + ConfigurationManager.AppSettings["SQLServerInitialCatalog"] + ";Integrated Security=" + ConfigurationManager.AppSettings["SQLServerIntegratedSecurity"] + ';';
                sqlCon           = new SqlConnection(connectionString);
                sqlCon.Open();

                string        query   = "select Description,Allocation From tblBudget where BudgetName = '" + strBudgetName + "'";
                SqlCommand    command = new SqlCommand(query, sqlCon);
                SqlDataReader reader  = command.ExecuteReader();

                while (reader.Read())
                {
                    strDBBudgetDesc = reader.GetString(0);
                    intDBAllocation = reader.GetInt64(1);
                }

                reader.Close();

                try
                {
                    Assert.AreEqual(strDBBudgetDesc, strDescription);
                    PropertiesCollection.test.Log(Status.Pass, "EDIT BUDGET => BUDGET: " + strBudgetName + " description edit is successful");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "EDIT BUDGET => BUDGET: " + strBudgetName + " description edit is not successful");
                }
                try
                {
                    intDBAllocation = intDBAllocation / 60;
                    int allocation = Int32.Parse(strAllocation);
                    Assert.AreEqual(intDBAllocation, allocation);
                    PropertiesCollection.test.Log(Status.Pass, "EDIT BUDGET => BUDGET: " + strBudgetName + " allocation edit is successful");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "EDIT BUDGET => BUDGET: " + strBudgetName + " allocation edit is not successful");
                }
            }
        public void CopyShiftAdmin()
        {
            strTestCaseNo = "TC004_Reg";
            strtblname    = "automation_shiftadministration";
            strTestType   = "Regression";

            PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC04_CopyShiftAdmin");
            FpAdminMenus adminmenus = new FpAdminMenus();

            adminmenus.AdminClick();
            adminmenus.LnkShiftAdministration.Click();

            clsShiftAdministration shiftadmin = new clsShiftAdministration();

            var connection    = new ConnectToMySQL_Fetch_TestData();
            var testdataShift = connection.Select(strtblname, strTestCaseNo, strTestType);

            strShiftName = testdataShift[4];

            shiftadmin.CopyShiftdetails(strShiftName);
            string[] shiftdetails = shiftadmin.RetrieveShiftdetails(strShiftName + " (Copy)");

            string strfbwebshiftname  = shiftdetails[0];
            string strfbwebshortcode  = shiftdetails[1];
            string strfbwebstarttime  = shiftdetails[2];
            string strfbwebDuration   = shiftdetails[3];
            string strfbwebCurrencies = shiftdetails[4];
            string strfbwebStatus     = shiftdetails[5];

            try {
                Assert.AreEqual(strShiftName + " (Copy)", strfbwebshiftname);
                PropertiesCollection.test.Log(Status.Pass, strfbwebstarttime + " Copied Shift Name validated Succesfully");
            }
            catch
            {
                PropertiesCollection.test.Log(Status.Fail, strfbwebstarttime + " Copied Shift Name not validated Succesfully");
            }
            try
            {
                Assert.AreEqual(strUpdatedStartdate, strfbwebstarttime);
                PropertiesCollection.test.Log(Status.Pass, strfbwebstarttime + " Copied Shift Start Date validated Succesfully");
            }
            catch
            {
                PropertiesCollection.test.Log(Status.Fail, strfbwebstarttime + " Copied Shift Start Date not validated Succesfully");
            }
            try
            {
                Assert.AreEqual(strUpdatedDuration, strfbwebDuration);
                PropertiesCollection.test.Log(Status.Pass, strfbwebstarttime + " Copied Shift Duration validated Succesfully");
            }
            catch
            {
                PropertiesCollection.test.Log(Status.Fail, strfbwebstarttime + " Copied Shift Duration not validated Succesfully");
            }
            Thread.Sleep(4000);
        }
Example #20
0
            public void Delete_Knowledbase_Item_OrgGroupForUserWithoutSO31_WithRestriction()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("Delete Knowledgebase Item assigned to Org Group where user does not have SO 31 access and with restricted viewing");

                String strTestCaseNo = "TC008";
                String strtblname    = "automation_summary_knowledgebase";
                String strTestType   = "Progression";


                /* Get test data from MySQL */

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataSummary_Knowledgebase = connection.Select(strtblname, strTestCaseNo, strTestType);


                string strTDTitle           = testdataSummary_Knowledgebase[3];
                string strTDRestrictViewing = testdataSummary_Knowledgebase[7];
                string strTDUser            = testdataSummary_Knowledgebase[11];
                string strTDLogin           = testdataSummary_Knowledgebase[20];

                /* Identify OrgGroupId for the OrgGroup */

                string strSQLtblname      = "tblPeopleGroup";
                string strtblselectcolumn = "PeopleGroupID";
                string strtblcolumn       = "PeopleGroupName";
                string strwherecondn      = strTDUser;
                var    conn       = new ConnectToSQLServer();
                string OrgGroupID = conn.Select(strSQLtblname, strtblselectcolumn, strtblcolumn, strwherecondn);


                ConnectToMySQL_Fetch_TestData MySQLConnect = new ConnectToMySQL_Fetch_TestData();

                String[] TestData = new string[3];
                TestData = MySQLConnect.GetLoginDetails(strTDLogin);

                string strTDUsername = TestData[1];
                string strTDPassword = TestData[2];

                FpLoginPage loginPage = new FpLoginPage();

                loginPage.LoginWithUserCredentials(strTDUsername, strTDPassword);

                FpKnowledgeBasePage Knowledgebase = new FpKnowledgeBasePage();

                Knowledgebase.Delete_Knowledgebase_Item_AssignedtoOrgGroup(strTDTitle, strTDRestrictViewing, OrgGroupID);

                try
                {
                    Assert.IsTrue(Knowledgebase.txtKBItem.Displayed);
                    PropertiesCollection.test.Log(Status.Fail, "Knowledgebase Item could not be deleted");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Pass, "Knowledgebase Item deleted");
                }
            }
            public void ReturnWithOutSave()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC04_ReturnWithOutSave");
                FpDefinePlanningBoardsPage planningBoardsPage = new FpDefinePlanningBoardsPage();

                strTestCaseNo = "TC004_Reg";
                strtblname    = "automation_defineplanningboard";
                strTestType   = "Regression";

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataDefinePlanningBoard = connection.Select(strtblname, strTestCaseNo, strTestType);

                strTDPlanningBoardName = testdataDefinePlanningBoard[3];
                strTDOrganisationGroup = testdataDefinePlanningBoard[5];

                planningBoardsPage.btnOrgGroupSelector.Click();
                Thread.Sleep(3000);
                planningBoardsPage.txtOrganisationGroup.SendKeys(strTDOrganisationGroup);
                Thread.Sleep(2000);
                planningBoardsPage.cboOrganisationGroupSelection.Click();
                Thread.Sleep(3000);
                planningBoardsPage.btnApply.Click();
                Thread.Sleep(5000);

                for (int i = 0; i < planningBoardsPage.txtAllPlanningBoardName.Count; i++)
                {
                    if (planningBoardsPage.txtAllPlanningBoardName.ElementAt(i).Text.Equals(strTDPlanningBoardName))
                    {
                        planningBoardsPage.btnEditPlanningBoard.ElementAt(i).Click();
                        break;
                    }
                }
                Thread.Sleep(10000);
                planningBoardsPage.chkSupportingOrgGroups.Click();
                planningBoardsPage.btnReturn.Click();
                Thread.Sleep(5000);

                string errorMessage         = planningBoardsPage.txtConfirmationMsg.Text;
                string expectedErrorMessage = "Any unsaved changes will be lost. Are you sure?";

                try
                {
                    Assert.AreEqual(errorMessage, expectedErrorMessage);
                    PropertiesCollection.test.Log(Status.Pass, "CLICK ON RETURN BEFORE SAVE => Validation for confirmation message received when returning to planning board list before save has been successful");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "CLICK ON RETURN BEFORE SAVE => Validation for confirmation message received when returning to planning board list before save has not been successful");
                }

                planningBoardsPage.btnConfirmationCancel.Click();
                Thread.Sleep(2000);
                planningBoardsPage.btnSave.Click();
                Thread.Sleep(5000);
            }
            public void VerifyErrorMessages()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC03_VerifyErrorMessages");
                FpDefinePlanningBoardsPage planningBoardsPage = new FpDefinePlanningBoardsPage();

                strTestCaseNo = "TC003_Reg";
                strtblname    = "automation_defineplanningboard";
                strTestType   = "Regression";

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataDefinePlanningBoard = connection.Select(strtblname, strTestCaseNo, strTestType);

                strTDPlanningBoardName = testdataDefinePlanningBoard[3];
                strTDOrganisationGroup = testdataDefinePlanningBoard[5];
                string strTDEditPlanningBoardName = testdataDefinePlanningBoard[7];

                planningBoardsPage.btnOrgGroupSelector.Click();
                Thread.Sleep(3000);
                planningBoardsPage.txtOrganisationGroup.SendKeys(strTDOrganisationGroup);
                Thread.Sleep(2000);
                planningBoardsPage.cboOrganisationGroupSelection.Click();
                Thread.Sleep(3000);
                planningBoardsPage.btnApply.Click();
                Thread.Sleep(5000);

                for (int i = 0; i < planningBoardsPage.txtAllPlanningBoardName.Count; i++)
                {
                    if (planningBoardsPage.txtAllPlanningBoardName.ElementAt(i).Text.Equals(strTDPlanningBoardName))
                    {
                        planningBoardsPage.btnEditPlanningBoard.ElementAt(i).Click();
                        break;
                    }
                }
                Thread.Sleep(8000);
                planningBoardsPage.txtName.SendKeys(strTDEditPlanningBoardName);

                string errorMessage         = planningBoardsPage.txtErrorMessage.Text;
                string expectedErrorMessage = "Name cannot be greater than 50 characters.";

                try
                {
                    Assert.AreEqual(errorMessage, expectedErrorMessage);
                    PropertiesCollection.test.Log(Status.Pass, "VERIFY ERROR MESSAGE => Error message received has been validated successfully on Edit Planning board page");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "VERIFY ERROR MESSAGE => Validation failed for Error message received on Edit Planning board page");
                }

                Thread.Sleep(5000);
                planningBoardsPage.txtName.Clear();
                planningBoardsPage.txtName.SendKeys(strTDPlanningBoardName);
                planningBoardsPage.btnSave.Click();
                Thread.Sleep(5000);
            }
Example #23
0
            public void TS03_TC05_RosterAdmin_DeleteRoster()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS03_TC04_RosterAdmin_DeleteRoster");
                String strtblname = "automation_rosteradministration";

                string[] list;
                var      connection = new ConnectToMySQL_Fetch_TestData();

                list = connection.Select(strtblname, strTestCaseNo, strTestType);
                string strTDRosterName = list[4];
                Int64  RosterID        = 0;

                var TopbarMenu           = new clsMainPage_TopbarMenu();
                var RosterAdministration = new clsRosterAdministration();

                TopbarMenu.NavigatetoRosterAdministration();

                string        strConnectionString = "Data Source=" + ConfigurationManager.AppSettings["SQLServerDataSource"] + ";Initial Catalog=" + ConfigurationManager.AppSettings["SQLServerInitialCatalog"] + ";User Id=" + ConfigurationManager.AppSettings["SQLServerUserId"] + ";Password="******"SQLServerPassword"];
                SqlConnection myConnection        = new SqlConnection(strConnectionString);

                myConnection.Open();
                SqlDataReader reader   = null;
                String        strQuery = "select RosterID from tblRoster where RosterName = '" + strTDRosterName + "';";
                SqlCommand    command  = new SqlCommand(strQuery, myConnection);

                reader = command.ExecuteReader();
                while (reader.Read())
                {
                    RosterID = Convert.ToInt64(reader.GetValue(0));
                    Console.WriteLine("RosterID" + RosterID);
                }
                reader.Close();

                String     strQuery1 = "delete from tblRoster where RosterID = '" + RosterID + "';";
                SqlCommand command1  = new SqlCommand(strQuery1, myConnection);

                command1.ExecuteNonQuery();
                myConnection.Close();

                System.Threading.Thread.Sleep(3000);

                string[] rosterdetails      = RosterAdministration.RetrieveRosterdetails(list[4]);
                string   strfbwebrostername = rosterdetails[0];

                //try
                //{
                //    Assert.IsNull(strfbwebrostername);
                //    PropertiesCollection.test.Log(Status.Pass, "Roster : " + list[4] + " is deleted and validated on Roster Admin screen");
                //}
                //catch
                //{
                //    PropertiesCollection.test.Log(Status.Fail, "Roster Status is not matching");
                //    throw;
                //}
            }
Example #24
0
            public void TS05_PlanningBoard_TC05_CreateTask_PushToPane()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS05_PlanningBoard_TC05_CreateTask_PushToPane");

                String strTestCaseNo = "TC001";
                String strtblname = "automation_planningboard";
                String strTestType = "Smoke";

                
                /* Get test data from MySQL */

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataDefinePlanningBoard = connection.Select(strtblname, strTestCaseNo, strTestType);

                string strTDOrganisationGroupName = testdataDefinePlanningBoard[5];
                string strTDTaskCode = testdataDefinePlanningBoard[6];
                string strTDAssetCode = testdataDefinePlanningBoard[7];
                string strTDShiftCode = testdataDefinePlanningBoard[8];
               
                

                FpPlanningBoardPage PlanningBoard = new FpPlanningBoardPage();
                PlanningBoard.CreateTask(strTDTaskCode, strTDAssetCode, strTDShiftCode);
                             

                try
                {
                    Assert.IsTrue(PlanningBoard.TaskPackageSelection.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Task Package Created Successfully");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Task Package not created");
                    throw;
                }

                PlanningBoard.PushTaskToPane(strTDTaskCode, strTDOrganisationGroupName);
                System.Threading.Thread.Sleep(60000);
              
                try
                {
                    Assert.IsTrue(PlanningBoard.PushtoPaneTitle.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Task Package pushed to Pane Successfully");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Task Package not pushed to Pane");
                    throw;
                }
                PlanningBoard.BtnOK.Click();
                System.Threading.Thread.Sleep(15000);
                PlanningBoard.BtnCancel.Click();
                System.Threading.Thread.Sleep(15000);
            }
Example #25
0
            public void TS03_TC04_Roster_RemoveRoster()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS03_TC04_Roster_RemoveRoster");
                String strtblname  = "automation_shiftadministration";
                String strtblname1 = "automation_rosteradministration";
                String OrgRoster   = "FighterSQN - Test Automation";
                Int64  RosterID    = 0;


                var connection              = new ConnectToMySQL_Fetch_TestData();
                var SidebarMenu             = new FpSideMenus();
                var PersonnelScheduleRoster = new clsPersonnelSchedulingRoster();

                var testdataShift = connection.Select(strtblname, strTestCaseNo, strTestType);

                String strTDShiftName  = testdataShift[4];
                String strTDShortCode  = testdataShift[5];
                String strTDStartTime  = testdataShift[6];
                String strTDDuration   = testdataShift[7];
                String strTDCurrencies = testdataShift[8];
                String strTDStatus     = testdataShift[9];

                var testdataRoster = connection.Select(strtblname1, strTestCaseNo, strTestType);

                string strTDRosterName = testdataRoster[4];

                System.Threading.Thread.Sleep(1000);
                SidebarMenu.LnkRoster.Click();

                System.Threading.Thread.Sleep(4000);

                string        strConnectionString = "Data Source=" + ConfigurationManager.AppSettings["SQLServerDataSource"] + ";Initial Catalog=" + ConfigurationManager.AppSettings["SQLServerInitialCatalog"] + ";User Id=" + ConfigurationManager.AppSettings["SQLServerUserId"] + ";Password="******"SQLServerPassword"];
                SqlConnection myConnection        = new SqlConnection(strConnectionString);

                myConnection.Open();
                SqlDataReader reader   = null;
                String        strQuery = "select RosterID from tblRoster where RosterName = '" + strTDRosterName + "';";
                SqlCommand    command  = new SqlCommand(strQuery, myConnection);

                reader = command.ExecuteReader();
                while (reader.Read())
                {
                    RosterID = Convert.ToInt64(reader.GetValue(0));
                    Console.WriteLine("RosterID" + RosterID);
                }
                reader.Close();

                string     strQuery1 = "delete from tblRosterPerson where RosterID = '" + RosterID + "';";
                SqlCommand command1  = new SqlCommand(strQuery1, myConnection);

                command1.ExecuteNonQuery();
                myConnection.Close();
                System.Threading.Thread.Sleep(4000);
            }
            public void TS02_TC02_StudentResults_ClearEvent()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS02_TC02_StudentResults_ClearEvent");

                var connection             = new ConnectToMySQL_Fetch_TestData();
                var testdataStudentResults = connection.Select(strtblname, strTestCaseNo, strTestType);
                var SidebarMenu            = new FpSideMenus();
                var StudentResults         = new FpStudentResultsPage();

                SidebarMenu.lnkStudentResults.Click();

                String strTDOrgnisationGroup       = testdataStudentResults[4];
                String strTDStudentName            = testdataStudentResults[5];
                String strTDInstructorName         = testdataStudentResults[6];
                String strTDCourseName             = testdataStudentResults[7];
                String strTDSyllabusName           = testdataStudentResults[8];
                String strTDEventName              = testdataStudentResults[9];
                String strTDScore                  = testdataStudentResults[10];
                String strTDScoreAssesmentCriteria = testdataStudentResults[11];
                String strTDStrength               = testdataStudentResults[12];
                String strTDWeakness               = testdataStudentResults[13];
                String strTDOverallComments        = testdataStudentResults[14];
                String strTDPrivateComments        = testdataStudentResults[15];
                String strTDServiceName            = testdataStudentResults[16];
                String strTDCountryName            = testdataStudentResults[17];
                String strTDStudentPosition        = testdataStudentResults[18];
                String strTDStudentSurname         = testdataStudentResults[19];

                StudentResults.SearchStudent(strTDStudentSurname);

                StudentResults.SearchCourseEvent((strTDEventName));

                StudentResults.VerifyEventIcon(strTDEventName);

                StudentResults.DeleteWriteup();

                System.Threading.Thread.Sleep(30000);

                String style2 = StudentResults.VerifyEventIcon(strTDEventName);

                try
                {
                    Assert.IsTrue(style2.Contains("background-color: rgb(70, 136, 71)"));
                    PropertiesCollection.test.Log(Status.Pass, "Event is back at scheduled state prior to Scoring");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Event is at not back at scheduled state");
                    throw;
                }

                StudentResults.VerifyEventIcon(strTDEventName);
            }
        public void TC06_RosterAdmin_DeleteRoster()
        {
            string[] list;
            var      connection = new ConnectToMySQL_Fetch_TestData();

            list = connection.Select(strtblname, strTestCaseNo, strTestType);
            var TopbarMenu           = new clsMainPage_TopbarMenu();
            var RosterAdministration = new clsRosterAdministration();

            TopbarMenu.NavigatetoRosterAdministration();
            RosterAdministration.DeleteRosterdetails(list[4]);
        }
            public void Launch_Knowledbase_Item_UserWithoutSO31_WithoutRestriction()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("Launch Knowledgebase Item assigned to user without SO 31 access and without restricted viewing");

                String strTestCaseNo = "TC003";
                String strtblname    = "automation_summary_knowledgebase";
                String strTestType   = "Progression";


                /* Get test data from MySQL */

                var connection = new ConnectToMySQL_Fetch_TestData();
                var testdataSummary_Knowledgebase = connection.Select(strtblname, strTestCaseNo, strTestType);

                string strTDLogin = testdataSummary_Knowledgebase[20];

                ConnectToMySQL_Fetch_TestData MySQLConnect = new ConnectToMySQL_Fetch_TestData();

                String[] TestData = new string[3];
                TestData = MySQLConnect.GetLoginDetails(strTDLogin);

                string strTDUsername = TestData[1];
                string strTDPassword = TestData[2];


                FpLoginPage loginPage = new FpLoginPage();

                loginPage.LoginWithUserCredentials(strTDUsername, strTDPassword);
                System.Threading.Thread.Sleep(15000);

                /* Launch Knowledge base item from Knowledge base Grid */
                FpSummaryPage Summary     = new FpSummaryPage();
                string        KBGridTitle = Summary.KnowledgebaseGridFirstItem.Text;

                Actions action = new Actions(PropertiesCollection.driver);

                action.MoveToElement(Summary.KnowledgebaseGridFirstItem).DoubleClick().Perform();
                System.Threading.Thread.Sleep(15000);

                FpKnowledgeBasePage Knowledgebase = new FpKnowledgeBasePage();

                System.Threading.Thread.Sleep(15000);
                try
                {
                    Assert.AreEqual(KBGridTitle, Knowledgebase.txtKBItemTitle.Text);
                    PropertiesCollection.test.Log(Status.Pass, "Launch Knowledgebase Item validated and passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Launch Knowledgebase Item validated and failed");
                }
            }
        public void TC02_UpdateStripDoc_UpdateContentAndNotes()
        {
            PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC02_UpdateStripDoc_UpdateContentAndNotes");

            //Fetching data from My SQL Database
            String strNotes   = "";
            var    connection = new ConnectToMySQL_Fetch_TestData();
            var    testData   = connection.Select(strTblName, "Update_TC002", strTestType);

            //Connecting to application database and retrieving the current count of documents attached to the strip
            string        strConnectionString = "Data Source=" + ConfigurationManager.AppSettings["SQLServerDataSource"] + ";Initial Catalog=" + ConfigurationManager.AppSettings["SQLServerInitialCatalog"] + ";Integrated Security=" + ConfigurationManager.AppSettings["SQLServerIntegratedSecurity"] + ';';
            SqlConnection myConnection        = new SqlConnection(strConnectionString);

            myConnection.Open();

            //Posting the Request
            IRestResponse response = CreateRestRequest("Update_TC002");
            var           doc      = new XmlDocument();

            doc.LoadXml(response.Content);

            //Retrieving & printing the Response code
            int intRespCode = Get_StatusCode(response);

            if (intRespCode == 200)
            {
                String        query   = "select * from dbo.tblstripreport where stripid = '" + testData[4] + "' and StripReportID = '" + testData[3] + "'";
                SqlCommand    command = new SqlCommand(query, myConnection);
                SqlDataReader reader  = command.ExecuteReader();

                while (reader.Read())
                {
                    strNotes = reader["StripReportNotes"].ToString();
                }
                try
                {
                    Assert.AreEqual(doc.GetElementsByTagName("Notes")[0].InnerText, strNotes);
                    PropertiesCollection.test.Log(Status.Pass, "Validation for notes has passed");
                    PropertiesCollection.test.Log(Status.Pass, "Document update has been successful.");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Validation for notes has not passed. Expected notes is: " + strNotes + "Actual notes from API Response is: " + doc.GetElementsByTagName("Notes")[0].InnerText);
                }
            }
            else
            {
                PropertiesCollection.test.Log(Status.Fail, "Update Strip document API not passed. Please check your input parameters");
                PropertiesCollection.test.Log(Status.Fail, "Error Code received is:  " + doc.GetElementsByTagName("Code")[0].InnerText);
                PropertiesCollection.test.Log(Status.Fail, "Error Response is:  " + doc.GetElementsByTagName("Message")[0].InnerText);
            }
        }
Example #30
0
            public string[] FetchTestData(string testCaseNo)
            {
                string[] testData = new string[11];

                strtblname  = "automation_organisationgroupsettings";
                strTestType = "Regression";

                var connection = new ConnectToMySQL_Fetch_TestData();

                testData = connection.Select(strtblname, testCaseNo, strTestType);

                return(testData);
            }