Beispiel #1
0
        public void Employees_CountInDefaultDepartment()
        {
            //Arrange
            string expected = "All Departments";

            //Act
            //Browser.Refresh();
            //Browser.ClickOnLink("Calendar");
            //Thread.Sleep(Timings.Default_ms*20);
            string          defaultDept  = Browser.GetText("//*[@id='depDropList']/option[1]");
            int             employees    = Browser.Count("//*[contains(@id,'rowheader')]/span") - 1;
            List <Employee> empsFromRepo = EmployeesTest.EmpsInRepositoryCount().AsEnumerable().Where(e => e.DateDismissed == null && e.IsUserOnly == false).ToList();

            //Assert
            Assert.IsTrue(Browser.IsAt(baseURL + "Home/VUView"));
            Assert.AreEqual(expected, defaultDept);
            Assert.AreEqual(employees, empsFromRepo.Count());
        }
Beispiel #2
0
        public void ListEmployees_Count()
        {
            List <Employee> empsFromRepo = EmployeesTest.EmpsInRepositoryCount().Where(e => e.IsUserOnly == false).ToList();

            //Act
            Employee emp = empsFromRepo.FirstOrDefault();

            if (emp != null)
            {
                ReadOnlyCollection <IWebElement> empTable = Browser.FindElementsByXPath("//tr[contains(@class,'indexBT')]");
                foreach (var element in empTable)
                {
                    if (element.Text.Contains(emp.FirstName))
                    {
                        Assert.IsTrue(element.Text.Contains(emp.LastName));
                        Assert.IsTrue(element.Text.Contains(emp.EID));
                    }
                }
                Assert.AreEqual(empsFromRepo.Count, empTable.Count());
            }
        }
Beispiel #3
0
        public void ListEmployeesInTableDataCount()
        {
            Thread.Sleep(Timings.Default_ms * 20);
            List <Employee> empsFromRepo = EmployeesTest.EmpsInRepositoryCount().AsEnumerable().Where(e => e.IsUserOnly == false).ToList();

            Employee employee = empsFromRepo.FirstOrDefault();

            if (employee != null)
            {
                ReadOnlyCollection <IWebElement> empTable = Browser.FindElementsByXPath("//*[@id='tbodyJourneys']/tr");
                foreach (var element in empTable)
                {
                    if (element.Text.Contains(employee.LastName))
                    {
                        Assert.IsTrue(element.Text.Contains(employee.LastName));
                        Assert.IsTrue(element.Text.Contains(employee.FirstName));
                    }
                }
                Assert.AreEqual(empsFromRepo.Count, empTable.Count());
            }
        }
Beispiel #4
0
        public void ListEmployees_TableData()
        {
            Browser.Refresh();
            Thread.Sleep(Timings.Default_ms * 10);
            Browser.ClickOnLink("Calendar");
            Thread.Sleep(Timings.Default_ms * 20);
            List <Employee> empsFromRepo = EmployeesTest.EmpsInRepositoryCount().AsEnumerable().Where(e => e.DateDismissed == null && e.IsUserOnly == false).ToList();

            Employee employee = empsFromRepo.FirstOrDefault();

            if (employee != null)
            {
                ReadOnlyCollection <IWebElement> empTable = Browser.FindElementsByXPath("//*[contains(@id,'rowheader')]/span");
                foreach (var element in empTable)
                {
                    if (element.Text.Contains(employee.LastName))
                    {
                        Assert.IsTrue(element.Text.Contains(employee.LastName));
                        Assert.IsTrue(element.Text.Contains(employee.FirstName));
                    }
                }
                Assert.AreEqual(empsFromRepo.Count, empTable.Count() - 1);
            }
        }