Example #1
0
        public void ThenIShouldNavigateToMyPropertiesPage()
        {
            //create the object of the CommonPage
            CommonPage pageproperties = new CommonPage();

            pageproperties.clickOwners();
        }
Example #2
0
        /// <summary>
        /// 分页获取教师上课表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <vw_ClassAttendanceList> GetAttendanceRecordList(TeacherClassListSearch search)
        {
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

            fields  = @"  * ";                                                                                //输出字段
            table   = @" vw_ClassAttendanceList ";                                                            //表或者视图
            orderby = "ClassIndex";                                                                           //排序信息
            StringBuilder sb = new StringBuilder();                                                           //构建where条件

            sb.Append(" 1=1 ");


            if (!string.IsNullOrWhiteSpace(search.timeStart))//开班时间
            {
                sb.AppendFormat(" and ClassDate > = '{0}' ", search.timeStart);
            }
            if (!string.IsNullOrWhiteSpace(search.timeEnd))//结束时间
            {
                sb.AppendFormat(" and ClassDate <= '{0}' ", search.timeEnd);
            }


            if (!string.IsNullOrWhiteSpace(search.teacherID))//vw_AttendanceRecord ID
            {
                sb.AppendFormat(" and  (TeacherID ='{0}' or Teacher2ID ='{0}') ", search.teacherID);
            }
            where = sb.ToString();
            int allcount = 0;
            var list     = CommonPage <vw_ClassAttendanceList> .GetPageList(
                out allcount, table, fields : fields, where : where.Trim(),
                orderby : orderby, pageindex : search.CurrentPage, pagesize : search.PageSize, connect : DBKeys.PRX);

            return(new PagedList <vw_ClassAttendanceList>(list, search.CurrentPage, search.PageSize, allcount));
        }
Example #3
0
        /// <summary>
        /// 分页获取按钮列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <Teachers> GetButtonList(TeacherSearchModel search)
        {
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

            fields  = @"  * ";                                                                                //输出字段
            table   = @" Teachers ";                                                                          //表或者视图
            orderby = "CreateTime";                                                                           //排序信息
            StringBuilder sb = new StringBuilder();                                                           //构建where条件

            sb.Append(" 1=1 ");
            switch (search.LeaveDate)
            {
            case 1:
                sb.Append(" and LeaveDate is null ");
                break;

            case 2:
                sb.Append(" and LeaveDate <> '' ");
                break;
            }

            if (!string.IsNullOrWhiteSpace(search.TeacherName))//按钮中文名称
            {
                sb.AppendFormat(" and name like '%{0}%' ", search.TeacherName);
            }
            //if (!string.IsNullOrWhiteSpace(search.BTN_Name_En))//城市
            //    sb.AppendFormat(" and BTN_Name_En like '%{0}%' ", search.BTN_Name_En);
            where = sb.ToString();
            int allcount = 0;
            var list     = CommonPage <Teachers> .GetPageList(
                out allcount, table, fields : fields, where : where.Trim(),
                orderby : orderby, pageindex : search.CurrentPage, pagesize : search.PageSize, connect : DBKeys.PRX);

            return(new PagedList <Teachers>(list, search.CurrentPage, search.PageSize, allcount));
        }
Example #4
0
        public void WhenIClickButton(string action)
        {
            CommonPage commonPage = new CommonPage(Driver, _appSettings);

            switch (action)
            {
            case "Login":
                commonPage.DoUserLogin();
                break;

            case "SignOut":
                commonPage.DoUserSignOut();
                break;

            case "Continue to shipping":
            case "Continue to payment":
                commonPage.ClickContinueShipping(action);
                break;

            case "Return to information":
            case "Return to shipping":
                commonPage.ClickReturnLinkBtn(action);
                break;

            case "Save":
                commonPage.ClickAccountSaveBtn();
                break;
            }
        }
