示例#1
0
        public void CreateAndVerify_BudgetEstimate_ViewPage(string testId, string testSummary)
        {
            const string projectCodeValue = PlanningProjectManager.CONST_TEST_PROJECT_CODE;

            int currentProjectId = Convert.ToInt32(DB.GetLastCreatedIdForTable(HintFieldLookup.Project_By_ProjectCode(projectCodeValue)));

            Current_BudgetEstimateName = Helpers.GetUniqueData("AutomatedBudget");

            string currentAutomationId = Current_BudgetEstimateName;

            var hintObject_BudgetEstimate = HintFieldLookup.BudgetEstimate(currentAutomationId);

            MasterworksScreen
            .Begin(testId, testSummary, BrowserType.Chrome, true)
            .OpenProject_ById(currentProjectId)
            .OpenListPage_By_Path(TreePath_UnderProject.BudgetEstimate)
            .OpenCreateRecordForm()
            .SetTextbox(BgtEst.BudgetEstimateName, currentAutomationId)        //.Wait(5)
            .SetComobobox_ByText(BgtEst.BudgetEstimateType, "Construction")    //.Wait(5)//.Wait_Till_TextToBePresentInElement(By.Id("xyz"), "xyz")
            .SetComobobox_ByText(BgtEst.MeasurementSystem, "IS System")
            .SaveForm_Successfully()
            .ExecuteCustom_Using_LastId(CONST_TableNames.BudgetEstimate, hintObject_BudgetEstimate.IdField, (id, listPageRef) =>
            {
                var viewPage = listPageRef.ViewRow_WithId_ByNavigationUrl(id);

                viewPage.BeginVerification((driver, viewVerifier) =>
                {
                    viewVerifier
                    .AssertTextbox(BgtEst.BudgetEstimateName, currentAutomationId)
                    .AssertDate("Date000", 2002, 10, 20)
                    .AssertDateTime("Date012", new DateTime(2016, 1, 29, 0, 0, 0))

                    ;
                });
            })
            .VerifyInDB_Using_LastId("Verify BudgetEstimate in DB", hintObject_BudgetEstimate, (rowVerifier, listPageRef) =>
                                     //.VerifyInDB_Using_LastId("Verify BudgetEstimate in DB", CONST_BudgetEstimate.TableName, "ID", CONST_BudgetEstimate.Form.BudgetEstimateName, currentAutomationId, (rowVerifier, listPageRef) =>
            {
                rowVerifier
                .Assert_Data(CONST_BudgetEstimate.Form.BudgetEstimateName, currentAutomationId)
                .Assert_Data(CONST_BudgetEstimate.Form.BudgetEstimateType, 1)
                ;
            })
            //.DB_Run_SelectStatement("Select * from Table1", (dataSet, listPageRef)=>
            //{
            //    //dataSet.Tables[0].Rows
            //})
            .End_Automation()
            ;
        }
示例#2
0
        public void Add_NewProject(string testId, string testSummary)
        {
            string   currentAutomationId = Helpers.GetUniqueData("PlanProject_Auto");
            DateTime projectEndDate      = DateTime.Today.AddYears(1);

            string projectCode = Helpers.GetUniqueData(CONST_TEST_PROJECT_CODE);

            if (DB.Check_DataExist(HintFieldLookup.Project_By_ProjectCode(projectCode)))
            {
                return;
            }

            MasterworksScreen
            .Begin(testId, testSummary, BrowserType.Chrome, true)

            .CreateProjectFromPlanning()
            .Set(t => t.ProjectName, currentAutomationId)
            .Set(t => t.ProjectCode, projectCode)
            .Set(t => t.ProjectOwner, "User-Automator")
            .Set(t => t.ProjectStatus, "Advertisement")
            .Set(t => t.ProjectCategory, "Central")
            .Set(t => t.BusinessUnit_Text, "HeadOffice")
            .Set(t => t.ProgramYear, "2017")
            //.Set(t => t.Calendar, "Calendar By Vinay")
            .Set(t => t.EndDate, projectEndDate)
            .SaveForm_Successfully()

            .View_FirstRow_CustomViewer <ProjectViewPage>()
            .BeginVerification("PRJ_VER_TC_0001", (driver, viewVerifier) =>
            {
                viewVerifier
                .Assert(t => t.ProjectName, currentAutomationId)
                .Assert(t => t.ProjectCode, projectCode)
                .Assert(t => t.ProjectOwner, "User-Automator")
                .Assert(t => t.ProjectStatus, "Advertisement")
                .Assert(t => t.ProjectCategory, "Central")
                .Assert(t => t.BusinessUnit_Text, "HeadOffice")
                .Assert(t => t.ProgramYear, "2017")
                //.Set(t => t.Calendar, "Calendar By Vinay")
                .Assert(t => t.EndDate, projectEndDate)

                .Assert(t => t.ContractDays, 365)
                ;
            })

            //.End_Automation()
            ;
        }