Exemple #1
0
 public void TestMethod1()
 {
     driver.Url = "https://www.google.com/";
     driver.FindElement(By.Name("q")).SendKeys("Selenium");
     Console.WriteLine("Console.");
     TestContext.WriteLine("Context");
 }
        public void GetTestDataFromResxResourceTest()
        {
            this.SchoolNet().LoadWebPage();
            try
            {
                QuestionAnswerData questionAnswerData = new QuestionAnswerData();
                questionAnswerData.GetTestDataFromResxResource("UITests.Data.Assess.ItemCreateEdit.MultipleChoiceItemResource",
                                                               "default_" + this.SchoolNet().TestConfiguration.ApplicationName, 0);

                Assert.AreEqual(ItemType.MultipleChoice, questionAnswerData.ItemType, "The item type is incorrect.");
                Assert.AreEqual(MultipleChoiceLayout.OneColumn, questionAnswerData.AnswerChoiceLayoutOption, "The answer choice layout is incorrect.");
                Assert.IsTrue(questionAnswerData.PointValuePair.ContainsKey("blue"), "The point value key is incorrect.");
                Assert.IsTrue(questionAnswerData.PointValuePair.ContainsValue("5"), "The point value is incorrect.");

                List <string> list = new List <string>();
                list.Add("blue");
                int i = 0;
                foreach (var item in questionAnswerData.CorrectAnswerList)
                {
                    Assert.AreEqual(item, list[i], "The correct answer list is incorrect.");
                    i++;
                }

                list.Add("purple");
                list.Add("yellow");
                list.Add("orange");
                i = 0;
                foreach (var item in questionAnswerData.AnswerList)
                {
                    Assert.AreEqual(item, list[i], "The answer list is incorrect.");
                    i++;
                }

                list.Remove("blue");
                list.Remove("purple");
                list.Remove("yellow");
                list.Remove("orange");
                list.Add("teacher's explanation");
                i = 0;
                foreach (var item in questionAnswerData.TeacherExplanationList)
                {
                    Assert.AreEqual(item, list[i], "The teacher explanation list is incorrect.");
                    i++;
                }

                list.Remove("teacher's explanation");
                list.Add("student's explanation");
                i = 0;
                foreach (var item in questionAnswerData.StudentExplanationList)
                {
                    Assert.AreEqual(item, list[i], "The teacher explanation list is incorrect.");
                    i++;
                }
            }
            catch (Exception e)
            {
                TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
                throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
            }
        }
        public void Create_Passage_With_Publisher()
        {
            try
            {
                this.SchoolNet().LoadWebPage();

                Workflows workflows = new Workflows();
                workflows.SignInAsDistrictAdmin();

                TestContext.WriteLine("\n--- Create a passage ---");
                workflows.AssessWorkflows.PassageWorkflows
                .NavigateToCreatePassagePage();

                //set up data for EditPassage.aspx
                EditPassageData editPassageData = workflows.AssessWorkflows.EditPassagePage.InitData();
                editPassageData.GetTestDataFromResxResource(
                    "UITests.Data.Assess.Passage.PassageResource",
                    "default_" + this.SchoolNet().TestConfiguration.ApplicationName, 0);
                editPassageData.Title     = "OriginalAutomationPassage";
                editPassageData.Publisher = "OriginalAutomationPassage_Publisher";
                workflows.AssessWorkflows.EditPassagePage.Data = editPassageData;

                workflows.AssessWorkflows.PassageWorkflows
                .CreatePassagePageInputFormFields();

                workflows.SignOut();
            }
            catch (Exception e)
            {
                TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace);
                new DriverCommands().GetScreenshotAndPageSource();
                throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
            }
        }
        public void GetDummyElementsHeaderRowsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_InProgressTestResults_ctl00_gridResults";
                ProfileHomeInProgressTestsGrid ProfileHomeInProgressTestsGrid = new ProfileHomeInProgressTestsGrid(gridCssSelector, true);

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

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

                expected = "<th>Test Name</th><th>End Date</th><th>Scores Due Date</th><th>Collection Status</th>";
                actual   = ProfileHomeInProgressTestsGrid.GetDummyElementsHeaderRows()[0].Text;
                Assert.AreEqual(expected, actual, "First Row in the Assess Dashboard In-Progress Tests Grid Dummy Header Rows List does not have the correct text.");
            }

            catch (Exception e)
            {
                TestContext.WriteLine("" + e.GetBaseException());
                throw new Exception("\nMessage:\n" + e.Message
                                    + "\nInnerException:\n" + e.InnerException
                                    + "\nStackTrace:\n" + e.StackTrace + "\n", e);
            }
        }
