示例#1
0
        public void CheckEventCounterInSchedulEditor()
        {
            //Opening Caesar and Logging in
            driver.Url        = baseURL;
            loginPageInstance = new LoginPage(driver);
            loginPageInstance.LogIn("Dmytro", "1234", wait);

            //Opening Schedule Page
            MainPageInstance = new MainPage(driver);
            MainPageInstance.OpenScheduleContent(wait);

            //Selecting group
            MainPageInstance.LeftContainer.GroupsInLocation.EndedGroupsToggle.Click();
            MainPageInstance.LeftContainer.GroupsInLocation.GetGroupByName("DP-092-NET").Click();

            //Open ScheduleEditor
            MainPageInstance.CenterContainer.ScheduleContent.ClickCogwheel(wait);

            //Choose options for event

            Acts.SelectOptionFromDDL(MainPageInstance.ModalWindow.EditScheduleWindow.RoomControl, "740");
            Acts.SelectOptionFromDDL(MainPageInstance.ModalWindow.EditScheduleWindow.EventControl, "Special");
            MainPageInstance.ModalWindow.EditScheduleWindow.WeeklyReportEvent.Click();

            // Put event in cell
            IWebElement cell = MainPageInstance.ModalWindow.EditScheduleWindow.ScheduleEditWeekTable.GetCell("9:00", "Wednesday\r\n08/29");

            MainPageInstance.ModalWindow.EditScheduleWindow.PutEventInCell(MainPageInstance, cell, wait);

            //Assert EventCounter changed
            Assert.AreEqual("1/2", MainPageInstance.ModalWindow.EditScheduleWindow.GetEventCounter(MainPageInstance.ModalWindow.EditScheduleWindow.WeeklyReportEvent));

            //Close ScheduleEditor
            MainPageInstance.ModalWindow.EditScheduleWindow.CancelButton.Click();
        }
示例#2
0
        public void TestCellSelectorOnStudentsList()
        {
            //Navigating to Students Page

            TopMenu topMenuInstance = new TopMenu(driver);
            Actions builder         = new Actions(driver);

            builder.MoveToElement(topMenuInstance.TopMenuSection).Build().Perform();
            Acts.Click(topMenuInstance.StudentsItem);


            //Select group from LeftContainer

            mainPageClassInstance = new MainPageClass(driver);

            Acts.Click(mainPageClassInstance.LeftContainer.GroupsInLocation.GetGroupByName("DP-094-MQC"));

            //Go to table

            GroupView groupViewInstance = new GroupView(driver);

            groupViewInstance.EditButton.Click();

            //Select some cell using method CellSelector

            EditStudentList editStudentListInstance = new EditStudentList(driver);
            string          text = editStudentListInstance
                                   .StudentTable
                                   .GetCellBy2Keys("English level", "Reaper Carolina")
                                   .Text;

            Console.WriteLine(text);
        }
        public SectionBase AddSubsection()
        {
            var subsection = new Act();

            Acts.Add(subsection);
            return(subsection);
        }
示例#4
0
 public void Test_EnterKey_Login(String login, String password)
 {
     Acts.InputValue(loginPageInstance.LoginField, login);
     Acts.InputValue(loginPageInstance.PasswordField, password);
     new Actions(driver).SendKeys(Keys.Enter).Perform();
     Assert.IsTrue(wait.Until(d => MainPage.IsMainPageOpened(d)));
 }
示例#5
0
        public void TestCellSelectorOnKeyDatesTable()
        {
            //Opening Schedule Page
            TopMenu topMenuInstance = new TopMenu(driver);
            Actions builder         = new Actions(driver);

            builder.MoveToElement(topMenuInstance.TopMenuSection).Build().Perform();
            Acts.Click(topMenuInstance.ScheduleItem);

            //Select group from LeftContainer
            scheduleContentInstance = new ScheduleContent(driver);
            Acts.Click(scheduleContentInstance
                       .LeftContainerInstance
                       .GroupsInLocation
                       .GetGroupByName("DP-094-MQC"));

            //Go to Key-Dates tab

            scheduleContentInstance.KeyDatesButton.Click();

            // Select some cell in key-dates table

            ScheduleKeyDatesTab scheduleKeyDatesTabInstance = new ScheduleKeyDatesTab(driver);
            string text = scheduleKeyDatesTabInstance.KeyDatesTable.GetCellBy2Keys("Demo2", "DP-094-MQC").Text;

            Console.WriteLine("Value from cell " + text);
        }
