Ejemplo n.º 1
0
        public void GetDummyElementsHeaderRowsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, true);

                int    expectedNumber = 0;
                int    actualNumber   = 0;
                string expected       = null;
                string actual         = null;

                expectedNumber = 1;
                actualNumber   = assessDashboardMyTestsGrid.GetDummyElementsHeaderRows().Count();
                Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard My Tests Grid Dummy Header Rows List does not have the correct number of Header Rows.");

                expected = "<th>Test Name</th><th># of Items</th><th>Test Stage</th><th>Modified Date</th>";
                actual   = assessDashboardMyTestsGrid.GetDummyElementsHeaderRows()[0].Text;
                Assert.AreEqual(expected, actual, "First Row in the Assess Dashboard My Tests Grid Dummy Header Rows List does not have the correct text.");
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }
Ejemplo n.º 2
0
        public override void InitElements()
        {
            MyTestsGridExpandIcon               = new WebElementWrapper(ByMyTestsGridExpandIcon);
            MyTestsGridCollapseIcon             = new WebElementWrapper(ByMyTestsGridCollapseIcon);
            UpcomingTestWindowsGridExpandIcon   = new WebElementWrapper(ByUpcomingTestWindowsGridExpandIcon);
            UpcomingTestWindowsGridCollapseIcon = new WebElementWrapper(ByUpcomingTestWindowsGridCollapseIcon);
            InProgressTestsGridExpandIcon       = new WebElementWrapper(ByInProgressTestsGridExpandIcon);
            InProgressTestsGridCollapseIcon     = new WebElementWrapper(ByInProgressTestsGridCollapseIcon);
            ScheduledTestsGridExpandIcon        = new WebElementWrapper(ByScheduledTestsGridExpandIcon);
            ScheduledTestsGridCollapseIcon      = new WebElementWrapper(ByScheduledTestsGridCollapseIcon);
            RecommendedTestsGridExpandIcon      = new WebElementWrapper(ByRecommendedTestsGridExpandIcon);
            RecommendedTestsGridCollapseIcon    = new WebElementWrapper(ByRecommendedTestsGridCollapseIcon);

            MyTestsViewAllLink             = new WebElementWrapper(ByMyTestsViewAllLink);
            UpcomingTestWindowsViewAllLink = new WebElementWrapper(ByUpcomingTestWindowsViewAllLink);
            InProgressTestsViewAllLink     = new WebElementWrapper(ByInProgressTestsViewAllLink);
            ScheduledTestsViewAllLink      = new WebElementWrapper(ByScheduledTestsViewAllLink);
            RecommendedTestsViewAllLink    = new WebElementWrapper(ByRecommendedTestsViewAllLink);

            MyTestsGrid             = new ProfileHomeMyTestsGrid(MyTestsGridSelector, false, ControlPrefix);
            UpcomingTestWindowsGrid = new ProfileHomeUpComingTestWindowsGrid(UpcomingTestWindowsGridSelector, false, ControlPrefix);
            InProgressTestsGrid     = new ProfileHomeInProgressTestsGrid(InProgressTestsGridSelector, false, ControlPrefix);
            ScheduledTestsGrid      = new ProfileHomeScheduledTestsGrid(ScheduledTestsGridSelector, false, ControlPrefix);
            RecommendedTestsGrid    = new ProfileHomeRecommendedTestsGrid(RecommendedTestsGridSelector, false, ControlPrefix);
        }
