public async Task UpdateOneDayIn2By2()
        {
            #region Create worker

            var worker = new[] { new Worker {
                                     FullName = "Василий"
                                 } };
            var created = await workerRepository.CreateManyAsync(shop.Id, worker);

            var firstDay          = DateHelper.GetFirstDayOfMonth(Now);
            var firstDayPrevMonth = DateHelper.GetFirstDayOfMonth(firstDay.AddDays(-1));

            await BuildCalendar2By2(created[0].Id, firstDayPrevMonth, GetTimePeriod(9, 18));

            #endregion

            var page = LoadMainPage().GoToWorkerListPage();
            page.OpenCalendar();
            page.GoToPrevMonth();

            var editingView = page.OpenEditor(0, 1).GetEditingView();
            editingView.SetTimeRange("10:00", "21:00");
            editingView.ClickSave();

            page.OpenEditor(0, 0).GetInfoView().CheckStartEndTime("09:00", "18:00");
            WaiterHelper.WaitUntil(() => page.CheckStartAndEndTime(0, 1, "10:00", "21:00"));
            page.GetCell(0, 3).WaitNotFilled();
        }
示例#2
0
        public async Task TrickySixPeriods()
        {
            await CreateWorker();

            var page = LoadMainPage().GoToWorkerListPage().OpenCalendar();

            var editingView = page.OpenEditor(0, 0).GetEditingView();

            editingView.SetTimeRange("23:00", "01:00");
            editingView.ClickSave();

            editingView = page.OpenEditor(0, 1).GetEditingView();
            editingView.SetTimeRange("02:00", "02:30", 0);
            editingView.SetTimeRange("03:00", "03:30", 1);
            editingView.SetTimeRange("04:00", "04:30", 2);
            editingView.SetTimeRange("05:00", "05:30", 3);
            editingView.SetTimeRange("06:00", "06:30", 4);
            editingView.ClickSave();

            editingView = page.OpenEditor(0, 0).GetEditingView();
            editingView.SetTimeRange("00:30", "23:30", 1);
            editingView.ClickSave();

            var editor   = page.OpenEditor(0, 1);
            var infoView = editor.GetInfoView();

            WaiterHelper.WaitUntil(() =>
            {
                if (infoView.TimeInfoLine.Count.Get() == 6)
                {
                    return(true);
                }
                editor.GetEditingView().ClickCancel();
                editor   = page.OpenEditor(0, 1);
                infoView = editor.GetInfoView();
                return(false);
            });

            infoView.CheckStartEndTime("00:00", "01:00", atRow: 0);
            infoView.CheckStartEndTime("02:00", "02:30", atRow: 1);
            infoView.CheckStartEndTime("03:00", "03:30", atRow: 2);
            infoView.CheckStartEndTime("04:00", "04:30", atRow: 3);
            infoView.CheckStartEndTime("05:00", "05:30", atRow: 4);
            infoView.CheckStartEndTime("06:00", "06:30", atRow: 5);

            editingView = editor.GetEditingView();

            editingView.CheckTimeRange("00:00", "01:00", atRow: 0);
            editingView.CheckTimeRange("02:00", "02:30", atRow: 1);
            editingView.CheckTimeRange("03:00", "03:30", atRow: 2);
            editingView.CheckTimeRange("04:00", "04:30", atRow: 3);
            editingView.CheckTimeRange("05:00", "05:30", atRow: 4);
            editingView.CheckTimeRange("06:00", "06:30", atRow: 5);
        }
        public async Task UpdateTime()
        {
            var worker = new[] { new Worker {
                                     FullName = "Василий"
                                 } };
            var created = await workerRepository.CreateManyAsync(shop.Id, worker);

            await BuildOneWorkingDay(created[0].Id, Now, GetTimePeriod(10, 21));

            var dayIdx = Now.Day - 1;

            var page = LoadMainPage().GoToWorkerListPage();

            page.OpenCalendar();
            var editingView = page.OpenEditor(0, dayIdx).GetEditingView();

            editingView.SetTimeRange("12:30", "18:00");
            editingView.ClickSave();
            WaiterHelper.WaitUntil(() => page.CheckStartAndEndTime(0, dayIdx, "12:30", "18:00"));
        }