Exemple #5
0
            public void performActionsByWorksheet()
            {
                string excelFilePath = TestContext.Parameters["excelFilePath"];
                string worksheetName = TestContext.Parameters["worksheetName"];

                TestContext.WriteLine(excelFilePath);
                TestContext.WriteLine(worksheetName);
            }
        public void Leadership_Create_A_Multiple_Choice_Item_With_One_Column_Layout()
        {
            try
            {
                this.SchoolNet().LoadWebPage();
                Workflows workflows = new Workflows();
                workflows.SignInAsLeadership();

                TestContext.WriteLine("\n--- Create a multiple choice item ---");
                workflows.AssessWorkflows.CreateItemWorkflows
                .NavigateToEditTestItemChooseNewItemPage()
                .EditTestItemCreateNewItemSelectMultipleChoice();

                //set up data for EditTestItem.aspx
                EditPageData editPageData = workflows.AssessWorkflows.EditTestItemCreateNewItemPage.InitData();
                editPageData.GetTestDataFromResxResource(
                    "UITests.Data.Assess.ItemCreateEdit.ItemPropertiesResource",
                    "UITests.Data.Assess.ItemCreateEdit.MultipleChoiceItemResource",
                    "default_" + this.SchoolNet().TestConfiguration.ApplicationName, 0);
                editPageData.ItemTypeData.Name      = "OriginalAutomationMCItemWithOneColumnLayoutName";
                editPageData.ItemTypeData.Keyword   = "OriginalAutomationMultipleChoiceItemKeyword";
                editPageData.ItemTypeData.Publisher = "SNAutomationTeam";
                editPageData.QuestionAnswerData.AnswerChoiceLayoutOption = MultipleChoiceLayout.OneColumn;
                editPageData.StandardPickerData = new StandardPickerDataStructures().GetDefaultStandardPickerData();
                workflows.AssessWorkflows.EditTestItemCreateNewItemPage.Data = editPageData;

                /* Open response only
                 *
                 * workflows.AssessWorkflows.CreateItemWorkflows
                 *  .EditTestItemCreateNewItemPageInputFormFields()
                 *  ;
                 *
                 * //16.3, EnableSpecialCharacterPalette is no longer check as default. Need to check on this as tc 80866
                 * //will fail if this doesn't
                 * if (workflows.AssessWorkflows.EditTestItemCreateNewItemPage.Form.ItemTypeForm.GetType() == typeof(ItemTypeOpenResponseForm))
                 * {
                 *  ((ItemTypeOpenResponseForm)workflows.AssessWorkflows.EditTestItemCreateNewItemPage.Form.ItemTypeForm).CheckEnableSpecialCharacterPalette();
                 * }
                 */

                workflows.AssessWorkflows.CreateItemWorkflows
                .EditTestItemCreateNewItemPageInputAndSubmitForm()
                .EditItemAvailabilityShareWithEveryone()
                .EditItemAvailabilityPageSubmitForm();

                workflows.SignOut();
            }
            catch (Exception e)
            {
                TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace);
                new DriverCommands().GetScreenshotAndPageSource();
                throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
            }
        }
Exemple #7
0
 private void CreateReportDirectory()
 {
     lock (locker)
     {
         DeleteOldReports();
         Directory.CreateDirectory(Config.settings.reportSettings.reportPath);
         var path = $"{Config.settings.reportSettings.reportPath}\\{Common.GetCurrentTestName()}.html";
         TestContext.WriteLine(path);
         Debug.WriteLine(path);
     }
 }
