Exemplo n.º 1
0
        public void GivenIUpdateMyBasicAccountInformationUsingTheFollowing(Table accountInformation)
        {
            // Navigate to the account information page
            Driver.FindElements(By.CssSelector("a[href=\"/pathways/parachute\"]"))[1].Click();
            Driver.WaitUntilPageIsReady();

            // Convert the gherkin account information table into a DT
            var accountInformationDT = TableHandling.ConvertGherkinTableToDataTable(accountInformation);

            // Retrieve all the data from the account information DT into variables in a list format
            var zipcode   = TableHandling.getDataTableColumnValues(accountInformationDT, "Zipcode");
            var race      = TableHandling.getDataTableColumnValues(accountInformationDT, "Race");
            var gender    = TableHandling.getDataTableColumnValues(accountInformationDT, "Gender");
            var education = TableHandling.getDataTableColumnValues(accountInformationDT, "Education");

            // Enter the zipcode information
            Driver.FindElement(By.CssSelector("input[id=\"pathways_parachutes_seeker_info_zipcode\"]")).SendKeys(zipcode[0]);

            // Enter the race information
            var raceSelector = Driver.FindElement(By.CssSelector("select[id=\"pathways_parachutes_seeker_info_race\"]"));

            raceSelector.Click();
            raceSelector.FindElement(By.CssSelector($"option[value=\"{race[0]}\"]")).Click();
            raceSelector.Click();

            // Enter the gender information
            var genderSelector = Driver.FindElement(By.CssSelector("select[id=\"pathways_parachutes_seeker_info_gender\"]"));

            genderSelector.Click();
            genderSelector.FindElement(By.CssSelector($"option[value=\"{gender[0]}\"]")).Click();
            genderSelector.Click();

            // Enter the education information
            var educationSelector = Driver.FindElement(By.CssSelector("select[id=\"pathways_parachutes_seeker_info_education\"]"));

            educationSelector.Click();
            educationSelector.FindElement(By.CssSelector($"option[value=\"{education[0]}\"]")).Click();
            educationSelector.Click();

            // Continue
            Driver.FindElement(By.CssSelector("input[value=\"Continue\"]")).Click();
            Driver.WaitUntilPageIsReady();
        }
Exemplo n.º 2
0
        public void GivenIUpdateMyStartPointToWithTheFollowingInformation(string startPoint, Table startPointInformation)
        {
            var startPointInformatonDT = TableHandling.ConvertGherkinTableToDataTable(startPointInformation);

            // Select start point
            switch (startPoint)
            {
            case "foundations":
            {
                // Select the foundations level
                Driver.FindElement(By.CssSelector("button[value=\"foundations\"]")).Click();
                Driver.WaitUntilPageIsReady();

                var diploma         = TableHandling.getDataTableColumnValues(startPointInformatonDT, "High School Diploma");
                var math            = TableHandling.getDataTableColumnValues(startPointInformatonDT, "Basic Math Skills");
                var computerSkills  = TableHandling.getDataTableColumnValues(startPointInformatonDT, "Basic Computer Skills");
                var laptopOwnership = TableHandling.getDataTableColumnValues(startPointInformatonDT, "Laptop Ownership");

                // Select the basic foundations options
                var checkBoxes              = Driver.FindElements(By.CssSelector("input[id=\"completed_milestone_ids_\"]"));
                var diplomaCheckBox         = checkBoxes[0];
                var mathCheckBox            = checkBoxes[1];
                var computerSkillsCheckBox  = checkBoxes[2];
                var laptopOwnershipCheckBox = checkBoxes[3];

                if (diploma[0] == "Yes")
                {
                    diplomaCheckBox.Click();
                }
                if (math[0] == "Yes")
                {
                    mathCheckBox.Click();
                }
                if (computerSkills[0] == "Yes")
                {
                    computerSkillsCheckBox.Click();
                }
                if (laptopOwnership[0] == "Yes")
                {
                    laptopOwnershipCheckBox.Click();
                }

                break;
            }

            case "experience":
            {
                // etc.
                break;
            }

            case "apply":
            {
                // etc.
                break;
            }

            case "default":
            {
                // etc.
                break;
            }
            }

            Driver.FindElement(By.CssSelector("input[value=\"Continue\"]")).Click();
            Driver.WaitUntilPageIsReady();
            Assert.AreEqual("https://www.launchcode.org/pathways/seekers/dashboard", Driver.Url);
        }