示例#6
0
 public void ExecuteTest_UploadFiles_FilesUploaded(int expected, string CV, string photo)
 {
     //Upload CV
     path = EditStudentWindow.GetTestFile(CV);
     mainPageInstance.ModalWindow.EditStudentWindow.BrowseCVButton.Click();
     Acts.UploadFile(path);
     //Accep Allert if necessary
     if (Acts.IsAlertPresent(wait))
     {
         webDriver.SwitchTo().Alert().Accept();
     }
     //Upload photo
     path = EditStudentWindow.GetTestFile(photo);
     mainPageInstance.ModalWindow.EditStudentWindow.BrowsePhotoButton.Click();
     Acts.UploadFile(path);
     //Accep Allert if necessary
     if (Acts.IsAlertPresent(wait))
     {
         webDriver.SwitchTo().Alert().Accept();
     }
     //Save changes
     mainPageInstance.ModalWindow.EditStudentWindow.SaveButton.Click();
     wait.Until((d) => EditStudentListWindow.IsOpened(d));
     //Check if files saved
     mainPageInstance.ModalWindow.EditStudentListWindow.StudentTable.GetElementFromCell
         (mainPageInstance.ModalWindow.EditStudentListWindow.Students.Count, EditStudentListWindow.EditButtonsColumn).Click();
     wait.Until((d) => EditStudentWindow.IsOpened(d));
     Assert.AreEqual(expected, mainPageInstance.ModalWindow.EditStudentWindow.CountUploadedFiles());
 }
示例#7
0
        public string[] RunRequest(string friendly, CredRequester request)
        {
            string[] strOut = new string[] { "err", "Could not process requests", "" };
            Acts     choice = request.action;

            if (choice == Acts.find)
            {
                strOut[0] = "ok";
                string pub = cert1.PublicKey.Key.ToXmlString(false);
                request.result = pub;
            }
            else if (choice == Acts.sign)
            {
                strOut[0] = "ok";
                string pub = cert1.PublicKey.Key.ToXmlString(false);
                request.result = pub;
            }
            else if (choice == Acts.decrypt)
            {
                strOut[0] = "ok";
                string pub = cert1.PublicKey.Key.ToXmlString(false);
                request.result = pub;
            }
            return(strOut);
        }
示例#8
0
        public void TestNewCellSelectorOnStudentsList()
        {
            //Navigating to Students Page

            TopMenu topMenuInstance = new TopMenu(driver);
            Actions builder         = new Actions(driver);

            builder.MoveToElement(topMenuInstance.TopMenuSection).Build().Perform();
            Acts.Click(topMenuInstance.StudentsItem);


            //Select group from LeftContainer

            mainPageClassInstance = new MainPageClass(driver);

            Acts.Click(mainPageClassInstance.LeftContainer.GroupsInLocation.GetGroupByName("DP-094-MQC"));

            //Go to table

            GroupView groupViewInstance = new GroupView(driver);

            groupViewInstance.EditButton.Click();

            //Select some cell using method CellSelector
            EditStudentList editStudentListInstance = new EditStudentList(driver);
            IWebElement     tableElement            = editStudentListInstance.StudentTable;
            Table           table = new Table(tableElement, driver);
            String          text1 = table.getValueFromCell(2, 2);
            String          text2 = table.getValueFromCell(2, "Name");

            Console.WriteLine(text1);
            Console.WriteLine(text2);
        }
示例#9
0
 public void ExecuteTest_ImportStudentList_ListImported()
 {
     mainPageInstance.ModalWindow.EditStudentListWindow.ImportStudentsButton.Click();
     path = EditStudentListWindow.GetTestFile("TC_3_06_01-03.txt");
     Acts.UploadFile(path);
     mainPageInstance.ModalWindow.EditStudentListWindow.SaveFormButton.Click();
     Assert.AreEqual(4, mainPageInstance.ModalWindow.EditStudentListWindow.Students.Count);
 }
示例#10
0
        private void NewNode_Click(object sender, EventArgs e)
        {
            CurrentAct = Acts.AddNode;
            VisualModel.Nodes.ClearSelection();
            VisualModel.Nodes.DrawTo(pbDrawing);

            tbAct.Text = @"Укажите, куда добавить вершину";
        }
示例#11
0
 public void ExecuteTest_ImportStudentList_ListNotImported()
 {
     mainPageInstance.ModalWindow.EditStudentListWindow.ImportStudentsButton.Click();
     path = EditStudentListWindow.GetTestFile("TC_3_06_05.docx");
     Acts.UploadFile(path);
     wait.Until((d) => EditStudentListWindow.IsNotEmpty(d));
     Assert.AreEqual(0, mainPageInstance.ModalWindow.EditStudentListWindow.Students.Count);
 }