Example #5
0
        protected override void ExecuteTestCase()
        {
            Reporter.Chapter.Title = "Clicks all the links in the webportal";
            Step = "Login into web portal application";
            CommonPage.NavigateTo(Driver, Reporter, Util.EnvironmentSettings["Server"]);
            CommonPage.Login(Driver, Reporter, UserName, Password);
            try
            {
                foreach (string application in applications)
                {
                    Step = "Select " + application + " from the navigation menu";
                    CommonPage.SelectApplication(Driver, Reporter, application);

                    Step      = "Get the menu count  and menu names in " + "<b>" + application + "</b>" + " application";
                    menuCount = CommonPage.GetMenuCount(Driver, Reporter, application);
                    menuNames = CommonPage.GetMenuNames(Driver, Reporter, menuIndex, menuCount);

                    Step = "Number of links in  " + "<b>" + application + "</b>" + " is:" + "<b>" + menuCount + "</b>" + ", Check below";

                    foreach (string menuItem in menuNames)
                    {
                        Step = (intiterator++) + ". Click " + "<b>" + menuItem + "</b>" + " and click sub menus under it";
                        CommonPage.ClickAllSubMenusInEachMenu(Driver, Reporter, resultsPath, menuItem, menuNames);
                    }

                    Step = "Switch to " + "<b>" + application + "</b>" + " application";
                    CommonPage.SwitchApplication(Driver, Reporter, application);
                }
            }
            catch (System.Exception)
            {
                CommonPage.AcceptOrDissmissAlertIfPresent(Driver, Reporter);
                CommonPage.AcceptErrorMessageIfPresent(Driver, Reporter, resultsPath);
            }
        }
Example #6
0
        public void TC02_AddProductsToCartAndPurchase()
        {
            CommonPage cp = new CommonPage(driver);

            cp.ClickWomenCategory();
            Thread.Sleep(5000);
            WomensCatPage wp = new WomensCatPage(driver);

            wp.AddFirstItemtoCart();
            wp.ClickContinueShopping();
            cp.ClickDresses_category();
            CatDressesPage dp = new CatDressesPage(driver);

            dp.AddFirstItemtoCart();
            dp.ClickCheckOut();
            AddressPage addresspage = new AddressPage(driver);

            addresspage.ClickProceedtoCheckout();   //it is for summary page
            addresspage.ClickProceedtoCheckout();
            ShippingPage shippingpage = new ShippingPage(driver);

            shippingpage.ClickProceedtoCheckout();
            PaymentPage paymentpage = new PaymentPage(driver);

            paymentpage.CompletePayment();
            Thread.Sleep(5000);
        }