Exemple #8
0
 public void SignInAsStateSuperAdminTest()
 {
     try
     {
         this.SchoolNet().LoadWebPage();
         Workflows workflows = new Workflows();
         workflows.SignInOutWorkflows.SignInAsStateSuperAdmin();
     }
     catch (Exception e)
     {
         TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
         throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
     }
 }
        public void SetRowListsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_InProgressTestResults_ctl00_gridResults";
                ProfileHomeInProgressTestsGrid ProfileHomeInProgressTestsGrid = new ProfileHomeInProgressTestsGrid(gridCssSelector, false);

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

                ProfileHomeInProgressTestsGrid.SetColumnLists();
                ProfileHomeInProgressTestsGrid.SetRowLists();

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

                expected = "Automated Test 1";
                actual   = ((ProfileHomeInProgressTestsRow)ProfileHomeInProgressTestsGrid.GetRowFromList(1)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the First Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect");

                expected = "Automated Test 2";
                actual   = ((ProfileHomeInProgressTestsRow)ProfileHomeInProgressTestsGrid.GetRowFromList(2)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Second Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect");

                expected = "Automated Test 3";
                actual   = ((ProfileHomeInProgressTestsRow)ProfileHomeInProgressTestsGrid.GetRowFromList(3)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Third Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect");

                expected = "Automated Test 4";
                actual   = ((ProfileHomeInProgressTestsRow)ProfileHomeInProgressTestsGrid.GetRowFromList(4)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Fourth Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect");

                expected = "Automated Test 5";
                actual   = ((ProfileHomeInProgressTestsRow)ProfileHomeInProgressTestsGrid.GetRowFromList(5)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Fifth Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect");
            }

            catch (Exception e)
            {
                TestContext.WriteLine("" + e.GetBaseException());
                throw new Exception("\nMessage:\n" + e.Message
                                    + "\nInnerException:\n" + e.InnerException
                                    + "\nStackTrace:\n" + e.StackTrace + "\n", e);
            }
        }
 public void testInputAndSubmitFormAndVerifyErrors()
 {
     try
     {
         AuthenticationTest test = new AuthenticationTest();
         test.testInputAndSubmitFormAndVerifyErrors(this.SchoolNet());
     }
     catch (Exception e)
     {
         TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
         new DriverCommands().GetScreenshotAndPageSource();
         throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
     }
 }
Exemple #11
0
        public async Task ManualQuery()
        {
            var token = new CancellationTokenSource();
            var query = new BoolQuery();
            var count = 0;

            token.Token.Register(() => TestContext.WriteLine($"Query handled {count} per 10 sec"));
            token.CancelAfter(TimeSpan.FromSeconds(10));

            while (!token.IsCancellationRequested)
            {
                await _queryBus.QueryAsync(query);

                count++;
            }
        }
 public void Leadership_Create_2_Multiple_Choice_Items_With_Two_Columns_Down_Then_Across_Layout()
 {
     try
     {
         for (int i = 0; i < 2; i++)
         {
             Leadership_Create_A_Multiple_Choice_Item_With_Two_Columns_Down_Then_Across_Layout();
         }
     }
     catch (Exception e)
     {
         TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace);
         new DriverCommands().GetScreenshotAndPageSource();
         throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
     }
 }
 public void Leadership_Create_2_Matching_Items()
 {
     try
     {
         for (int i = 0; i < 2; i++)
         {
             Leadership_Create_A_Matching_Item();
         }
     }
     catch (Exception e)
     {
         TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace);
         new DriverCommands().GetScreenshotAndPageSource();
         throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
     }
 }
 public void Leadership_Create_5_True_False_Items_With_Correct_Answer_Set_To_True()
 {
     try
     {
         for (int i = 0; i < 5; i++)
         {
             Leadership_Create_A_True_False_Item_With_Correct_Answer_Set_To_True();
         }
     }
     catch (Exception e)
     {
         TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace);
         new DriverCommands().GetScreenshotAndPageSource();
         throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
     }
 }
        public void Leadership_Create_A_Matching_Item()
        {
            try
            {
                this.SchoolNet().LoadWebPage();
                Workflows workflows = new Workflows();
                workflows.SignInAsLeadership();

                TestContext.WriteLine("\n--- Create a matching item ---");
                workflows.AssessWorkflows.CreateItemWorkflows
                .NavigateToEditTestItemChooseNewItemPage()
                .EditTestItemCreateNewItemSelectMatching();

                //set up data for EditTestItem.aspx
                EditPageData editPageData = workflows.AssessWorkflows.EditTestItemCreateNewItemPage.InitData();
                editPageData.GetTestDataFromResxResource(
                    "UITests.Data.Assess.ItemCreateEdit.ItemPropertiesResource",
                    "UITests.Data.Assess.ItemCreateEdit.MatchingItemResource",
                    "default_" + this.SchoolNet().TestConfiguration.ApplicationName, 0);
                editPageData.ItemTypeData.Name      = "OriginalAutomationMatchingItemName";
                editPageData.ItemTypeData.Keyword   = "OriginalAutomationMatchingItemKeyword";
                editPageData.ItemTypeData.Publisher = "SNAutomationTeam";
                editPageData.QuestionAnswerData.QuestionAnswerPair.Add("carrot", "orange");
                editPageData.QuestionAnswerData.QuestionAnswerPair.Add("eggplant", "purple");
                editPageData.QuestionAnswerData.CorrectAnswerPair.Add("carrot", "orange");
                editPageData.QuestionAnswerData.CorrectAnswerPair.Add("eggplant", "purple");
                editPageData.QuestionAnswerData.StudentAnswerPair.Add("carrot", "orange");
                editPageData.QuestionAnswerData.StudentAnswerPair.Add("eggplant", "purple");
                editPageData.QuestionAnswerData.PointValuePair.Add("carrot", "5");
                editPageData.QuestionAnswerData.PointValuePair.Add("eggplant", "5");
                editPageData.StandardPickerData = new StandardPickerDataStructures().GetDefaultStandardPickerData();
                workflows.AssessWorkflows.EditTestItemCreateNewItemPage.Data = editPageData;

                workflows.AssessWorkflows.CreateItemWorkflows
                .EditTestItemCreateNewItemPageInputAndSubmitForm()
                .EditItemAvailabilityShareWithEveryone()
                .EditItemAvailabilityPageSubmitForm();

                workflows.SignOut();
            }
            catch (Exception e)
            {
                TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace);
                new DriverCommands().GetScreenshotAndPageSource();
                throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
            }
        }
        public void GetDummyElementsDataRowsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_InProgressTestResults_ctl00_gridResults";
                ProfileHomeInProgressTestsGrid ProfileHomeInProgressTestsGrid = new ProfileHomeInProgressTestsGrid(gridCssSelector, true);

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

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

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

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

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

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

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

            catch (Exception e)
            {
                TestContext.WriteLine("" + e.GetBaseException());
                throw new Exception("\nMessage:\n" + e.Message
                                    + "\nInnerException:\n" + e.InnerException
                                    + "\nStackTrace:\n" + e.StackTrace + "\n", e);
            }
        }
        public void SetColumnListsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_InProgressTestResults_ctl00_gridResults";
                ProfileHomeInProgressTestsGrid ProfileHomeInProgressTestsGrid = new ProfileHomeInProgressTestsGrid(gridCssSelector, false);

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

                ProfileHomeInProgressTestsGrid.SetColumnLists();

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

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

                expected = "End Date";
                actual   = ProfileHomeInProgressTestsGrid.GetColumnFromList(1).Name;
                Assert.AreEqual(expected, actual, "Second Column Name in the Assess Dashboard In-Progress Tests Grid is not as expected.");

                expected = "Scores Due Date";
                actual   = ProfileHomeInProgressTestsGrid.GetColumnFromList(2).Name;
                Assert.AreEqual(expected, actual, "Third Column Name in the Assess Dashboard In-Progress Tests Grid is not as expected.");

                expected = "Collection Status";
                actual   = ProfileHomeInProgressTestsGrid.GetColumnFromList(3).Name;
                Assert.AreEqual(expected, actual, "Fourth Column Name in the Assess Dashboard In-Progress Tests Grid is not as expected.");
            }

            catch (Exception e)
            {
                TestContext.WriteLine("" + e.GetBaseException());
                throw new Exception("\nMessage:\n" + e.Message
                                    + "\nInnerException:\n" + e.InnerException
                                    + "\nStackTrace:\n" + e.StackTrace + "\n", e);
            }
        }
        public void GetDummyElementsColumnsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_InProgressTestResults_ctl00_gridResults";
                ProfileHomeInProgressTestsGrid ProfileHomeInProgressTestsGrid = new ProfileHomeInProgressTestsGrid(gridCssSelector, true);

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

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

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

                expected = "End Date";
                actual   = ProfileHomeInProgressTestsGrid.GetDummyElementsColumns()[1].Text;
                Assert.AreEqual(expected, actual, "Incorrect Column Name for the second column in the Assess Dashboard In-Progress Tests Grid Dummy Column List.");

                expected = "Scores Due Date";
                actual   = ProfileHomeInProgressTestsGrid.GetDummyElementsColumns()[2].Text;
                Assert.AreEqual(expected, actual, "Incorrect Column Name for the third column in the Assess Dashboard In-Progress Tests Grid Dummy Column List.");

                expected = "Collection Status";
                actual   = ProfileHomeInProgressTestsGrid.GetDummyElementsColumns()[3].Text;
                Assert.AreEqual(expected, actual, "Incorrect Column Name for the fourth column in the Assess Dashboard In-Progress Tests Grid Dummy Column List.");
            }

            catch (Exception e)
            {
                TestContext.WriteLine("" + e.GetBaseException());
                throw new Exception("\nMessage:\n" + e.Message
                                    + "\nInnerException:\n" + e.InnerException
                                    + "\nStackTrace:\n" + e.StackTrace + "\n", e);
            }
        }
        public void GetDummyElementsPaginationRowsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_InProgressTestResults_ctl00_gridResults";
                ProfileHomeInProgressTestsGrid ProfileHomeInProgressTestsGrid = new ProfileHomeInProgressTestsGrid(gridCssSelector, true);

                Assert.IsNull(ProfileHomeInProgressTestsGrid.GetDummyElementsPaginationRows(), "Assess Dashboard In-Progress Tests Grid Dummy Pagination Rows Count is not zero.");
            }

            catch (Exception e)
            {
                TestContext.WriteLine("" + e.GetBaseException());
                throw new Exception("\nMessage:\n" + e.Message
                                    + "\nInnerException:\n" + e.InnerException
                                    + "\nStackTrace:\n" + e.StackTrace + "\n", e);
            }
        }
        public void GetGridRowTypeTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_InProgressTestResults_ctl00_gridResults";
                ProfileHomeInProgressTestsGrid ProfileHomeInProgressTestsGrid = new ProfileHomeInProgressTestsGrid(gridCssSelector, true);

                GridRowType expected;
                GridRowType actual;

                List <SNGridRow> ProfileHomeInProgressTestsGridRowList = ProfileHomeInProgressTestsGrid.GetRowList();

                foreach (SNGridRow ProfileHomeInProgressTestsGridRow in ProfileHomeInProgressTestsGridRowList)
                {
                    if (ProfileHomeInProgressTestsGridRow.Index == 0)
                    {
                        expected = GridRowType.Header;
                        actual   = ProfileHomeInProgressTestsGrid.GetGridRowType(ProfileHomeInProgressTestsGridRow.Index);
                        Assert.AreEqual(expected, actual, "First Row of the Assess Dashboard In-Progress Tests Grid is not a Header Row");
                    }

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

            catch (Exception e)
            {
                TestContext.WriteLine("" + e.GetBaseException());
                throw new Exception("\nMessage:\n" + e.Message
                                    + "\nInnerException:\n" + e.InnerException
                                    + "\nStackTrace:\n" + e.StackTrace + "\n", e);
            }
        }
        public void DistrictAdmin_Create_MultipleChoice_With_Publisher()
        {
            try
            {
                this.SchoolNet().LoadWebPage();
                Workflows workflows = new Workflows();
                workflows.SignInAsDistrictAdmin();

                TestContext.WriteLine("\n--- Create a multiple choice item ---");
                workflows.AssessWorkflows.CreateItemWorkflows
                .NavigateToEditTestItemChooseNewItemPage()
                .EditTestItemCreateNewItemSelectMultipleChoice()
                ;

                //set up data for EditTestItem.aspx
                EditPageData editPageData = workflows.AssessWorkflows.EditTestItemCreateNewItemPage.InitData();
                editPageData.GetTestDataFromResxResource(
                    "UITests.Data.Assess.ItemCreateEdit.ItemPropertiesResource",
                    "UITests.Data.Assess.ItemCreateEdit.MultipleChoiceItemResource",
                    "default_" + this.SchoolNet().TestConfiguration.ApplicationName, 0);
                editPageData.ItemTypeData.Name      = "OriginalAutomationItemMC";
                editPageData.ItemTypeData.Keyword   = "OriginalAutomationItemMC_Keyword";
                editPageData.ItemTypeData.Publisher = "OriginalAutomationItemMC_Publisher";
                editPageData.StandardPickerData     = new StandardPickerDataStructures().GetDefaultStandardPickerData();
                workflows.AssessWorkflows.EditTestItemCreateNewItemPage.Data = editPageData;

                workflows.AssessWorkflows.CreateItemWorkflows
                .EditTestItemCreateNewItemPageInputAndSubmitForm()
                .EditItemAvailabilityShareWithEveryone()
                .EditItemAvailabilityPageSubmitForm()
                ;

                workflows.SignOut();
            }
            catch (Exception e)
            {
                TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace);
                new DriverCommands().GetScreenshotAndPageSource();
                throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
            }
        }
        public void GetsFirstRowContainingTextToFindFromListTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_InProgressTestResults_ctl00_gridResults";
                ProfileHomeInProgressTestsGrid ProfileHomeInProgressTestsGrid = new ProfileHomeInProgressTestsGrid(gridCssSelector, true);

                string expected = null;
                string actual   = null;

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

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

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

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

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

            catch (Exception e)
            {
                TestContext.WriteLine("" + e.GetBaseException());
                throw new Exception("\nMessage:\n" + e.Message
                                    + "\nInnerException:\n" + e.InnerException
                                    + "\nStackTrace:\n" + e.StackTrace + "\n", e);
            }
        }
        public void Leadership_Create_A_Multiple_Choice_Item_With_Two_Columns_Down_Then_Across_Layout()
        {
            try
            {
                this.SchoolNet().LoadWebPage();
                Workflows workflows = new Workflows();
                workflows.SignInAsLeadership();

                TestContext.WriteLine("\n--- Create a multiple choice item ---");
                workflows.AssessWorkflows.CreateItemWorkflows
                .NavigateToEditTestItemChooseNewItemPage()
                .EditTestItemCreateNewItemSelectMultipleChoice();

                //set up data for EditTestItem.aspx
                EditPageData editPageData = workflows.AssessWorkflows.EditTestItemCreateNewItemPage.InitData();
                editPageData.GetTestDataFromResxResource(
                    "UITests.Data.Assess.ItemCreateEdit.ItemPropertiesResource",
                    "UITests.Data.Assess.ItemCreateEdit.MultipleChoiceItemResource",
                    "default_" + this.SchoolNet().TestConfiguration.ApplicationName, 0);
                editPageData.ItemTypeData.Name      = "OriginalAutomationMCItemWithTwoColumnsDownThenAcrossLayoutName";
                editPageData.ItemTypeData.Keyword   = "OriginalAutomationMultipleChoiceItemKeyword";
                editPageData.ItemTypeData.Publisher = "SNAutomationTeam";
                editPageData.QuestionAnswerData.AnswerChoiceLayoutOption = MultipleChoiceLayout.TwoColumnsDownThenAcross;
                editPageData.StandardPickerData = new StandardPickerDataStructures().GetDefaultStandardPickerData();
                workflows.AssessWorkflows.EditTestItemCreateNewItemPage.Data = editPageData;

                workflows.AssessWorkflows.CreateItemWorkflows
                .EditTestItemCreateNewItemPageInputAndSubmitForm()
                .EditItemAvailabilityShareWithEveryone()
                .EditItemAvailabilityPageSubmitForm();

                workflows.SignOut();
            }
            catch (Exception e)
            {
                TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace);
                new DriverCommands().GetScreenshotAndPageSource();
                throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
            }
        }