示例#12
0
        private void ConnectNodesButton_Click(object sender, EventArgs e)
        {
            CurrentAct = Acts.ConnectNodes;
            VisualModel.Nodes.ClearSelection();
            VisualModel.Nodes.DrawTo(pbDrawing);

            tbAct.Text = @"Укажите соединяемые вершины";
        }
示例#13
0
        public void ExecuteTest_DropStudentList_ListImported()
        {
            path = EditStudentListWindow.GetTestFile("TC_3_06_01-03.txt");
            IWebElement droparea = webDriver.FindElement(By.ClassName("modal_editStudentlist"));

            Acts.DropFile(droparea, path);
            mainPageInstance.ModalWindow.EditStudentListWindow.SaveFormButton.Click();
            Assert.AreEqual(4, mainPageInstance.ModalWindow.EditStudentListWindow.Students.Count);
        }
示例#14
0
        public virtual void In(Act Action, Until Until)
        {
            var ai = new ActInfo();

            ai.Action = Action;
            ai.Until  = Until;
            ai.NoTime = true;
            Acts.Add(ai);
        }
示例#15
0
        private void ButtonDelete_Click(object sender, EventArgs e)
        {
            CurrentAct = Acts.Delete;
            VisualModel.Nodes.ClearSelection();
            VisualModel.Nodes.DrawTo(pbDrawing);
            tbAct.Text = @"Укажите, что удалить";

            //само действие
        }
示例#16
0
        private void ButtonMove_Click(object sender, EventArgs e)
        {
            CurrentAct = Acts.MoveNode;
            VisualModel.Nodes.ClearSelection();
            VisualModel.Nodes.DrawTo(pbDrawing);
            tbAct.Text = @"Потяните вершину";

            //само действие
        }
示例#17
0
 public void ExecuteTest_ImportStudentList_CorrectDataImported()
 {
     mainPageInstance.ModalWindow.EditStudentListWindow.ImportStudentsButton.Click();
     path = EditStudentListWindow.GetTestFile("TC_3_06_04.csv");
     Acts.UploadFile(path);
     wait.Until((d) => EditStudentListWindow.IsOpened(d));
     mainPageInstance.ModalWindow.EditStudentListWindow.SaveFormButton.Click();
     Assert.AreEqual(1, mainPageInstance.ModalWindow.EditStudentListWindow.Students.Count);
 }
示例#18
0
        public virtual void In(int ms, Act Action, Until Until)
        {
            var ai = new ActInfo();

            ai.Action = Action;
            ai.When   = Environment.TickCount + ms;
            ai.Until  = Until;
            Acts.Add(ai);
        }
示例#19
0
        public void ExecuteTest_ChooseLocationSofia_UsingDoubleClick_CheckGroupsName()
        {
            topMenuInstance = mainPageInstance.MoveToTopMenu();
            Acts.Click(topMenuInstance.LocationsItem);
            mainPageInstance.DoubleClick(mainPageInstance.ModalWindow.LocationWindow.CitySofia);
            string exeptualResultTitle = "Sf-089-MQC";

            Console.WriteLine(mainPageInstance.LeftContainer.GroupsInLocation.GetGroupByName("Sf-089-MQC").Text);
            Assert.AreEqual(exeptualResultTitle, mainPageInstance.LeftContainer.GroupsInLocation.GetGroupByName("Sf-089-MQC").Text);
        }
示例#20
0
        public virtual void In(int ms, Act Action, bool once = true, int forms = 0)
        {
            var ai = new ActInfo();

            ai.Action = Action;
            ai.When   = Environment.TickCount + ms;
            ai.For    = forms;
            ai.Once   = once;
            Acts.Add(ai);
        }
示例#21
0
 public void OneTimeTearDownTest()
 {
     //Delete test students
     mainPageInstance.ModalWindow.EditStudentListWindow.StudentTable.GetElementFromCell
         (mainPageInstance.ModalWindow.EditStudentListWindow.Students.Count, EditStudentListWindow.DeleteButtonsColumn).Click();
     Acts.PressKeyboardButton(@"{Enter}");
     wait.Until((d) => EditStudentListWindow.IsOpened(d));
     webDriver.Close();
     webDriver.Quit();
 }
示例#22
0
        public void Test_EscKey_EmptyFields(String login, String password)
        {
            Acts.InputValue(loginPageInstance.LoginField, login);
            Acts.InputValue(loginPageInstance.PasswordField, password);
            loginPageInstance.PasswordField.SendKeys(Keys.Escape);
            bool loginFieldEmpty = String.Empty.Equals(loginPageInstance.LoginField.GetAttribute("value"));
            bool passFieldEmpty  = String.Empty.Equals(loginPageInstance.PasswordField.GetAttribute("value"));

            Assert.IsTrue(loginFieldEmpty & passFieldEmpty);
        }
