예제 #1
0
        public void DragAndDropTemporaryList()
        {
            // //Pages.PriceList_Page.PriceListFirstCodeName();;
            Pages.Patient_Page.NewPatientApplication();
            Pages.Patient_Page.ClosePatientTab.ClickOn();
            Thread.Sleep(500);
            EnterStandBySchedulerList();
            Constant.tmpListCount = utility.ListCount("//*[@id='temp-wait-list']");
            var test           = Browser.Driver.FindElement(By.XPath("//*[@id='tempWaitListPanelBar']/li/span/span[3]")).Text;
            var schedulerRows  = utility.TableCount("//*[@id='scheduler']/table/tbody/tr[2]/td[2]/div/table/tbody");
            var schedulerCells = utility.TableDataCount("//*[@id='scheduler']/table/tbody/tr[2]/td[2]/div/table/tbody");
            int numOfCellInRow = schedulerCells / schedulerRows;
            int currentRow     = 1;

            for (int td = 1; td < schedulerCells;)
            {
                IWebElement singleCell = Browser.Driver.FindElement(By.XPath("//*[@id='scheduler']/table/tbody/tr[2]/td[2]/div/table/tbody/tr[" + currentRow + "]/td[" + td + "]"));
                (new Actions(Browser.chromebDriver)).DoubleClick(singleCell).Perform();
                Thread.Sleep(500);
                if (Pages.Home_Page.ErrorPopup.IsDisplayed("error popup"))
                {
                    //  Pages.Home_Page.ErrorPopup.ClickOn();
                    td++;
                    if (td == numOfCellInRow)
                    {
                        currentRow++;
                        td = 1;
                    }
                }
                else if (Pages.Meeting_Page.CancelMeeting.Displayed)
                {
                    break;
                }
            }
            if (Browser.Driver.FindElement(By.XPath("//*[@id='btnCreateAppointmentSave']")).GetAttribute("aria-disabled").Equals("true"))
            {
                //enter inside exist meeting
                Pages.Meeting_Page.CancelMeeting.ClickOn();
                dragAndDropWaitListAction();
            }
            else if (!Browser.Driver.FindElement(By.XPath("//*[@id='btnCreateAppointmentSave']")).GetAttribute("aria-disabled").Equals("true"))
            {
                Pages.Meeting_Page.CreateMeetingApplication();
                dragAndDropWaitListAction();
            }
        }