Exemple #24
0
 public void testAuthenticationInputAndSubmitForm()
 {
     try
     {
         this.SchoolNet().LoadWebPage();
         AuthenticationPage authenticationPage = new AuthenticationPage();
         AuthenticationData authenticationData = authenticationPage.InitData();
         authenticationData.GetTestDataFromResxResource("UITests.Data.Login.AuthenticationResource",
                                                        "valid_" + this.SchoolNet().TestConfiguration.ApplicationName, 0);
         //authenticationData.DistrictName = "National";
         //authenticationData.Username = "******";
         //authenticationData.Password = "******";
         authenticationPage.Data = authenticationData;
         HomePage homePage = (HomePage)authenticationPage.Form.InputAndSubmitForm();
     }
     catch (Exception e)
     {
         TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace);
         new DriverCommands().GetScreenshotAndPageSource();
         throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
     }
 }
        public void Leadership_Create_A_True_False_Item_With_Correct_Answer_Set_To_True()
        {
            try
            {
                this.SchoolNet().LoadWebPage();
                Workflows workflows = new Workflows();
                workflows.SignInAsLeadership();

                TestContext.WriteLine("\n--- Create a true/false item ---");
                workflows.AssessWorkflows.CreateItemWorkflows
                .NavigateToEditTestItemChooseNewItemPage()
                .EditTestItemCreateNewItemSelectTrueFalse();

                //set up data for EditTestItem.aspx
                EditPageData editPageData = workflows.AssessWorkflows.EditTestItemCreateNewItemPage.InitData();
                editPageData.GetTestDataFromResxResource(
                    "UITests.Data.Assess.ItemCreateEdit.ItemPropertiesResource",
                    "UITests.Data.Assess.ItemCreateEdit.TrueFalseItemResource",
                    "default_" + this.SchoolNet().TestConfiguration.ApplicationName, 0);
                editPageData.ItemTypeData.Name      = "OriginalAutomationTFItemWithCorrectResponseTrueName";
                editPageData.ItemTypeData.Keyword   = "OriginalAutomationTrueFalseItemKeyword";
                editPageData.ItemTypeData.Publisher = "SNAutomationTeam";
                editPageData.StandardPickerData     = new StandardPickerDataStructures().GetDefaultStandardPickerData();
                workflows.AssessWorkflows.EditTestItemCreateNewItemPage.Data = editPageData;

                workflows.AssessWorkflows.CreateItemWorkflows
                .EditTestItemCreateNewItemPageInputAndSubmitForm()
                .EditItemAvailabilityShareWithEveryone()
                .EditItemAvailabilityPageSubmitForm();

                workflows.SignOut();
            }
            catch (Exception e)
            {
                TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace);
                new DriverCommands().GetScreenshotAndPageSource();
                throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
            }
        }
 public CreateItemsTest()
 {
     TestContext.WriteLine("CreateItemsTest");
 }
