示例#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
        }
示例#2
0
        public void Add_Calendar_NonRecurring_AllDay_Event02()
        {
            // 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.IsAllDay  = true;
                eventDialog.Calendar  = "Generic event";
                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.ContinueWithDelete();
                #endregion
            }
        }