Beispiel #1
0
        public JobProfilePage ClickJobProfile(int profileNo)
        {
            List <IWebElement> listOfJPs = _pageHelper.FindElements(listOfProfiles);

            _objectContext.Set("JCProfileSelected", _pageHelper.GetText(listOfJPs[profileNo - 1]));
            _formHelper.ClickElement(listOfJPs[profileNo - 1]);
            return(new JobProfilePage(_context));
        }
Beispiel #2
0
        public JobProfilePage ClickRelatedCareer(int relatedCareer)
        {
            int careerIndex = relatedCareer - 1;

            AddElementTextToContext("RelatedCareerSelected", RelatedCareersList, careerIndex);
            _formHelper.ClickElement(_pageHelper.FindElements(RelatedCareersList)[careerIndex]);
            return(this);
        }
        public JobProfilePage ClickSearchResult(int resultToSelect)
        {
            var listOfResults = _pageHelper.FindElements(ProfileResults);

            if (listOfResults.Count >= resultToSelect)
            {
                _objectContext.Set("JPSearchResultSelected", _pageHelper.GetText(listOfResults[resultToSelect - 1]));
                _formHelper.ClickElement(listOfResults[resultToSelect - 1]);
            }
            else
            {
                throw new IndexOutOfRangeException("Number of results is lower than selected value");
            }

            return(new JobProfilePage(_context));
        }
Beispiel #4
0
        public DYSACAttributesQuestionsPage ClickAttributeQuestions()
        {
            var listOfProfiles = _pageHelper.FindElements(AttributeQuestionsButton);

            _formHelper.ClickElement(listOfProfiles[1]);
            return(new DYSACAttributesQuestionsPage(_context));
        }
Beispiel #5
0
        public CourseDetailsPage ClickSelectedCourse(int courseNo)
        {
            var listOfCourses = _pageHelper.FindElements(CourseSearchList);

            _objectContext.Set("CourseHeader", _pageHelper.GetText(listOfCourses[courseNo - 1]));
            _formHelper.ClickElement(listOfCourses[courseNo - 1]);
            return(new CourseDetailsPage(_context));
        }
Beispiel #6
0
        public Homepage ClickAutoSuggestResult(int resultToSelect)
        {
            List <IWebElement> list = _pageHelper.FindElements(AutoSuggestList);

            _objectContext.Replace("searchedTerm", _pageHelper.GetText(list[resultToSelect - 1]));
            _formHelper.ClickElement(list[resultToSelect - 1]);

            return(new Homepage(_context));
        }
        public ServiceStatusPage VerifyAllServicesAreRunning()
        {
            var    list      = pageHelper.FindElements(By.ClassName("list-service"));
            string innerHtml = list[0].GetAttribute("innerHTML");

            innerHtml.Should().NotContain("list-service_Red", "A service is unavailable");
            innerHtml.Should().NotContain("list-service_Amber", "A service is degraded");

            return(this);
        }
Beispiel #8
0
        public EnterJobsPage SelectJob(string job)
        {
            List <IWebElement> list = _pageHelper.FindElements(DropdownResults);

            for (var i = 0; i < list.Count; i++)
            {
                if (_pageHelper.GetText(list[i]).ToString() == job)
                {
                    _formHelper.ClickElement(list[i]);
                }
            }
            return(this);
        }
        public List <Results> GetResults()
        {
            var results             = new List <Results>();
            var allResultContainers = _pageHelper.FindElements(SingleResult);

            foreach (var resultContainer in allResultContainers)
            {
                var uiResult = new Results();
                uiResult.courseName = resultContainer.FindElement(By.CssSelector("h2.govuk-heading-m")).Text;
                var      startDateStr = resultContainer.FindElement(By.CssSelector("div.govuk-grid-column-one-half > ul.govuk-list > li")).Text.Replace("Start date:", string.Empty).Trim();
                DateTime startDate;

                if (DateTime.TryParse(startDateStr, out startDate))
                {
                    uiResult.startDate = startDate;
                }

                results.Add(uiResult);
            }

            return(results);
        }