Пример #1
0
        public void VerifyFilter(Map map)
        {
            try
            {
                string[] filter = map.Get("JobFilter").Split('#');

                for (int i = 0; i < filter.Length; i++)
                {
                    string filterBy    = filter[i].Split('!')[0];
                    string filterValue = filter[i].Split('!')[1];

                    switch (filterBy.ToLower())
                    {
                    case "city":
                        this.jobsPageUtility.VerifyJobPostingCity(filterValue);
                        break;

                    case "team":
                        this.jobsPageUtility.VerifyJobPostingTeam(filterValue);
                        break;

                    case "worktype":
                        this.jobsPageUtility.VerifyJobPostingWorkType(filterValue);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                TRAssert.Fail("Error while verifying job filters", ex);
            }
        }
Пример #2
0
        public void VerifyJobSite()
        {
            try
            {
                TRAssert.AreEqual(3, this.jobsPage.FilterCount, "Jobs filter count is not as expected.");
                TRAssert.IsNotNull(this.jobsPage.GetFilterByName("city"), "City filter is not present.");
                TRAssert.IsNotNull(this.jobsPage.GetFilterByName("team"), "team filter is not present.");
                TRAssert.IsNotNull(this.jobsPage.GetFilterByName("work type"), "work type is not present.");

                List <JobPosting> displayedJobs = this.jobsPage.GetJobPostings();

                if (displayedJobs == null)
                {
                    TRAssert.IsNotNull(this.jobsPage.NoPostingsMessage, "No postings message is not displayed");
                }
                else
                {
                    TRAssert.Pass("Job postings are displayed");
                }
            }
            catch (Exception ex)
            {
                TRAssert.Fail("Error while verifying job site", ex);
            }
        }
Пример #3
0
 public void NavigateTo(string url)
 {
     try
     {
         this.homePage.NavigateTO(url);
     }
     catch (Exception ex)
     {
         TRAssert.Fail("Error while navigating to url", ex);
     }
 }
Пример #4
0
 public void RetrieveAvailablePositions(Map map)
 {
     try
     {
         map.Put("AvailablePositions", this.jobsPageUtility.GetAvailableJobs());
     }
     catch (Exception ex)
     {
         TRAssert.Fail("Error while retrieving available positions", ex);
     }
 }
Пример #5
0
 public void FilterJobs(string by, string value)
 {
     try
     {
         FilterBy filter = this.jobsPage.GetFilterByName(by);
         filter.SetValue(value);
     }
     catch (Exception ex)
     {
         TRAssert.Fail("Error while filtering jobs by : " + by, ex);
     }
 }
Пример #6
0
 public void ValidateCareersPage(Map map)
 {
     try
     {
         this.homePageUtility.NavigateAndSwitchToCareers();
         this.careersPageUtility.VerifyCareersPageSections();
     }
     catch (Exception ex)
     {
         TRAssert.Fail("Error while validating careers page", ex);
     }
 }
Пример #7
0
 public void OpenAndSwitchToCanadianOpportunities()
 {
     try
     {
         this.careersPage.CanadianOpportunitiesBtn.Click();
         this.careersPage.SwitchToLatestTab();
     }
     catch (Exception ex)
     {
         TRAssert.Fail("Error while opening or switching to Canadian opportunities", ex);
     }
 }
Пример #8
0
        public int GetAvailableJobs()
        {
            try
            {
                List <JobPosting> jobPostings = this.jobsPage.GetJobPostings();

                return(jobPostings == null ? 0 : jobPostings.Count);
            }
            catch (Exception ex)
            {
                TRAssert.Fail("Error while getting available job count. ", ex);
                return(0);
            }
        }
Пример #9
0
        public void VerifyJobPostingTeam(string team)
        {
            try
            {
                List <JobPosting> jobPostings = this.jobsPage.GetJobPostings();

                foreach (var job in jobPostings)
                {
                    TRAssert.IsTrue(job.Team.ToLower().Contains(team.ToLower()), "team name not as per filter for job : " + job.Title);
                }
            }
            catch (Exception ex)
            {
                TRAssert.Fail("Error while verifying job posting team. ", ex);
            }
        }
Пример #10
0
        public void VerifyJobPostingCity(string city)
        {
            try
            {
                List <JobPosting> jobPostings = this.jobsPage.GetJobPostings();

                foreach (var job in jobPostings)
                {
                    TRAssert.AreEqual(city.ToLower(), job.Location.ToLower(), "city name not as per filter for job : " + job.Title);
                }
            }
            catch (Exception ex)
            {
                TRAssert.Fail("Error while verifying job posting city. ", ex);
            }
        }
Пример #11
0
        public void VerifyJobPostingWorkType(string worktype)
        {
            try
            {
                List <JobPosting> jobPostings = this.jobsPage.GetJobPostings();

                foreach (var job in jobPostings)
                {
                    TRAssert.IsTrue(job.Commitment.ToLower().Contains(worktype.ToLower()), "worktype not as per filter for job : " + job.Title);
                }
            }
            catch (Exception ex)
            {
                TRAssert.Fail("Error while verifying job posting worktype. ", ex);
            }
        }
Пример #12
0
        public void LaunchApplication()
        {
            try
            {
                TRBrowser.Instance.Close(this.TestCaseName);
                TRBrowser browser = TRBrowser.Instance;

                string      url         = TRGlobals.SiteUrl;
                BrowserType browserType = (BrowserType)Enum.Parse(typeof(BrowserType), TRGlobals.Browser);
                browser.Launch(url, this.TestCaseName, browserType, 60, 60);
            }
            catch (Exception ex)
            {
                TRAssert.Fail("Unable to launch application.", ex);
            }
        }
Пример #13
0
        public void ValidateJobsite(Map map)
        {
            try
            {
                if (!map.ContainsKey("NavigateToCareersPage") || Convert.ToBoolean(map.Get("NavigateToCareersPage")))
                {
                    this.NavigateTo(Structures.TradeRevURL.careerspage);
                }

                this.careersPageUtility.OpenAndSwitchToCanadianOpportunities();
                this.jobsPageUtility.VerifyJobSite();
            }
            catch (Exception ex)
            {
                TRAssert.Fail("Error while validating job site", ex);
            }
        }
Пример #14
0
        public void FilterJobs(Map map)
        {
            try
            {
                string[] filter = map.Get("JobFilter").Split('#');

                for (int i = 0; i < filter.Length; i++)
                {
                    string filterBy    = filter[i].Split('!')[0];
                    string filterValue = filter[i].Split('!')[1];

                    this.jobsPageUtility.FilterJobs(filterBy, filterValue);
                }
            }
            catch (Exception ex)
            {
                TRAssert.Fail("Error while filtering jobs", ex);
            }
        }
Пример #15
0
        public void VerifyCareersPageSections()
        {
            try
            {
                TRAssert.AreEqual(8, this.careersPage.Sections.Count, "Number of sections are wrong");

                TRAssert.IsTrue(this.careersPage.CallOutSection.GetAttribute("class").Contains("callout"), "Callout section is not present at the top");
                TRAssert.IsNotNull(this.careersPage.VideoSection.FindElement(By.ClassName("video")), "Video section doesnot have a video");
                TRAssert.IsNotNull(this.careersPage.SliderSection.FindElement(By.ClassName("supsystic-slider")), "Slider not present in the slider section");

                TRAssert.IsNotNull(this.careersPage.Sections[1].FindElement(By.ClassName("section-title")), "2nd Section is a TextSection but doesnot have a title");
                TRAssert.IsNotNull(this.careersPage.Sections[3].FindElement(By.ClassName("section-title")), "4th Section is a TextSection but doesnot have a title");
                TRAssert.IsNotNull(this.careersPage.Sections[4].FindElement(By.ClassName("section-title")), "5th Section is a TextSection but doesnot have a title");
                TRAssert.IsNotNull(this.careersPage.Sections[6].FindElement(By.ClassName("section-title")), "7th Section is a TextSection but doesnot have a title");
                TRAssert.IsNotNull(this.careersPage.Sections[7].FindElement(By.ClassName("section-title")), "8th Section is a TextSection but doesnot have a title");
            }
            catch (Exception ex)
            {
                TRAssert.Fail("Error while Verifying Careers Page Sections.", ex);
            }
        }