Example #7
0
        /// <summary>
        /// 查询文件管理
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <Files> GetFileseList(FileManageListSearchModel search)
        {
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

            fields  = @"  * ";                                                                                //输出字段
            table   = @" Files ";                                                                             //表或者视图
            orderby = "ID";                                                                                   //排序信息
            StringBuilder sb = new StringBuilder();                                                           //构建where条件

            sb.Append(" 1=1 ");
            if (!string.IsNullOrWhiteSpace(search.FileName))//名称
            {
                sb.AppendFormat(" and FileName like '%{0}%' ", search.FileName);
            }
            if (!string.IsNullOrWhiteSpace(search.FileTitle))//名称
            {
                sb.AppendFormat(" and FileTitle like '%{0}%' ", search.FileTitle);
            }


            //判断是否添加了管理员和校长权限,添加了就不查询全部
            int isnull = 0;

            for (int i = 0; i < search.isnull.Count; i++)
            {
                if (search.isnull[i] == "1" || search.isnull[i] == "4")
                {
                    isnull = 1;
                }
            }
            if (search.isnull.Count == 0)
            {
                isnull = 2;
            }
            //根据获取的角色来判断是否是管理员和校长,不是就按角色本身来查询
            if (isnull != 1)
            {
                for (int i = 0; i < search.isnull.Count; i++)
                {
                    if (search.isnull[i] != "1" || search.isnull[i] != "4")
                    {
                        sb.AppendFormat(" and ToRoles like '%{0}%' ", search.isnull[i]);
                    }
                }
            }

            if (isnull == 2)
            {
                sb.AppendFormat(" and 1<>1 ");
            }


            where = sb.ToString();
            int allcount = 0;
            var list     = CommonPage <Files> .GetPageList(
                out allcount, table, fields : fields, where : where.Trim(),
                orderby : orderby, pageindex : search.CurrentPage, pagesize : search.PageSize, connect : DBKeys.PRX);

            return(new PagedList <Files>(list, search.CurrentPage, search.PageSize, allcount));
        }
        protected override void ExecuteTestCase()
        {
            Reporter.Chapter.Title = "Clicks all the links in the webportal";
            Step = "Login into web portal application";
            CommonPage.NavigateTo(Driver, Reporter, Util.EnvironmentSettings["Server"]);
            CommonPage.Login(Driver, Reporter, UserName, Password);

            Step = "Select " + TestData["APPLICATIONNAME"] + " link from the navigation menu";
            CommonPage.SelectApplication(Driver, Reporter, TestData["APPLICATIONNAME"]);

            Step = "Assert page title of " + TestData["TITLE"] + "";
            CommonPage.AssertPageTitle(Driver, Reporter, TestData["TITLE"]);

            Step      = "Get the menu count  and menu names in " + "<b>" + TestData["APPLICATIONNAME"] + "</b>" + "";
            menuCount = CommonPage.GetMenuCount(Driver, Reporter, TestData["APPLICATIONNAME"]);
            menuNames = CommonPage.GetMenuNames(Driver, Reporter, menuIndex, menuCount);

            Step = "Number of menu items in  " + "<b>" + TestData["APPLICATIONNAME"] + "</b>" + " menu is:" + "<b>" + menuCount + "</b>" + ", Check below";

            foreach (string menuItem in menuNames)
            {
                Step = (intiterator++) + ". Click the " + "<b>" + menuItem + "</b>" + " menu and click all sub menus under it";
                CommonPage.ClickAllSubMenusInEachMenu(Driver, Reporter, resultsPath, menuItem, menuNames);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     scripts = new CommonPage();
     playerId = Convert.ToInt32(Request["id"]);
     loadPlayerInfo();
     AppendDataToGrid();
 }
        public void WhenUserClicksOnListRentalsButtonAndTypesAllTheRequiredFieldsAndClickSaveButton()
        {
            // Creates a toggle for the given test, adds all log events under it
            test = extent.StartTest("ListARental");


            //create the object of the CommonPage
            CommonPage pageproperties = new CommonPage();

            pageproperties.clickOwners();


            //create the object of the OwnersPage
            OwnersPage PageOwners = new OwnersPage();


            PageOwners.clickListARental();

            //create the object of the ListARental Page
            ListARental PageListRental = new ListARental();

            //Enters all the required fields and saves the changes
            PageListRental.ListAPropertyForRental(true, false);

            System.Threading.Thread.Sleep(3000);
        }
Example #11
0
        /// <summary>
        /// 分页每日结账单列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <vw_DailyReport> GetDailyReportList(DailyReportSearchModel search)
        {
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

            fields  = @"  * ";                                                                                //输出字段
            table   = @" vw_DailyReport ";                                                                    //表或者视图
            orderby = "ID desc";                                                                              //排序信息
            StringBuilder sb = new StringBuilder();                                                           //构建where条件

            sb.Append(" 1=1 ");
            if (!string.IsNullOrWhiteSpace(search.Name))//学生姓名
            {
                sb.AppendFormat(" and Name like '%{0}%' ", search.Name);
            }
            if (!string.IsNullOrWhiteSpace(search.BindPhone))//联系电话
            {
                sb.AppendFormat(" and BindPhone like '%{0}%' ", search.BindPhone);
            }
            if (!string.IsNullOrWhiteSpace(search.timeStart))//开班时间
            {
                sb.AppendFormat(" and CreateTime > = '{0}' ", search.timeStart);
            }
            if (!string.IsNullOrWhiteSpace(search.timeEnd))//结束时间
            {
                sb.AppendFormat(" and CreateTime <= '{0}' ", search.timeEnd);
            }
            where = sb.ToString();
            int allcount = 0;
            var list     = CommonPage <vw_DailyReport> .GetPageList(
                out allcount, table, fields : fields, where : where.Trim(),
                orderby : orderby, pageindex : search.CurrentPage, pagesize : search.PageSize, connect : DBKeys.PRX);

            return(new PagedList <vw_DailyReport>(list, search.CurrentPage, search.PageSize, allcount));
        }
Example #12
0
        /// <summary>
        /// 分页获取学生列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <vw_AttendanceRecord> ClasshourDetailedlist(ClasshourDetailedSearchModel search)
        {
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

            fields  = @"  * ";                                                                                //输出字段
            table   = @" vw_AttendanceRecord ";                                                               //表或者视图
            orderby = "ID";                                                                                   //排序信息
            StringBuilder sb = new StringBuilder();                                                           //构建where条件

            sb.Append(" 1=1  and AttendanceTypeID=2");

            if (!string.IsNullOrWhiteSpace(search.StudentID))//学号
            {
                sb.AppendFormat(" and  StudentID ='{0}' ", search.StudentID);
            }


            if (!string.IsNullOrWhiteSpace(search.ClassID))//班级ID
            {
                sb.AppendFormat(" and  ClassID ='{0}' ", search.ClassID);
            }
            where = sb.ToString();
            int allcount = 0;
            var list     = CommonPage <vw_AttendanceRecord> .GetPageList(
                out allcount, table, fields : fields, where : where.Trim(),
                orderby : orderby, pageindex : search.CurrentPage, pagesize : search.PageSize, connect : DBKeys.PRX);

            return(new PagedList <vw_AttendanceRecord>(list, search.CurrentPage, search.PageSize, allcount));
        }
Example #13
0
 public MainWindow()
 {
     InitializeComponent();
     mainFrame.NavigationUIVisibility = NavigationUIVisibility.Hidden;
     CommonPage       = new CommonPage();
     CommonPage.Title = "Home";
 }
Example #14
0
        /// <summary>
        ///
        /// </summary>
        protected override void ExecuteTestCase()
        {
            Reporter.Chapter.Title = "Clicks all the links in the webportal";
            Step = "Login into web portal application";
            CommonPage.NavigateTo(Driver, Reporter, Util.EnvironmentSettings["Server"]);
            CommonPage.Login(Driver, Reporter, UserName, Password);

            Step = "Select " + TestData["APPLICATIONNAME"] + " link from the navigation menu";
            CommonPage.SelectApplication(Driver, Reporter, TestData["APPLICATIONNAME"]);

            Step = "Assert page title of " + TestData["TITLE"] + "";
            CommonPage.AssertPageTitle(Driver, Reporter, TestData["TITLE"]);

            int menuCount = CommonPage.GetMenuCount(Driver, Reporter, TestData["APPLICATIONNAME"]);

            for (int menu = 1; menu <= menuCount; menu++)
            {
                MenuNames.Add(CommonPage.GetMenuNames(Driver, Reporter, menu));
            }

            Step = "Number of menu items in  " + "<b>" + TestData["APPLICATIONNAME"] + "</b>" + "menu is:" + menuCount + "";
            foreach (string menu in MenuNames)
            {
                Step = "Click on " + "<b>" + menu + "</b>" + " menu and click links under it";
                CommonPage.ClickAllSubMenusInMenu(Driver, Reporter, resultsPath, menu);
            }
        }
Example #15
0
        /// <summary>
        /// 分页获取课程列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <vw_Course> GetButtonList(CurriculumSearchModel search)
        {
            ///UPDATE TOP(1) [PRX].[dbo].[Course] SET [ID]='3', [CourseName]=N'绘画', [CoursePrice]='11.00', [StateID]='2', [Hours]='11', [Introduce]=N'没有介绍' WHERE ([ID]='3');
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

            fields  = @"  * ";                                                                                //输出字段
            table   = @" vw_Course ";                                                                         //表或者视图
            orderby = "ID";                                                                                   //排序信息
            StringBuilder sb = new StringBuilder();                                                           //构建where条件

            sb.Append(" 1=1 ");
            if (!string.IsNullOrWhiteSpace(search.CourseName))//按钮中文名称
            {
                sb.AppendFormat(" and CourseName like '%{0}%' ", search.CourseName);
            }

            if (!string.IsNullOrWhiteSpace(search.ComCode))//分校
            {
                sb.AppendFormat(" and ComCode = '{0}' ", search.ComCode);
            }

            where = sb.ToString();
            int allcount = 0;
            var list     = CommonPage <vw_Course> .GetPageList(
                out allcount, table, fields : fields, where : where.Trim(),
                orderby : orderby, pageindex : search.CurrentPage, pagesize : search.PageSize, connect : DBKeys.PRX);

            return(new PagedList <vw_Course>(list, search.CurrentPage, search.PageSize, allcount));
        }
Example #16
0
 public LoginTests()
 {
     url += "/login";
     driver.Navigate().GoToUrl(url);
     loginPageObject = new LoginPage(driver);
     commonPage      = new CommonPage(driver);
 }
Example #17
0
        /// <summary>
        /// 返回所有的市场资源/预约单信息   ,EnrollAuditList页面的 微信页面
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <vw_EnrollAudit> GetEnrollAuditInfo(EnrollAuditInfoSearchModel search)
        {
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

            fields  = @"  * ";                                                                                //输出字段
            table   = @" vw_EnrollAudit ";                                                                    //表或者视图
            orderby = "CreateTime desc";                                                                      //排序信息
            StringBuilder sb = new StringBuilder();                                                           //构建where条件

            sb.Append(" 1=1 ");
            if (!string.IsNullOrWhiteSpace(search.APID)) //判断值。
            {
                sb.AppendFormat(" and APID = '{0}' ", search.APID);
            }
            if (!string.IsNullOrWhiteSpace(search.DiscountID)) //判断值。
            {
                sb.AppendFormat(" and DiscountID = {0} ", search.DiscountID);
            }
            if (!string.IsNullOrWhiteSpace(search.StateID)) //判断值。
            {
                sb.AppendFormat(" and StateID = {0} ", search.StateID);
            }

            where = sb.ToString();
            int allcount = 0;
            var list     = CommonPage <vw_EnrollAudit> .GetPageList(
                out allcount, table, fields : fields, where : where.Trim(),
                orderby : orderby, pageindex : search.CurrentPage, pagesize : search.PageSize, connect : DBKeys.PRX);

            return(new PagedList <vw_EnrollAudit>(list, search.CurrentPage, search.PageSize, allcount));
        }
Example #18
0
        public static CommonPage GetPageRaw(string connStr,string sql,int pageIndex,int pageSize)
        {
            if (string.IsNullOrEmpty(connStr))
                connStr = GetConnectionStr();


        


            DBHandler db = DBHandlerFactory.GetHandler(connStr);
            db.CommandText = sql;
            db.CommandType = CommandType.Text;
            DataTable dt = db.ExecuteDataTable();

            CommonPage cp = new CommonPage();
            cp.RecordCount = db.TotalCount;

            int pg = 0;
            pg = cp.RecordCount / pageSize;

            if (cp.RecordCount % pageSize > 0)
            {
                pg++;
            }

            cp.PageCount = pg;

            cp.DataTable = dt;

            db.Close();

            return cp;
        }
Example #19
0
        internal void CompareSettingsErrorMessages()
        {
            collectionTitle.BlankValue();
            var sg          = new StringGenerator();
            var inputString = sg.AlphanumericString(8);

            payPalEmail.InputKey(inputString);
            OperatingSystem os  = Environment.OSVersion;
            PlatformID      pid = os.Platform;

            switch (pid)
            {
            case PlatformID.Win32NT:
            case PlatformID.Win32S:
            case PlatformID.Win32Windows:
            case PlatformID.WinCE:
                CommonPage commonPage = new CommonPage(Driver, _appSettings);
                commonPage.GenerateImage();
                uploadSignPhoto.ClickButton();
                commonPage.UploadPhoto();
                Wait.Seconds(2);
                Assert.AreEqual(signUploadError.GetElementValue(), ErrorMessages.SignUploadError, "Sign upload error is not as expected.");
                break;
            }
            Assert.Multiple(() =>
            {
                Assert.AreEqual(collectionTitleError.GetElementValue(), ErrorMessages.CollectionTitleError, "Collection title error is not as expected.");
                Assert.AreEqual(paypalEmailError.GetElementValue(), ErrorMessages.PaypalEmailError, "PayPal Email error is not as expected.");
            });
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     loader = new Loader();
     scripts = new CommonPage();
     if (IsPostBack)
         LoadGames();
 }
    private void Search(String searchTerm)
    {
        var first = true;
        var comma = "";
        var scripts = new CommonPage();
        var sqlString = String.Format("select Id, Name from avDBPlayer where name like '%{0}%' order by name", searchTerm.Replace("'", "''").Replace(";", "").Replace(":", "").Replace("drop", "").Replace("select","").Replace("truncate",""));
        SqlCommand command = new SqlCommand(sqlString, scripts.GetConnection());
        var reader = command.ExecuteReader();
        if (!reader.HasRows)
        {
            Response.Write("[\"(no players found)\"]");
        }
        else
        {
            Response.Write("[");
            while (reader.Read())
            {
                if (first)
                    comma = "";
                else
                    comma = ", ";

                Response.Write(String.Format("{1}{{\"label\":\"{0}\",\"value\":\"{2}\"}}", reader[1].ToString(), comma, reader[0].ToString()));

                first = false;
            }
            Response.Write("]");
        }
        reader.Close();
    }
Example #22
0
 public void SetUp()
 {
     driver     = Base.getDriver();
     loginPage  = new LoginPage(driver);
     homePage   = new HomePage(driver);
     commonPage = new CommonPage(driver);
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     scripts = new CommonPage();
     if(!IsPostBack)
         AppendDataToFilters();
     AppendDataToGrid();
 }
Example #24
0
        internal void UploadPhotos()
        {
            OperatingSystem os  = Environment.OSVersion;
            PlatformID      pid = os.Platform;

            switch (pid)
            {
            case PlatformID.Win32NT:
            case PlatformID.Win32S:
            case PlatformID.Win32Windows:
            case PlatformID.WinCE:
                CommonPage commonPage = new CommonPage(Driver, _appSettings);
                commonPage.GenerateImage();
                uploadCoverPhoto.ClickButton();
                commonPage.UploadPhoto();
                Wait.Seconds(2);
                uploadCoverPhoto.GetElement().ScrollDown();
                uploadProfilePhoto.Click();
                commonPage.UploadPhoto();
                Wait.Seconds(2);
                break;

            case PlatformID.Unix:
                break;

            default:
                Console.WriteLine("No Idea what I'm on!");
                break;
            }
        }
Example #25
0
        /// <summary>
        /// 分页获取按钮列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <SYSButton> GetButtonList(ButtonListSearchModel search)
        {
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

            fields  = @"  * ";                                                                                //输出字段
            table   = @" SYS_Button ";                                                                        //表或者视图
            orderby = "BTN_Id";                                                                               //排序信息
            StringBuilder sb = new StringBuilder();                                                           //构建where条件

            sb.Append(" 1=1 ");
            if (!string.IsNullOrWhiteSpace(search.BTN_Name)) //按钮中文名称
            {
                sb.AppendFormat(" and BTN_Name like '%{0}%' ", search.BTN_Name);
            }
            if (!string.IsNullOrWhiteSpace(search.BTN_Name_En))//城市
            {
                sb.AppendFormat(" and BTN_Name_En like '%{0}%' ", search.BTN_Name_En);
            }
            where = sb.ToString();
            int allcount = 0;
            var list     = CommonPage <SYSButton> .GetPageList(
                out allcount, table, fields : fields, where : where.Trim(),
                orderby : orderby, pageindex : search.CurrentPage, pagesize : search.PageSize, connect : DBKeys.PRX);

            return(new PagedList <SYSButton>(list, search.CurrentPage, search.PageSize, allcount));
        }
Example #26
0
        /// <summary>
        /// 分页获取时间段列表
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <DictionaryItem> GetDictionaryItemList(DictionaryItemSearchModel search)
        {
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

            fields  = @"  * ";                                                                                //输出字段
            table   = @" dictionaryItem ";                                                                    //表或者视图
            orderby = "CreateTime";                                                                           //排序信息
            StringBuilder sb = new StringBuilder();                                                           //构建where条件

            sb.Append(" 1=1 AND  DicTypeID=8 ");

            if (!string.IsNullOrWhiteSpace(search.DicItemName))//时间段填写的条件查询
            {
                sb.AppendFormat(" and DicItemName like '%{0}%' ", search.DicItemName);
            }
            if (!string.IsNullOrWhiteSpace(search.DicItemID))//时间段下拉框的条件查询
            {
                sb.AppendFormat(" and DicItemID = '{0}' ", search.DicItemID);
            }
            where = sb.ToString();
            int allcount = 0;
            var list     = CommonPage <DictionaryItem> .GetPageList(
                out allcount, table, fields : fields, where : where.Trim(),
                orderby : orderby, pageindex : search.CurrentPage, pagesize : search.PageSize, connect : DBKeys.PRX);

            return(new PagedList <DictionaryItem>(list, search.CurrentPage, search.PageSize, allcount));
        }
        protected override void ExecuteTestCase()
        {
            Reporter.Chapter.Title = "Verifying the functaionality of External Application Module";
            Step = "Login into Web Portal Application";
            CommonPage.NavigateTo(Driver, Reporter, Util.EnvironmentSettings["Server"]);
            CommonPage.Login(Driver, Reporter, UserName, Password);

            //Select Application from the menu popup.
            Step = "Select " + TestData["APPLICATIONNAME"] + " application from the menu popup.";
            CommonPage.SelectApplication(Driver, Reporter, TestData["APPLICATIONNAME"]);

            //Assert page title of the application.
            Step = "Assert Page Title of " + TestData["PAGETITLE"] + " the application";
            CommonPage.AssertPageTitle(Driver, Reporter, TestData["PAGETITLE"]);

            //Click submenu.

            for (int i = 0; i < menulist.Count; i++)
            {
                try
                {
                    Step = (i + 1) + ":" + " Click>>" + submenulist[i] + " in " + menulist[i] + " menu ";
                    //AmericaBestHomePage.ClickOnMenu(Driver, Reporter, menulist[i]);
                    CommonPage.ClickSubMenuLink(Driver, Reporter, menulist[i], submenulist[i], i, resultsPath);
                    while (isTrueBool)
                    {
                        if (AmericaBestHomePage.IsMenuAnExternalApplication(Driver, Reporter, submenulist[i]))
                        {
                            //Step = "Click " + externalapplicationmenulist[i] + " in " + submenulist[i] + " Menu";
                            //AmericaBestHomePage.ClickExternalApplicationMenu(Driver, Reporter, externalapplicationmenulist[i],i);
                            Step = "Click " + externalapplicationsubmenulist[i] + " in " + externalapplicationmenulist[i] + " External Application Menu";
                            AmericaBestHomePage.ClickExternalApplicationSubMenu(Driver, Reporter, externalapplicationmenulist[i], externalapplicationsubmenulist[i], i, resultsPath);
                        }
                        Step = "Enter Store Number and Click on Search Button";
                        StoreSchedulerPage.TypeStoreNumber(Driver, Reporter, TestData["STORENUMBER"]);
                        StoreSchedulerPage.ClickSearchButton(Driver, Reporter, resultsPath);
                        ClickOnResults();
                        Selenide.SwitchToDefaultContent(Driver);
                        if (submenulist.Count > i + 1)
                        {
                            isTrueBool = submenulist[i + 1].Equals(submenulist[i]);
                            i++;
                        }
                        else
                        {
                            isTrueBool = false;
                        }
                    }
                    i--;
                    isTrueBool = true;
                }
                catch (Exception ex)
                {
                    CommonPage.AcceptOrDissmissAlertIfPresent(Driver, Reporter);
                    CommonPage.AcceptErrorMessageIfPresent(Driver, Reporter, resultsPath);
                    CommonPage.CloseBrowserNewTab(Driver);
                }
            }
        }
Example #28
0
        public void WhenUserClickOnMyRentalsSubMenuOption()
        {
            //create the object of the CommonPage
            CommonPage pageTenants = new CommonPage();

            System.Threading.Thread.Sleep(2000);
            pageTenants.clickMyRentals();
        }
Example #29
0
 public ErrorSteps(IWebDriver driver, ExtentTest test, ScenarioContext scenarioContext)
 {
     _driver          = driver;
     _test            = test;
     _scenarioContext = scenarioContext;
     _commonPage      = new CommonPage(_driver, _test);
     _errorPage       = new ErrorPage(_driver, _test, _commonPage);
 }
        internal void SelectSubCategoryType(string subCategoryType)
        {
            DictionaryProperties.Details["SubCategoryType"] = subCategoryType;
            ElementLocatorExtensions.GetElementXpath(selectSubCatagotyTitle, subCategoryType).ClickButton();
            CommonPage commonPage = new CommonPage(Driver, _appSettings);

            commonPage.LoadingBar();
        }
Example #31
0
 public HomeSteps(IWebDriver driver, ExtentTest test, ScenarioContext scenarioContext)
 {
     _driver          = driver;
     _test            = test;
     _scenarioContext = scenarioContext;
     _commonPage      = new CommonPage(_driver, _test);
     _homePage        = new HomePage(_driver, _test, _commonPage);
 }
        public void Error()
        {
            var fileName = ScenarioContext.Current.ScenarioInfo.Title;

            if (ScenarioContext.Current.TestError != null)
            {
                CommonPage.TakeScreenShot(WebBrowser.Driver, fileName);
            }
        }
        internal void ClickAndUploadPhotos(string action)
        {
            CommonPage commonPage = new CommonPage(Driver, _appSettings);

            commonPage.GenerateImage();
            ElementLocatorExtensions.GetElementXpath(commonButton, action).Click();
            Wait.Seconds(2);
            commonPage.UploadPhoto();
        }
        protected override void ExecuteTestCase()
        {
            Reporter.Chapter.Title = "Verifying the functaionality of External Application Module";
            Step = "Login into Web Portal Application";
            CommonPage.NavigateTo(Driver, Reporter, Util.EnvironmentSettings["Server"]);
            CommonPage.Login(Driver, Reporter, UserName, Password);

            //Select Application from the menu popup.
            Step = "Select " + TestData["APPLICATIONNAME"] + " application from the menu popup";
            CommonPage.SelectApplication(Driver, Reporter, TestData["APPLICATIONNAME"]);

            //Assert page title of the application.
            Step = "Assert Page Title of " + TestData["PAGETITLE"] + " the application";
            CommonPage.AssertPageTitle(Driver, Reporter, TestData["PAGETITLE"]);

            //Click submenu.

            for (int i = 0; i < menulist.Count; i++)
            {
                try
                {
                    Step = (i + 1) + ":" + " Click " + submenulist[i] + " in " + menulist[i] + " menu ";
                    CommonPage.ClickSubMenuLink(Driver, Reporter, menulist[i], submenulist[i], i, resultsPath);
                    int count = 0;
                    while (isTrueBool && count < 3)
                    {
                        if (CommonPage.IsMenuAnExternalApplication(Driver, Reporter, submenulist[i]))
                        {
                            Step = "Click " + externalapplicationsubmenulist[i] + " in " + externalapplicationmenulist[i] + " External Application Menu";
                            CommonPage.ClickExternalApplicationSubMenu(Driver, Reporter, externalapplicationmenulist[i], externalapplicationsubmenulist[i], i, resultsPath);
                        }
                        Step = "Click add new button";
                        CommonPage.ClickAddNewButton(Driver, Reporter);
                        Step = "Close store popup window";
                        CommonPage.CloseStoreLocatorPopupWindow(Driver, Reporter, resultsPath);
                        isTrueBool = submenulist[i + 1].Equals(submenulist[i]);
                        i++;
                        count++;
                    }
                    i--;
                    isTrueBool = true;
                }
                catch (Exception ex)
                {
                    if (ex.Message.Contains("Unable to locate element"))
                    {
                        this.Reporter.Chapter.Step.Action.IsSuccess = false;
                        this.Reporter.Chapter.Step.Action.Extra     = "Exception Message : " + ex.Message + "<br/>" + ex.InnerException + ex.StackTrace;
                        break;
                    }
                    CommonPage.AcceptOrDissmissAlertIfPresent(Driver, Reporter);
                    CommonPage.AcceptErrorMessageIfPresent(Driver, Reporter, resultsPath);
                    CommonPage.CloseBrowserNewTab(Driver);
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
         return;
     Scripts = new CommonPage();
     if(!Scripts.GoodPassWord(Request["pwd"]))
     {
         WrongPassword.Visible = true;
         return;
     }
     InfoLabel.Text = "<div style=\"padding: 0 .7em;\" class=\"ui-state-highlight ui-corner-all\"><p><span style=\"float: left; margin-right: .3em;\" class=\"ui-icon ui-icon-warning\"></span>";
     SyncPlayerData();
     SyncGameData();
     SyncPlayerGameData();
     RegenTables();
     InfoLabel.Text += "</div>";
     InfoLabel.Visible = true;
 }
Example #36
0
 public Loader()
 {
     scripts = new CommonPage();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     scripts = new CommonPage();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     scripts = new CommonPage();
     player1Id = Convert.ToDouble(Request["Player1Id"]);
     player2Id = Convert.ToDouble(Request["Player2Id"]);
     statId = Convert.ToString(Request["stat"]);
     SetNames();
 }
Example #39
0
 private void LoadFromMySQL()
 {
     var Scripts = new CommonPage();
     var connection = Scripts.GetavDBConnection();
     var command = connection.CreateCommand();
     command.CommandText = String.Format("select * from avDBGames where id = {0}", Id);
      var Reader = command.ExecuteReader();
      while (Reader.Read())
      {
          Date = Convert.ToDateTime(Reader.GetValue(Reader.GetOrdinal("Date")));
      }
      connection.Close();
 }
 public PlayerHelper()
 {
     Scripts = new CommonPage();
 }
Example #41
0
 public GameHelper()
 {
     Scripts = new CommonPage();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     scripts = new CommonPage();
     playerId = Convert.ToDouble(Request["Id"]);
 }