示例#23
0
        public void ExecuteTest_ChooseLocationSofia_UsingDoubleClick_LocationPageOpened()
        {
            topMenuInstance = mainPageInstance.MoveToTopMenu();
            Acts.Click(topMenuInstance.LocationsItem);
            mainPageInstance.DoubleClick(mainPageInstance.ModalWindow.LocationWindow.CitySofia);
            string exeptualResultTitle = "Sofia";

            groupLocationInstance = new CenterContainer(driver);
            Console.WriteLine(groupLocationInstance.GroupLocation.Text);
            Assert.AreEqual(exeptualResultTitle, groupLocationInstance.GroupLocation.Text);
        }
示例#24
0
 public void OneTimeTearDownTest()
 {
     for (int i = 0; i < studentData.Length; i++)
     {
         mainPageInstance.ModalWindow.EditStudentListWindow.StudentTable.GetElementFromCell
             (mainPageInstance.ModalWindow.EditStudentListWindow.Students.Count, EditStudentListWindow.DeleteButtonsColumn).Click();
         Acts.PressKeyboardButton(@"{Enter}");
     }
     webDriver.Quit();
     webDriver.Close();
 }
示例#25
0
        public virtual void In(int ms, Act Action, Until Until)
        {
            ActInfo ai = new ActInfo
            {
                Action = Action,
                When   = Environment.TickCount + ms,
                Until  = Until
            };

            Acts.Add(ai);
        }
示例#26
0
        public void ExecuteTest_CheckButtonAbout(string expectedResult)
        {
            topMenuInstance = mainPageInstance.MoveToTopMenu();
            Acts.Click(topMenuInstance.AboutItem);
            aboutInstance = new About(driver);
            List <String> actualResult     = aboutInstance.GetButtonsName(wait);
            string        lineActualResult = (string.Join(",", actualResult.ToArray()));

            Console.WriteLine(lineActualResult);
            Assert.AreEqual(expectedResult, lineActualResult);
        }
示例#27
0
        public virtual void In(Act Action, Until Until)
        {
            ActInfo ai = new ActInfo
            {
                Action = Action,
                Until  = Until,
                NoTime = true
            };

            Acts.Add(ai);
        }
示例#28
0
        public void ExecuteTest_ChooseLocationChernivtsy_LocationPageOpened()
        {
            topMenuInstance = mainPageInstance.MoveToTopMenu();
            Acts.Click(topMenuInstance.LocationsItem);
            Acts.Click(mainPageInstance.ModalWindow.LocationWindow.CityChernivtsy);
            Acts.Click(mainPageInstance.ModalWindow.LocationWindow.ConfurmButton);
            string exeptualResultTitle = "Chernivtsy";

            groupLocationInstance = new CenterContainer(driver);
            Console.WriteLine(groupLocationInstance.GroupLocation.Text);
            Assert.AreEqual(exeptualResultTitle, groupLocationInstance.GroupLocation.Text);
        }
示例#29
0
        public void ExecuteTest_CancelLocationIvanoFrankivsk_UsingKeyBoard()
        {
            topMenuInstance = mainPageInstance.MoveToTopMenu();
            Acts.Click(topMenuInstance.LocationsItem);
            Acts.Click(mainPageInstance.ModalWindow.LocationWindow.CityIvanoFrankivsk);
            Acts.PressKeyboardButton("{Esc}");
            string exeptualResultTitle = "Lviv";

            groupLocationInstance = new CenterContainer(driver);
            Console.WriteLine(groupLocationInstance.GroupLocation.Text);
            Assert.AreEqual(exeptualResultTitle, groupLocationInstance.GroupLocation.Text);
        }
示例#30
0
        public void ExecuteTest_LocationPageCloseWithoutChoosing()
        {
            topMenuInstance = mainPageInstance.MoveToTopMenu();
            Acts.Click(topMenuInstance.LocationsItem);
            Acts.Click(mainPageInstance.ModalWindow.LocationWindow.CityLviv);
            Acts.Click(mainPageInstance.ModalWindow.LocationWindow.CancelButton);
            string exeptualResultTitle = "Dnipro";

            groupLocationInstance = new CenterContainer(driver);
            Console.WriteLine(groupLocationInstance.GroupLocation.Text);
            Assert.AreEqual(exeptualResultTitle, groupLocationInstance.GroupLocation.Text);
        }