/// <summary>
        /// Finish New Application Driver
        /// Use hard coded Autism Data
        /// </summary>
        public void FinishApplication(ScholarshipApplicationData appData)
        {
            //**********************************
            //Define New Application Data

            //**********************************

            //Add Primary Guardian
            TestRunnerInterface.Map.providerSearchPage.ParentGuardianTab();

            var guardian = appData.newGuardian;

            //TestRunnerInterface.Map.parentGuardianTab.AddNewGuardian("Matthew,Woods,05/23/1973,Father");
            TestRunnerInterface.Map.parentGuardianTab.AddNewGuardian(guardian);

            Libary.RefreshApplication(RunTimeVars.Refresh.PageRefresh);

            //Add Application Data

            //Add IEP Information

            //Add Uploaded Docs
            TestRunnerInterface.Map.providerSearchPage.DocsTab();
            this.TestAddDocs();
            //this.AddDocs();

            Libary.RefreshApplication(RunTimeVars.Refresh.PageRefresh);
        }
Esempio n. 2
0
        /// <summary>
        /// Based on the program type create Autism, JPSN
        ///  EdChoice, Cleveland Student Application
        /// </summary>
        /// <param name="appData">The application data.</param>
        public void NewStudentApplication(ScholarshipApplicationData appData)
        {
            var program = TestRunnerInterface.Map.testContext.program;

            bool error      = false;
            var  programKey = string.Empty;

            switch (program.ToUpper())
            {
            case "AUTISM":
            case "JPSN":
                this.NewAutismJPSNStudentApplication(appData);
                break;

            case "EDCHOICE":
            case "CLEVELAND":
                this.NewEdChoiceClevelandStudentApplication(appData);
                break;

            default:
                error = true;
                break;
            }

            if (error)
            {
                throw new Exception("Program Type = " + program + "Not Implemented");
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Start New Autism, JPSN Student Application Driver
        /// Use ScholarshipApplicationData data
        /// </summary>
        public void NewAutismJPSNStudentApplication(ScholarshipApplicationData appData)
        {
            //Wait for New Student Application screen
            this.WaitForNewStudentApplication(RunTimeVars.REPEAT_TIMES);

            //***************************************
            //Define New Application Data
            //Student Information
            string middleName = appData.middleName;
            string maidenName = appData.maidenName;
            string gender     = appData.gender;
            string ethnicity  = appData.ethnicity;
            string language   = appData.language;
            string SSN        = appData.SSN;
            string birthCity  = appData.birthCity;
            string birthState = appData.birthState;

            //Application Information
            //string appPeroid = "Autism FY 2016";
            string county    = appData.county;
            string residence = appData.residence;


            //string residenceBeginDate = "01/01/2015";
            string initialProvider = appData.initialProvider;

            //Student has a current ETR
            bool   studentETR               = appData.studentETR;
            string studentETRCounty         = appData.studentETRCounty;
            string studentETRSchoolDistrict = appData.studentETRSchoolDistrict;

            //Where will the student be educated?
            //string studentEducated = "Home School";
            //string studentEducated = "Public School";
            //string studentEducated = "Chartered Non Pub";
            //string studentEducated = "Non-Chartered Nonpub";
            string studentEducated = appData.studentEducated;

            string publicSchoolCounty   = appData.publicSchoolCounty;
            string publicSchoolDistrict = appData.publicSchoolDistrict;
            string ChartedNPCounty      = appData.ChartedNPCounty;
            string ChartedNPSchoolName  = appData.ChartedNPSchoolName;
            string NonChartedNPCounty   = appData.ChartedNPCounty;
            string OtherSchoolName      = appData.OtherSchoolName;


            string previousGradeLevel = appData.previousGradeLevel;
            string currentGradeLevel  = appData.currentGradeLevel;

            //*******************************************


            //***********************
            //Student Information
            //***********************
            //Middle Name
            this.SetTextBox("txtStdntMiddleName", middleName);

            //Mothers Maiden Name
            this.SetTextBox("txtStdntMothersLastName", maidenName);

            //Gender
            this.SetListBox("ddlGender", gender);

            //Ethinicity(race)
            this.SetListBox("ddlRace", ethnicity);

            //Native language
            this.SetListBox("ddlNativeLanguage", language);

            //Don't use full SSN now, in case SSID is intentional to be blank
            //SSN
            //this.SetTextBox("txtStdntSSN4", SSN);
            //var ss = appData.SSN;
            //var partialSSN = ss.Substring(5, 4);      //just need the last4-digits
            this.SetTextBox("txtStdntSSN4", SSN);

            //Birth Place city
            this.SetTextBox("txtStdntBirthCity", birthCity);

            //Birth Place State
            this.SetListBox("ddlState", birthState);

            //Don't update SSID in case SSID is intentional to be blank
            //SSID
            //var ssid = appData.SSID;
            //this.SetTextBox("txtStdntSSID", ssid);

            //**************************
            //Application Information
            //**************************
            //Application Period
            //Accept default value

            //County
            this.SetListBox("ddCounty", county);

            //Legal District of Residence
            this.SetListBox("ddlegaldist", residence);

            /**********************************************
             * //Residency Begin Date
             * this.SetTextBox("residencyBeginDate", residenceBeginDate);
             *
             * IWebDriver browser = TestRunnerInterface.Map.safePage.browser;
             * IWebElement element = browser.FindElement(By.Id("residencyBeginDate"));
             * this.SetTextBox("residencyBeginDate", residenceBeginDate);
             * element.SendKeys(Keys.Enter);
             ******************************************************/
            //Date - 10/24/2015 Workaround
            //the Date Picker control is Read Only
            //Use JavascriptExecutor to remove the Read Only Attribute
            //Then update the Date
            //
            //IWebDriver browser = TestRunnerInterface.Map.safePage.browser;
            //((IJavaScriptExecutor)browser).ExecuteScript("document.getElementById('residencyBeginDate').removeAttribute('readonly',0);");
            //IWebElement element = browser.FindElement(By.Id("residencyBeginDate"));
            //element.Clear();
            //string DOB = Libary.CalculateDOBByYear(currentAge);
            //element.SendKeys(DOB + Keys.Enter);

            //Initial Provider
            this.SetListBox("ddlPrimaryProvider", initialProvider);

            //Student has a current ETR?
            //Set the radio button to defined state
            IWebElement element = null;

            if (studentETR)
            {
                element = this.StudentETR_RadioButton(true);
                element.Click();

                //Student ETR County
                this.SetListBox("ddEtrCounty", studentETRCounty);

                //Student ETR School District
                this.SetListBox("ddlEtrdist", studentETRSchoolDistrict);
            }
            else
            {
                element = this.StudentETR_RadioButton(false);
                element.Click();
            }

            //Where will the student be educated
            this.SetListBox("ddlSchoolLocType", studentEducated);

            //if (studentEducated.Equals("Home School"))
            //This is already set above, so do nothing

            if (studentEducated.Equals("Public School"))
            {
                this.SetListBox("ddPublicSchlSearchCounty", publicSchoolCounty);
                this.SetListBox("ddPublicSchlSearchlegaldist", publicSchoolDistrict);
            }
            if (studentEducated.Equals("Chartered Non Pub"))
            {
                this.SetListBox("ddCharterNonPubSchlSearchCounty", ChartedNPCounty);
                this.SetListBox("ddCharterNonPubSchlSearchlegaldist", ChartedNPSchoolName);
            }
            if (studentEducated.Equals("Non-Chartered Nonpub"))
            {
                this.SetTextBox("txtOtherSchlName", NonChartedNPCounty);
            }
            if (studentEducated.Equals("Other School"))
            {
                this.SetTextBox("txtOtherSchlName", OtherSchoolName);
            }


            //Previous School Year Grade Level
            this.SetListBox("ddlPrevGrade", previousGradeLevel);

            //Current School Year Grade Level
            this.SetListBox("ddlcurgrade", currentGradeLevel);


            //Locate the page buttons
            IWebElement newStudent = this.CreateNewStudentAppButton();

            newStudent.Click();
        }
Esempio n. 4
0
        /// <summary>
        /// Start New EdChoice, ClevelandStudent Application Driver
        /// Use ScholarshipApplicationData data
        /// </summary>
        public void NewEdChoiceClevelandStudentApplication(ScholarshipApplicationData appData)
        {
            //Wait for New Student Application screen
            this.WaitForNewStudentApplication(RunTimeVars.REPEAT_TIMES);

            //***************************************
            //Define New Application Data
            //Student Information
            string middleName = appData.middleName;
            string maidenName = appData.maidenName;
            string gender     = appData.gender;
            string ethnicity  = appData.ethnicity;
            string language   = appData.language;
            string SSN        = appData.SSN;
            string birthCity  = appData.birthCity;
            string birthState = appData.birthState;

            //Application Information
            //string appPeroid = "Autism FY 2016";
            string county    = appData.county;
            string residence = appData.residence;


            //string residenceBeginDate = "01/01/2015";
            string initialProvider = appData.initialProvider;
            string assignedBulding = appData.assignedBulding;

            //Student has a current ETR
            bool   studentETR               = appData.studentETR;
            string studentETRCounty         = appData.studentETRCounty;
            string studentETRSchoolDistrict = appData.studentETRSchoolDistrict;

            //Where will the student be educated?
            //string studentEducated = "Home School";
            //string studentEducated = "Public School";
            //string studentEducated = "Chartered Non Pub";
            //string studentEducated = "Non-Chartered Nonpub";
            string studentEducated = appData.studentEducated;

            string publicSchoolCounty   = appData.publicSchoolCounty;
            string publicSchoolDistrict = appData.publicSchoolDistrict;
            string ChartedNPCounty      = appData.ChartedNPCounty;
            string ChartedNPSchoolName  = appData.ChartedNPSchoolName;
            string NonChartedNPCounty   = appData.ChartedNPCounty;
            string OtherSchoolName      = appData.OtherSchoolName;

            bool   isKindergartener   = appData.isKindergartener;
            string previousGradeLevel = appData.previousGradeLevel;
            string currentGradeLevel  = appData.currentGradeLevel;

            string currentlyAttendingSchool = appData.currentlyAttendingSchool;


            //***********************
            //Student Information
            //***********************
            //Middle Name
            this.SetTextBox("txtStdntMiddleName", middleName);

            //Mothers Maiden Name
            this.SetTextBox("txtStdntMothersLastName", maidenName);

            //Gender
            this.SetListBox("ddlGender", gender);

            //Ethinicity(race)
            this.SetListBox("ddlRace", ethnicity);

            //Native language
            this.SetListBox("ddlNativeLanguage", language);

            //Don't use full SSN now, in case SSID is intentional to be blank
            //SSN
            //this.SetTextBox("txtStdntSSN4", SSN);
            //var ss = appData.SSN;
            //var partialSSN = ss.Substring(5, 4);      //just need the last4-digits
            this.SetTextBox("txtStdntSSN4", SSN);


            //Birth Place city
            this.SetTextBox("txtStdntBirthCity", birthCity);

            //Birth Place State
            this.SetListBox("ddlState", birthState);

            //Don't update SSID in case SSID is intentional to be blank
            //SSID
            //var ssid = appData.SSID;
            //this.SetTextBox("txtStdntSSID", ssid);

            //**************************
            //Application Information
            //**************************
            //Application Period
            //Accept default value

            //County
            this.SetListBox("ddCounty", county);

            //Legal District of Residence
            this.SetListBox("ddlegaldist", residence);

            //Assigned Building
            this.SetListBox("ddlDesBldng", assignedBulding);


            /**********************************************
             * //Residency Begin Date
             * this.SetTextBox("residencyBeginDate", residenceBeginDate);
             *
             * IWebDriver browser = TestRunnerInterface.Map.safePage.browser;
             * IWebElement element = browser.FindElement(By.Id("residencyBeginDate"));
             * this.SetTextBox("residencyBeginDate", residenceBeginDate);
             * element.SendKeys(Keys.Enter);
             ******************************************************/
            //Date - 10/24/2015 Workaround
            //the Date Picker control is Read Only
            //Use JavascriptExecutor to remove the Read Only Attribute
            //Then update the Date
            //
            //IWebDriver browser = TestRunnerInterface.Map.safePage.browser;
            //((IJavaScriptExecutor)browser).ExecuteScript("document.getElementById('residencyBeginDate').removeAttribute('readonly',0);");
            //IWebElement element = browser.FindElement(By.Id("residencyBeginDate"));
            //element.Clear();
            //string DOB = Libary.CalculateDOBByYear(currentAge);
            //element.SendKeys(DOB + Keys.Enter);

            //Initial Provider
            this.SetListBox("ddlPrimaryProvider", initialProvider);

            IWebDriver browser = TestRunnerInterface.Map.safePage.browser;

            if (isKindergartener)
            {
                var         xpath   = "//input[@type='radio'] [@value = 'Yes']";
                IWebElement element = Libary.GetPageElement(browser, RunTimeVars.ELEMENTSEARCH.XPATH, xpath, RunTimeVars.REPEAT_TIMES);
                element.Click();
            }
            else
            {
                //Student is an incoming kindergartener? = No
                //Select Program Criteria first, because this updates modifies
                //Previous School Year Grade Level

                //Select Program Criteria = Student is currently attending a designated public school in their resident district
                //var selection = "//input[@id='radProgCriteria]" + "[@value = '1302']";
                IWebElement element = Libary.GetPageElement(browser, RunTimeVars.ELEMENTSEARCH.XPATH, "//*[@id='radProgCriteria']", RunTimeVars.REPEAT_TIMES);
                element.Click();
                element.SendKeys(Keys.ArrowDown);

                //THis is set automatically
                //string xpath = "//*[@id='dialog-StudentApp']/fieldset/table/tbody/tr/td[1]/table/tbody/tr[7]/td[2]/input[2]";
                //var xpath = "//input[@type='radio'] [@value = 'No']";
                //element = Libary.GetPageElement(browser, RunTimeVars.ELEMENTSEARCH.XPATH, xpath, RunTimeVars.REPEAT_TIMES);
                //element.Click();

                //Student has a current ETR?
                //Set the radio button to defined state
                //IWebElement element = null;


                //Previous School Year Grade Level
                this.SetListBox("ddlPrevGrade", previousGradeLevel);

                //Current School Year Grade Level
                this.SetListBox("ddlcurgrade", currentGradeLevel);
            }

            //Currently Attending School automaticly pre-populated
            //this.SetListBox("txtCurrentAttendingSchool", currentlyAttendingSchool);

            //Locate the page buttons
            IWebElement newStudent = this.CreateNewStudentAppButton();

            newStudent.Click();
        }
        /// <summary>
        /// Start New Application Driver
        /// Use ScholarshipApplicationData data
        /// </summary>
        public void StartApplication(ScholarshipApplicationData appData)
        {
            //**********************************
            //Define New Application Data
            string firstName  = appData.firstName;
            string lastName   = appData.lastName;
            int    currentAge = appData.currentAge;
            //**********************************


            //Update the student new SS# and SSID#
            //Update New Student Name
            //Get the Last New Student# from filename - RunTimeData.xml
            //Increment to Next Student#
            //Save the Next Student# back to the xml file
            //Append the Next Student# to the Student Name
            //

            //Get the last SS# and SSID# from filename - RunTimeData.xml
            //Get the Last New Student# from filename - RunTimeData.xml
            //Get program type from Test Context
            //Update the Global ScholarshipApplicationData appData)
            string program = TestRunnerInterface.Map.testContext.program;


            /**********************************************************
             * // Don't insert SSN# and SSID# here yet
             * // Wait until the call to finish the application
             * // in case the SSN# and SSID# are intended to be blank
             *
             * var ssn = this.CalculateNextSSNNumber(program);
             * appData.SSN = ssn;
             *
             * Create an SSID# by replacing first 2-chars of SS#
             * appData.SSID = this.CalculateSSID(ssn);
             *********************************************************/

            int nextStudentNumber = this.CalculateNextStudentNumber(program);

            //Append the Next Student# to the Student Name
            firstName += "-" + nextStudentNumber.ToString();
            lastName  += "-" + nextStudentNumber.ToString();

            //Click menu
            TestRunnerInterface.Map.menu.NewScholarshipApplication();

            //Set Application Peroid = 2nd Option
            //FY 2017
            //FY 2016
            TestRunnerInterface.Map.studentSearchPage.SetListBox("ddlApplicationPeriod", 1);

            //Search for Student and create new application
            IWebDriver browser = TestRunnerInterface.Map.safePage.browser;

            //Auto calculate DOB based on Age
            //Enter DOB
            //DOB must be => 3-years old and <= 22-years old
            //string DOB = Libary.CalculateDOBByYear(currentAge);

            //Hard Code the DOB
            //string DOB = "01/01/2000";

            //Use DOB from the Application Data
            string DOB = appData.DOB;

            IWebElement element = Libary.GetPageElement(browser, RunTimeVars.ELEMENTSEARCH.ID, "txtDateofBirth", RunTimeVars.REPEAT_TIMES);

            element.SendKeys(DOB + Keys.Return);

            //Enter Firstname
            element = Libary.GetPageElement(browser, RunTimeVars.ELEMENTSEARCH.ID, "txtFirstName", RunTimeVars.REPEAT_TIMES);
            element.SendKeys(firstName);

            //Enter Lastname
            element = Libary.GetPageElement(browser, RunTimeVars.ELEMENTSEARCH.ID, "txtLastName", RunTimeVars.REPEAT_TIMES);
            element.SendKeys(lastName);

            //Locate Search button
            //<input type="submit" value="Search" name="Search">
            //*[@id="myTable1"]/tbody/tr/td/table/tbody/tr[7]/td/input[1]
            //
            //<input type="reset" value="Reset" onclick="ClearSearch()">
            //*[@id="myTable1"]/tbody/tr/td/table/tbody/tr[7]/td/input[2]

            IWebElement myTable1 = browser.FindElement(By.Id("myTable1"));
            //IWebElement search = myTable1.FindElement(By.XPath("//tbody/tr/td/table/tbody/tr[7]/td/input[1]"));
            IWebElement search = myTable1.FindElement(By.XPath("//input[@type='submit' and @value='Search']"));
            //IWebElement reset = myTable1.FindElement(By.XPath("//tbody/tr/td/table/tbody/tr[7]/td/input[2]"));
            IWebElement reset = myTable1.FindElement(By.XPath("//input[@type='reset' and @value='Reset']"));

            //*************************************************************
            // Isuse - Unless the New Student Application is Maximized
            // the left most controls are hidden and can't be accessed
            //
            //Maximize the browser to set New Student Application
            //to the middle he screen
            // Then restore the browser back to orginal size
            //*************************************************************

            //Maxamize the browser
            System.Drawing.Size browserSize = Libary.BrowserMaximize(browser);

            search.Click();

            //Wait for Search Results
            TestRunnerInterface.Map.student.WaitForNewStudentSearch(RunTimeVars.REPEAT_TIMES);

            //Click Here to create new application
            IWebElement dialog = Libary.GetPageElement(browser, RunTimeVars.ELEMENTSEARCH.ID, "dialog-SearchResults", RunTimeVars.REPEAT_TIMES);
            IWebElement here   = dialog.FindElement(By.LinkText("HERE"));

            here.Click();

            //Create new Student Application
            TestRunnerInterface.Map.student.NewStudentApplication(appData);

            //Wait for Student Tab to be displayed
            TestRunnerInterface.Map.studentTab.WaitForStudentTabDisplay(RunTimeVars.REPEAT_TIMES);

            //Reset browser back to orginal size
            Libary.SetBrowserSize(browser, browserSize);
        }