Exemple #27
0
 public AuthenticationTest()
 {
     TestContext.WriteLine("AuthenticationTest");
 }
 public CreatePassagesTest()
 {
     TestContext.WriteLine("CreatePassagesTest");
 }
 public CreateAssessmentsIterativeTest()
 {
     TestContext.WriteLine("CreateAssessmentsIterativeTest");
 }
        public void Leadership_Create_A_Manual_Test_With_1_Item_Search(CreateTestAndItemCentralData createTestAndItemCentralData)
        {
            try
            {
                this.SchoolNet().LoadWebPage();
                Workflows workflows = new Workflows();
                workflows.SignInAsLeadership();

                //Create manual test
                TestContext.WriteLine("\n --- Create manual test ---");
                workflows.AssessWorkflows.CreateManualTestWorkflows
                .NavigateToCreateManualTestPage();

                //set up data for CreateTest.aspx
                CreateTestManualData createTestManualData = workflows.AssessWorkflows.CreateTestManualPage.InitData();
                createTestManualData.GetTestDataFromResxResource(
                    "UITests.Data.Assess.TestCreateEdit.CreateTestResource",
                    "default_" + this.SchoolNet().TestConfiguration.ApplicationName, 0);
                createTestManualData.TestId        = createTestAndItemCentralData.TestID;
                createTestManualData.TestCategory  = "District Benchmark";
                createTestManualData.NumberOfItems = createTestAndItemCentralData.NumberOfItems;
                workflows.AssessWorkflows.CreateTestManualPage.Data = createTestManualData;

                //create a manual test and look up an existing item
                workflows.AssessWorkflows.CreateManualTestWorkflows
                .SetNumberOfItems(createTestManualData.NumberOfItems)
                .NavigateToChooseNewItemPage()
                .ChooseNewItemLookupInItemCentral();

                //select item central advanced search
                workflows.AssessWorkflows.ItemCentralWorkflows
                .SelectAdvanceSearch();

                //set up data for ItemCentral.aspx
                ItemCentralData itemCentralData = workflows.AssessWorkflows.ItemCentralPage.InitData();
                itemCentralData.GetTestDataFromResxResource(
                    "UITests.Data.Assess.ItemCreateEdit.ItemPropertiesResource",
                    "UITests.Data.Assess.ItemCreateEdit.ItemStatisticsResource",
                    "UITests.Data.Assess.Passage.PassageResource",
                    "UITests.Data.Assess.ItemCentral.ItemCentralResource",
                    "default_" + this.SchoolNet().TestConfiguration.ApplicationName, 0);
                itemCentralData.ItemTypeData.Name      = createTestAndItemCentralData.ItemName;
                itemCentralData.ItemTypeData.Keyword   = createTestAndItemCentralData.ItemKeyword;
                itemCentralData.ItemTypeData.Publisher = "SNAutomationTeam";
                itemCentralData.ItemTypeData.ItemType  = createTestAndItemCentralData.ItemType;
                itemCentralData.StandardPickerData     = new StandardPickerDataStructures().GetDefaultStandardPickerData();
                itemCentralData.ItemStatisticsData     = null;
                itemCentralData.NumberOfItemsToBeAddedToTestFromSearchResults = createTestManualData.NumberOfItems;
                workflows.AssessWorkflows.ItemCentralPage.Data = itemCentralData;

                //input the item properties, and search for items
                workflows.AssessWorkflows.ItemCentralWorkflows
                .ItemCentralPageInputAndSubmitForm_ItemProperties()
                .ItemCentralPageSubmitForm();

                //check each item in the item central search results list
                for (int searchResultToSelectIndex = 0; searchResultToSelectIndex < createTestAndItemCentralData.NumberOfItems; searchResultToSelectIndex++)
                {
                    workflows.AssessWorkflows.ItemCentralWorkflows
                    .ItemCentralSearchResultsPageSelectItemInResultsListByIndex(searchResultToSelectIndex);
                }
                //add items to test
                workflows.AssessWorkflows.ItemCentralWorkflows
                .ItemCentralSearchResultsPageAddItemsToViewTestDetailsPage();

                //verify the number of items added appear in the view test details results list
                if (this.SchoolNet().Driver.WrappedDriver.GetType() == typeof(DummyDriver))
                {
                    itemCentralData.NumberOfItemsToBeAddedToTestFromSearchResults = workflows.AssessWorkflows.ViewTestDetailsPage.Form.GetResultsList().Count;
                }
                Assert.AreEqual(itemCentralData.NumberOfItemsToBeAddedToTestFromSearchResults,
                                workflows.AssessWorkflows.ViewTestDetailsPage.Form.GetResultsList().Count,
                                "Required number of Items have not been added to the Test");

                workflows.AssessWorkflows.ViewTestDetailsWorkflows
                .ViewTestDetailsPageMakePublic()
                .ViewTestDetailsPageReadyToSchedule();

                workflows.SignOut();
            }
            catch (Exception e)
            {
                TestContext.WriteLine("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace);
                new DriverCommands().GetScreenshotAndPageSource();
                throw new Exception("\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace, e);
            }
        }