Ejemplo n.º 3
0
        public void GetsRowsContainingTextToFindFromListTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, true);

                int    expectedNumber = 0;
                int    actualNumber   = 0;
                string testName       = null;

                testName       = "Automated Test 1";
                expectedNumber = 1;
                actualNumber   =
                    assessDashboardMyTestsGrid.GetsRowsContainingTextToFindFromList(
                        assessDashboardMyTestsGrid.GetColumnFromList(0).Name, testName).Count();
                Assert.AreEqual(expectedNumber, actualNumber,
                                string.Format("Incorrect number of rows returned for the Test Name '{0}' from the Assess Dashboard My Tests Grid", testName));

                testName       = "Automated Test 2";
                expectedNumber = 1;
                actualNumber   =
                    assessDashboardMyTestsGrid.GetsRowsContainingTextToFindFromList(
                        assessDashboardMyTestsGrid.GetColumnFromList(0).Name, testName).Count();
                Assert.AreEqual(expectedNumber, actualNumber,
                                string.Format("Incorrect number of rows returned for the Test Name '{0}' from the Assess Dashboard My Tests Grid", testName));

                testName       = "Automated Test 3";
                expectedNumber = 1;
                actualNumber   =
                    assessDashboardMyTestsGrid.GetsRowsContainingTextToFindFromList(
                        assessDashboardMyTestsGrid.GetColumnFromList(0).Name, testName).Count();
                Assert.AreEqual(expectedNumber, actualNumber,
                                string.Format("Incorrect number of rows returned for the Test Name '{0}' from the Assess Dashboard My Tests Grid", testName));

                testName       = "Automated Test 4";
                expectedNumber = 1;
                actualNumber   =
                    assessDashboardMyTestsGrid.GetsRowsContainingTextToFindFromList(
                        assessDashboardMyTestsGrid.GetColumnFromList(0).Name, testName).Count();
                Assert.AreEqual(expectedNumber, actualNumber,
                                string.Format("Incorrect number of rows returned for the Test Name '{0}' from the Assess Dashboard My Tests Grid", testName));

                testName       = "Automated Test 5";
                expectedNumber = 1;
                actualNumber   =
                    assessDashboardMyTestsGrid.GetsRowsContainingTextToFindFromList(
                        assessDashboardMyTestsGrid.GetColumnFromList(0).Name, testName).Count();
                Assert.AreEqual(expectedNumber, actualNumber,
                                string.Format("Incorrect number of rows returned for the Test Name '{0}' from the Assess Dashboard My Tests Grid", testName));
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }
Ejemplo n.º 4
0
        public void SetRowListsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, false);

                int    expectedNumber = 0;
                int    actualNumber   = 0;
                string expected       = null;
                string actual         = null;

                assessDashboardMyTestsGrid.SetColumnLists();
                assessDashboardMyTestsGrid.SetRowLists();

                expectedNumber = 6;
                actualNumber   = assessDashboardMyTestsGrid.GetRowList().Count();
                Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard My Tests Grid does not have the correct number of Rows.");

                expected = "Automated Test 1";
                actual   = ((ProfileHomeMyTestsRow)assessDashboardMyTestsGrid.GetRowFromList(1)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the First Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 2";
                actual   = ((ProfileHomeMyTestsRow)assessDashboardMyTestsGrid.GetRowFromList(2)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Second Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 3";
                actual   = ((ProfileHomeMyTestsRow)assessDashboardMyTestsGrid.GetRowFromList(3)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Third Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 4";
                actual   = ((ProfileHomeMyTestsRow)assessDashboardMyTestsGrid.GetRowFromList(4)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Fourth Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 5";
                actual   = ((ProfileHomeMyTestsRow)assessDashboardMyTestsGrid.GetRowFromList(5)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Fifth Data Row of the Assess Dashboard My Tests Grid is incorrect");
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }
Ejemplo n.º 5
0
        public void GetDummyElementsPaginationRowsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, true);

                Assert.IsNull(assessDashboardMyTestsGrid.GetDummyElementsPaginationRows(), "Assess Dashboard My Tests Grid Dummy Pagination Rows Count is not zero.");
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }
Ejemplo n.º 6
0
        public void GetDummyElementsDataRowsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, true);

                int    expectedNumber = 0;
                int    actualNumber   = 0;
                string expected       = null;
                string actual         = null;

                expectedNumber = 5;
                actualNumber   = assessDashboardMyTestsGrid.GetDummyElementsDataRows().Count();
                Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard My Tests Grid Dummy Data Rows List does not have the correct number of Data Rows.");

                expected = "Automated Test 1";
                actual   = assessDashboardMyTestsGrid.GetDummyElementsDataRows()[0].Text;
                Assert.AreEqual(expected, actual, "First Column Data in the First Data Row of the Assess Dashboard My Tests Grid Dummy Data Rows List is incorrect");

                expected = "Automated Test 2";
                actual   = assessDashboardMyTestsGrid.GetDummyElementsDataRows()[1].Text;
                Assert.AreEqual(expected, actual, "First Column Data in the Second Data Row of the Assess Dashboard My Tests Grid Dummy Data Rows List is incorrect");

                expected = "Automated Test 3";
                actual   = assessDashboardMyTestsGrid.GetDummyElementsDataRows()[2].Text;
                Assert.AreEqual(expected, actual, "First Column Data in the Third Data Row of the Assess Dashboard My Tests Grid Dummy Data Rows List is incorrect");

                expected = "Automated Test 4";
                actual   = assessDashboardMyTestsGrid.GetDummyElementsDataRows()[3].Text;
                Assert.AreEqual(expected, actual, "First Column Data in the Fourth Data Row of the Assess Dashboard My Tests Grid Dummy Data Rows List is incorrect");

                expected = "Automated Test 5";
                actual   = assessDashboardMyTestsGrid.GetDummyElementsDataRows()[4].Text;
                Assert.AreEqual(expected, actual, "First Column Data in the Fifth Data Row of the Assess Dashboard My Tests Grid Dummy Data Rows List is incorrect");
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }
Ejemplo n.º 7
0
        public void SetColumnListsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, false);

                int    expectedNumber = 0;
                int    actualNumber   = 0;
                string expected       = null;
                string actual         = null;

                assessDashboardMyTestsGrid.SetColumnLists();

                expectedNumber = 4;
                actualNumber   = assessDashboardMyTestsGrid.GetColumnList().Count();
                Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard My Tests Grid does not have the correct number of columns.");

                expected = "Test Name";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(0).Name;
                Assert.AreEqual(expected, actual, "First Column Name in the Assess Dashboard My Tests Grid is not as expected.");

                expected = "# of Items";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(1).Name;
                Assert.AreEqual(expected, actual, "Second Column Name in the Assess Dashboard My Tests Grid is not as expected.");

                expected = "Test Stage";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(2).Name;
                Assert.AreEqual(expected, actual, "Third Column Name in the Assess Dashboard My Tests Grid is not as expected.");

                expected = "Modified Date";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(3).Name;
                Assert.AreEqual(expected, actual, "Fourth Column Name in the Assess Dashboard My Tests Grid is not as expected.");
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }
Ejemplo n.º 8
0
        public void GetDummyElementsColumnsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, true);

                int    expectedNumber = 0;
                int    actualNumber   = 0;
                string expected       = null;
                string actual         = null;

                expectedNumber = 4;
                actualNumber   = assessDashboardMyTestsGrid.GetDummyElementsColumns().Count();
                Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard My Tests Grid Dummy Column List does not have the correct number of columns.");

                expected = "Test Name";
                actual   = assessDashboardMyTestsGrid.GetDummyElementsColumns()[0].Text;
                Assert.AreEqual(expected, actual, "Incorrect Column Name for the first column in the Assess Dashboard My Tests Grid Dummy Column List.");

                expected = "# of Items";
                actual   = assessDashboardMyTestsGrid.GetDummyElementsColumns()[1].Text;
                Assert.AreEqual(expected, actual, "Incorrect Column Name for the second column in the Assess Dashboard My Tests Grid Dummy Column List.");

                expected = "Test Stage";
                actual   = assessDashboardMyTestsGrid.GetDummyElementsColumns()[2].Text;
                Assert.AreEqual(expected, actual, "Incorrect Column Name for the third column in the Assess Dashboard My Tests Grid Dummy Column List.");

                expected = "Modified Date";
                actual   = assessDashboardMyTestsGrid.GetDummyElementsColumns()[3].Text;
                Assert.AreEqual(expected, actual, "Incorrect Column Name for the fourth column in the Assess Dashboard My Tests Grid Dummy Column List.");
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }
Ejemplo n.º 9
0
        public void GetsFirstRowContainingTextToFindFromListTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, true);

                string expected = null;
                string actual   = null;

                expected = "Automated Test 1";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the First Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 2";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Second Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 3";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Third Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 4";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Fourth Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 5";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Fifth Data Row of the Assess Dashboard My Tests Grid is incorrect");
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }
Ejemplo n.º 10
0
        public void GetGridRowTypeTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, true);

                GridRowType expected;
                GridRowType actual;

                List <SNGridRow> assessDashboardMyTestsGridRowList = assessDashboardMyTestsGrid.GetRowList();

                foreach (SNGridRow assessDashboardMyTestsGridRow in assessDashboardMyTestsGridRowList)
                {
                    if (assessDashboardMyTestsGridRow.Index == 0)
                    {
                        expected = GridRowType.Header;
                        actual   = assessDashboardMyTestsGrid.GetGridRowType(assessDashboardMyTestsGridRow.Index);
                        Assert.AreEqual(expected, actual, "First Row of the Assess Dashboard My Tests Grid is not a Header Row");
                    }

                    else
                    {
                        expected = GridRowType.Data;
                        actual   = assessDashboardMyTestsGrid.GetGridRowType(assessDashboardMyTestsGridRow.Index);
                        Assert.AreEqual(expected, actual,
                                        string.Format("Row  with Index '{0}' of the Assess Dashboard My Tests Grid is not a Data Row", assessDashboardMyTestsGridRow.Index.ToString()));
                    }
                }
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }
Ejemplo n.º 11
0
        public void AssessDashboardMyTestsGridTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, true);

                int    expectedNumber = 0;
                int    actualNumber   = 0;
                string expected       = null;
                string actual         = null;

                expectedNumber = 4;
                actualNumber   = assessDashboardMyTestsGrid.GetColumnList().Count();
                Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard My Tests Grid does not have the correct number of columns.");

                expectedNumber = 6;
                actualNumber   = assessDashboardMyTestsGrid.GetRowList().Count();
                Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard My Tests Grid does not have the correct number of Rows.");

                expected = "Test Name";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(0).Name;
                Assert.AreEqual(expected, actual, "First Column Name in the Assess Dashboard My Tests Grid is not as expected.");

                expected = "# of Items";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(1).Name;
                Assert.AreEqual(expected, actual, "Second Column Name in the Assess Dashboard My Tests Grid is not as expected.");

                expected = "Test Stage";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(2).Name;
                Assert.AreEqual(expected, actual, "Third Column Name in the Assess Dashboard My Tests Grid is not as expected.");

                expected = "Modified Date";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(3).Name;
                Assert.AreEqual(expected, actual, "Fourth Column Name in the Assess Dashboard My Tests Grid is not as expected.");

                expected = "Automated Test 1";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the First Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 2";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Second Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 3";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Third Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 4";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Fourth Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 5";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Fifth Data Row of the Assess Dashboard My Tests Grid is incorrect");
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }