Beispiel #1
0
        public void CalendarNullCheck()
        {
            // Login as School Adminstrator
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            Wait.WaitForDocumentReady();
            // Navigate to Tasks-> School Management-> School Calendar
            AutomationSugar.NavigateMenu("Tasks", "School Management", "School Calendar");
            Wait.WaitForDocumentReady();
            DataPackage dataPackage = this.BuildDataPackage();
            //Calendar Data Injection
            var calendarId          = Guid.NewGuid();
            var calendarName        = Utilities.GenerateRandomString(3, "SNADD");
            var calendarDescription = Utilities.GenerateRandomString(10, "FNADD");

            dataPackage.AddCalendar(calendarId, calendarName, calendarDescription);
            //CalendarEvent new Data
            var newEventName = Utilities.GenerateRandomString(3, "SNADD");

            using (new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: dataPackage))
            {
                #region Steps
                CalendarDetailPage calendar    = new CalendarDetailPage();
                AddEventDialog     eventDialog = calendar.AddEvent();
                eventDialog.EventName = "Test_" + SeleniumHelper.GenerateRandomString(5) + SeleniumHelper.GenerateRandomNumberUsingDateTime();
                eventDialog.ClickOk();
                bool isValidationWarningExsist = SeleniumHelper.DoesWebElementExist(AddEventDialog.ValidationWarning);
                Assert.IsTrue(isValidationWarningExsist, "Validation Warning");
            }
            #endregion
        }
 public void ClickSave(bool isDialogDisplayed = false)
 {
     _saveButton.ClickByJS();
     if (isDialogDisplayed)
     {
         if (SeleniumHelper.DoesWebElementExist(SimsBy.AutomationId("yes_button")))
         {
             IWebElement yesButton = SeleniumHelper.FindElement(SimsBy.AutomationId("yes_button"));
             if (yesButton.Displayed)
             {
                 yesButton.Click();
             }
         }
         if (SeleniumHelper.DoesWebElementExist(SimsBy.AutomationId("continue_with_delete_button")))
         {
             IWebElement yesButton = SeleniumHelper.FindElement(SimsBy.AutomationId("continue_with_delete_button"));
             if (yesButton.Displayed)
             {
                 yesButton.Click();
             }
         }
     }
     Wait.WaitForAjaxReady(By.CssSelector(".locking-mask"));
     Refresh();
 }
Beispiel #3
0
 public void DoubleClick()
 {
     if (!(webElement.GetAttribute("class").Contains("webix_cell_select") &&
           SeleniumHelper.DoesWebElementExist(By.CssSelector(".webix_dt_editor"))))
     {
         webElement.Click();
     }
     SeleniumHelper.FindElement(By.Name("AttendanceRecord.SchoolAttendanceCode")).Click();
 }
Beispiel #4
0
        public static HelpPage Create()
        {
            Wait.WaitForDocumentReady();
            parentPage = SeleniumHelper.GetParentTab();
            SeleniumHelper.SwitchToNewTab(parentPage);
            Wait.WaitForDocumentReady();
            bool exist = SeleniumHelper.DoesWebElementExist(By.Id("page"));

            return(exist ? new HelpPage() : null);
        }
Beispiel #5
0
 public AddCommentDialog AddComment()
 {
     if (!(webElement.GetAttribute("class").Contains("webix_cell_select") &&
           SeleniumHelper.DoesWebElementExist(By.CssSelector(".webix_dt_editor"))))
     {
         webElement.Click();
     }
     SeleniumHelper.FindElement(By.CssSelector(".webix_dt_editor button")).Click();
     return(new AddCommentDialog());
 }
Beispiel #6
0
 public void OpenComment()
 {
     if (!(webElement.GetAttribute("class").Contains("webix_cell_select") &&
           SeleniumHelper.DoesWebElementExist(By.CssSelector(".webix_dt_editor"))))
     {
         webElement.Click();
     }
     SeleniumHelper.FindElement(By.CssSelector("[title='Add/Edit Note']")).Click();
     //SeleniumHelper.FindElement(By.CssSelector("[title='Add/Edit Note']")).ClickByJS();
 }
        public static T Confirm <T>() where T : BaseComponent, new()
        {
            if (SeleniumHelper.DoesWebElementExist(SimsBy.CssSelector("[data-automation-id='ok_button']")) &&
                SeleniumHelper.FindElement(SimsBy.CssSelector("[data-automation-id='ok_button']")).Displayed)
            {
                SeleniumHelper.FindElement(SimsBy.CssSelector("[data-automation-id='ok_button']")).Click();
                Wait.WaitForAjaxReady(By.CssSelector(".locking-mask"));
            }
            var page = default(T);

            Retry.Do(() =>
            {
                page = new T();
            });
            page.Refresh();
            return(page);
        }
Beispiel #8
0
        public void Add_Calendar_Weekly_Recurring_Event_With_NumberOfOccurrences06()
        {
            // Login as School Adminstrator
            SeleniumHelper.Login(SeleniumHelper.iSIMSUserType.SchoolAdministrator);
            Wait.WaitForDocumentReady();
            // Navigate to Tasks-> School Management-> School Calendar
            AutomationSugar.NavigateMenu("Tasks", "School Management", "School Calendar");
            Wait.WaitForDocumentReady();

            DataPackage dataPackage = this.BuildDataPackage();

            //Calendar Data Injection
            var calendarId          = Guid.NewGuid();
            var calendarName        = Utilities.GenerateRandomString(3, "SNADD");
            var calendarDescription = Utilities.GenerateRandomString(10, "FNADD");

            dataPackage.AddCalendar(calendarId, calendarName, calendarDescription);
            //CalendarEvent new Data
            var newEventName = Utilities.GenerateRandomString(3, "SNADD");

            using (new DataSetup(purgeBeforeInsert: false, purgeAfterTest: true, packages: dataPackage))
            {
                #region Steps
                CalendarDetailPage calendar    = new CalendarDetailPage();
                AddEventDialog     eventDialog = calendar.AddEvent();
                eventDialog.EventName = "Test_" + SeleniumHelper.GenerateRandomString(5) + SeleniumHelper.GenerateRandomNumberUsingDateTime();
                eventDialog.StartDate = DateTime.Now.ToString("M/d/yyyy");
                eventDialog.EndDate   = DateTime.Now.ToString("M/d/yyyy");
                eventDialog.Calendar  = "Generic event";
                eventDialog.ClickWeekly();
                eventDialog.ClickRepeatingAfter();
                eventDialog.Interval             = "1";
                eventDialog.IsNumberOfOccurences = true;
                eventDialog.NumberOfOccurrences  = "5";
                string eventId = eventDialog.EventDialogId;
                eventDialog.ClickOk();
                Wait.WaitForDocumentReady();
                bool isValidationWarningExsist = SeleniumHelper.DoesWebElementExist(AddEventDialog.ValidationWarning);
                Assert.IsFalse(isValidationWarningExsist, "Validation Warning");
                // Navigate to Tasks-> School Management-> School Calendar
                //AutomationSugar.NavigateMenu("Tasks", "School Management", "School Calendar");
                //Wait.WaitForDocumentReady();
                //string automationID = "Event_" + eventId;
                //bool isEventTileExsist = SeleniumHelper.DoesWebElementExist(calendar.EventTileIdentifier(automationID));
                //Assert.IsTrue(isEventTileExsist, "Event not added on the Grid");
                ////Edit the Event
                //SeleniumHelper.FindAndClick(calendar.EventTileIdentifier(automationID));
                //EventPopoverCard eventPopover1 = new EventPopoverCard();
                //eventDialog = eventPopover1.EditEvent();
                //eventDialog.EventName = newEventName;
                //eventDialog.ClickOk();
                //// Navigate to Tasks-> School Management-> School Calendar
                //AutomationSugar.NavigateMenu("Tasks", "School Management", "School Calendar");
                //Wait.WaitForDocumentReady();
                //SeleniumHelper.FindAndClick(calendar.EventTileIdentifier(automationID));
                //EventPopoverCard eventPopover2 = new EventPopoverCard();
                //eventDialog = eventPopover2.EditEvent();
                //Assert.AreEqual(newEventName, eventDialog.EventName, "Event Edit Unsuccessful");
                //eventDialog.ClickCancel();
                ////Delete the event
                //SeleniumHelper.FindAndClick(calendar.EventTileIdentifier(automationID));
                //EventPopoverCard eventPopover3 = new EventPopoverCard();
                //ConfirmDeleteDialog deleteDialog = eventPopover3.EventDeleteConfirmation();
                //deleteDialog.DeleteEventSeries = true;
                //deleteDialog.ContinueWithDelete();
                #endregion
            }
        }
Beispiel #9
0
 public bool IsWarningMessageIsDisplayed()
 {
     Wait.WaitForControl(SimsBy.CssSelector("[data-automation-id='status_error']"));
     return(SeleniumHelper.DoesWebElementExist(SimsBy.CssSelector("[data-automation-id='status_error']")));
 }
Beispiel #10
0
 public bool IsMessgeSuccessDisplay()
 {
     return(SeleniumHelper.DoesWebElementExist(_successMessage));
 }
Beispiel #11
0
 public bool IsSuccessMessageIsDisplayed()
 {
     Wait.WaitForControl(SimsBy.CssSelector("[data-automation-id='status_success']"));
     return(SeleniumHelper.DoesWebElementExist(_statusSuccess));
 }
Beispiel #12
0
 public static bool IsPageExist()
 {
     return(SeleniumHelper.DoesWebElementExist(SimsBy.Id("screen")));
 }