public void PageBar_ParsingCorrectly_Test_2() { using (var driver = new ChromeDriver()) { /* Initialization */ var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60)); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://tms.lionbridge.com/"); string projectTitle = "Qlik"; ProjectsPage testPage = new ProjectsPage(driver, projectTitle); testPage.ClickChosenProject(); ParticularProjectPage testProjectPage = new ParticularProjectPage(driver); testProjectPage.ProfileClick(driver); testProjectPage.ChangeItemsPerPageMin(driver); testProjectPage.StatusClick(driver); StatusPage testStatusPage = new StatusPage(driver); testStatusPage.ActivitiesFilterClick(driver); testStatusPage.ChosenActivityClick(driver, "Buffer_for_FreewayReview_H"); PageBar testPageBar = new PageBar(driver); /* Set of assertions */ Assert.IsFalse(testPageBar.PageBarContainerIsNull); Assert.AreEqual(1, testPageBar.PageBarContainerIsDisplayed); Assert.AreEqual(0, testPageBar.NumberOfAllItemsIsNull); Assert.AreEqual(1, testPageBar.NumberOfAllItemsIsDisplayed); Assert.IsTrue(testPageBar.IsParsingCorrect); Assert.IsTrue(testPageBar.GetNumberOfAllItems > 0); Assert.AreEqual(1, testPageBar.PageNavigationContainerIsNull); Assert.AreEqual(-1, testPageBar.CurrentPageIsFirst); Assert.AreEqual(-1, testPageBar.GetCurrentPageNumber); Assert.AreEqual(-1, testPageBar.CurrentPageIsLast); Assert.AreEqual(-1, testPageBar.GetLastPageNumber); Assert.AreEqual(-1, testPageBar.NextPageIsNull); Assert.AreEqual(-1, testPageBar.PreviousPageIsNull); } }
public void PageBar_ItemsPerPageSetChosenValue_Test_7() { using (var driver = new ChromeDriver()) { /* Initialization */ var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60)); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://tms.lionbridge.com/"); string projectTitle = "Qlik"; ProjectsPage testPage = new ProjectsPage(driver, projectTitle); testPage.ClickChosenProject(); ParticularProjectPage testProjectPage = new ParticularProjectPage(driver); testProjectPage.StatusClick(driver); StatusPage testStatusPage = new StatusPage(driver); testStatusPage.ActivitiesFilterClick(driver); testStatusPage.ChosenActivityClick(driver, "Buffer_for_FreewayReview_H"); PageBar testPageBar = new PageBar(driver); /* Set of assertions */ Assert.IsTrue(testPageBar.IsParsingCorrect); Assert.AreEqual(-1, testPageBar.ItemsPerPageOptionsContainerIsDisplayed); Assert.AreEqual("-1", testPageBar.ItemsPerPageCurrentSelection); testPageBar.ItemsPerPageSetChosenValue(driver, "25"); testPageBar = new PageBar(driver); Assert.AreEqual(-1, testPageBar.ItemsPerPageOptionsContainerIsDisplayed); Assert.AreEqual("-1", testPageBar.ItemsPerPageCurrentSelection); } }
public void StatusPage_ChosenActivityClick_Test_2() { using (var driver = new ChromeDriver()) { /* Initialization */ var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60)); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://tms.lionbridge.com/"); string projectTitle = "Corteva"; ProjectsPage testPage = new ProjectsPage(driver, projectTitle); testPage.ClickChosenProject(); ParticularProjectPage testProjectPage = new ParticularProjectPage(driver); testProjectPage.StatusClick(driver); StatusPage testStatusPage = new StatusPage(driver); testStatusPage.ChosenActivityClick(driver, "DTP_Post_Final_H"); testStatusPage.ActivitiesFilterClick(driver); /* Set of assertions */ Assert.IsTrue(testStatusPage.IsParsingCorrect); Assert.AreEqual("status", testStatusPage.GetPageName); Assert.AreEqual(1, testStatusPage.IsActivitiesSelected); Assert.AreEqual(0, testStatusPage.IsAssigneesSelected); Assert.AreEqual("DTP_Post_Final_H", testStatusPage.ActivitiesFilterSelection); Assert.AreEqual("Target Language", testStatusPage.LanguagesFilterSelection); Assert.AreEqual(1, testStatusPage.ActivitiesFilterIsExpanded); Assert.AreEqual(0, testStatusPage.LanguagesFilterIsExpanded); } }
public void AssigneesElement_ParsingCorrectly_Test_1() { using (var driver = new ChromeDriver()) { /* Initialization */ var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60)); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://tms.lionbridge.com/"); string projectName = ""; // Project Name ProjectsPage testPage = new ProjectsPage(driver, projectName); testPage.ClickChosenProject(); ParticularProjectPage testProjectPage = new ParticularProjectPage(driver); testProjectPage.ProfileClick(driver); testProjectPage.ChangeItemsPerPageMin(driver); testProjectPage.StatusClick(driver); StatusPage testStatusPage = new StatusPage(driver); testStatusPage.AssigneesClick(driver); AssigneesPage porscheAssigneesPage = new AssigneesPage(driver); porscheAssigneesPage.ActivitiesFilterClick(driver); porscheAssigneesPage.ChosenActivityClick(driver, "InternalReview"); PageBar pageBar = new PageBar(driver); pageBar.ItemsPerPageSetMaximalValue(driver); Thread.Sleep(5000); IReadOnlyCollection <IWebElement> r_LHObjects = driver.FindElements(By.ClassName("r_LH")); IReadOnlyCollection <IWebElement> r_LObjects = driver.FindElements(By.ClassName("r_L")); //AssigneeAndHisJob firstAssingee = new AssigneeAndHisJob(r_LHObjects.ElementAt(0), r_LObjects.ElementAt(0)); //Assert.AreNotEqual("", firstAssingee.assigneeName); //Assert.AreNotEqual("", firstAssingee.sourceLanguage); //AssigneesAndTheirJobs aTJ = new AssigneesAndTheirJobs(r_LHObjects, r_LObjects); //Assert.AreEqual(4, aTJ.assigneesAngTheirJobsList.Count); //Assert.AreEqual(0, aTJ.count); //IOrderedEnumerable<AssigneeAndHisJob> aTJOrdered = aTJ.assigneesAngTheirJobsList.OrderBy(x => x.targetLanguage); /*IEnumerable<AssigneeAndHisJob> auxiliaryEnumerable; * List<string> differentLanguages = new List<string>(); * * string auxiliaryString; * int auxiliaryInt = 0; * * while (auxiliaryInt < aTJ.count) * { * auxiliaryString = aTJOrdered.ElementAt(auxiliaryInt).targetLanguage; * if (auxiliaryString != "" && auxiliaryString != null) * { * differentLanguages.Add(auxiliaryString); * } * * auxiliaryEnumerable = aTJ.assigneesAngTheirJobsList.Where(x => x.targetLanguage == auxiliaryString); * auxiliaryInt += auxiliaryEnumerable.Count(); * } * * //Assert.AreEqual(0, differentLanguages.Count); * * Actions a = new Actions(driver); * * a.Click(aTJ.assigneesAngTheirJobsList.ElementAt(0).webElement) * .KeyDown(Keys.Shift) * .MoveToElement(r_LObjects.ElementAt(2)) * .Click(aTJ.assigneesAngTheirJobsList.ElementAt(aTJ.count - 1).webElement) * .Build() * .Perform(); * * AssingeesOnClickJobsMenu menu = new AssingeesOnClickJobsMenu(driver); * menu.ClickTagJobsButton(driver); * * AssigneesPage afterTagging = new AssigneesPage(driver); * afterTagging.ActivitiesClick(driver);*/ StatusPage statusPageAfterTagging = new StatusPage(driver); statusPageAfterTagging.ClickAll(driver); Thread.Sleep(10000); StatusPage statusPageAll = new StatusPage(driver); Thread.Sleep(1000); statusPageAll.ActivitiesFilterClick(driver); Thread.Sleep(1000); statusPageAll.ChosenActivityClick(driver, "Translation"); Thread.Sleep(10000); StatusPage translationPage = new StatusPage(driver); translationPage.TargetLanguageFilterClick(driver); Thread.Sleep(1000); //translationPage.ChosenGetTargetLanguageClick(driver, differentLanguages.ElementAt(1)); Thread.Sleep(5000); pageBar = new PageBar(driver); pageBar.ItemsPerPageSetMaximalValue(driver); Thread.Sleep(5000); IReadOnlyCollection <IWebElement> r_LHTranslationJobs = driver.FindElements(By.ClassName("r_LH")); List <string> translationJobNames = new List <string>(); IWebElement auxiliaryElement; foreach (IWebElement el in r_LHTranslationJobs) { auxiliaryElement = el.FindElement(By.ClassName("grp_ttl")); translationJobNames.Add(auxiliaryElement.Text); } //Assert.AreEqual("", differentLanguages.ElementAt(0)); Assert.AreEqual("", translationJobNames.ElementAt(0)); /* Set of assertions */ /*AssigneeElement el = new AssigneeElement(assignees[0], assigneesJobs); * Assert.AreEqual("bg-bg", el.AssigneeLanguage); * Assert.AreEqual(el.GetAssigneeJobsNumberString, el.AssigneeJobsList.Count);*/ Assert.AreEqual(0, r_LHObjects.Count); Assert.AreEqual(0, r_LObjects.Count); } }