Пример #1
0
        public IActionResult Index()
        {
            var page    = new ShopPage();
            var element = page.GetOouiElement();

            return(new ElementResult(element));
        }
Пример #2
0
        private void setPage(InteractivityResult <DSharpPlus.EventArgs.MessageReactionAddEventArgs> messageResult)
        {
            if (messageResult.TimedOut)
            {
                page = ShopPage.TimedOut;
                return;
            }

            switch (messageResult.Result.Emoji.GetDiscordName())
            {
            case ":crossed_swords:":
                page = ShopPage.Armory;
                break;

            case ":shield:":
                page = ShopPage.Buffs;
                break;

            case ":star:":
                page = ShopPage.Flair;
                break;

            case ":moneybag:":
                page = ShopPage.StoreFront;
                break;
            }
        }
Пример #3
0
        public void TestCase4()
        {
            try
            {
                //arrange
                var ItemsTobeAdded = new Dictionary <Product, int>();
                ItemsTobeAdded[Product.FunnyCow]    = 2;
                ItemsTobeAdded[Product.FluffyBunny] = 1;

                var homePage = new HomePage(Driver);
                homePage.GoTo();
                ShopPage shopPage = homePage.GoToShopPage();


                //act
                foreach (var keyValuePair in ItemsTobeAdded)
                {
                    shopPage.AddProductToCart(keyValuePair.Key, keyValuePair.Value);
                }

                CartPage cartPage = shopPage.GoToCartPage();

                //assert

                Assert.IsTrue(shopPage.compareDictionaries(ItemsTobeAdded, cartPage.ItemsPresentInCart()), "Items in the cart are not same as the items added");
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
Пример #4
0
 public void StartUp()
 {
     driver   = new FirefoxDriver();
     homePage = new HomePage(driver);
     shopPage = new ShopPage(driver);
     cartPage = new CartPage(driver);
 }
Пример #5
0
 private void ShopButton_Click(object sender, RoutedEventArgs e)
 {
     if (Client.IsLoggedIn)
     {
         var shopPage = new ShopPage();
         Client.SwitchPage(shopPage);
     }
 }
        public void BuyRocket(string rocketName, int quantity, string coupon = null)
        {
            Assert.IsNotNull(rocketName);
            Assert.AreNotEqual <int>(0, quantity);

            ShopPage page = new ShopPage(_driver);

            page.PurchaseRocket(rocketName);
        }
Пример #7
0
        private BillingDetailItem _billinInfo; //just one for testing

        public PurchaseWorkflow(IWebDriver driver)
        {
            _driver       = driver;
            _shopPage     = new ShopPage(driver);
            _cartPage     = new CartPage(driver);
            _checkoutPage = new CheckoutPage(driver);

            CreateBillingInfo();
        }
Пример #8
0
        public void TestCase4()
        {
            NavigationHelper.NavigatetoURL(ObjectRepo.config.GetWebsite());
            HomePage hpage = new HomePage(ObjectRepo.driver);
            ShopPage spage = hpage.ClickShop();

            spage.ClickFunnyCow();
            spage.ClickFunnyCow();
            spage.ClickFluffyBunny();
            CartPage cartpage = spage.ClickCart();

            cartpage.VerifyQuantity();
        }
Пример #9
0
        public void AddingItemtoCartTest()
        {
            shopPage = navBar.GetShopPage();
            shopPage.AddItemToTheCart("Funny Cow");
            shopPage.AddItemToTheCart("Funny Cow");
            shopPage.AddItemToTheCart("Bunny");
            //shopPage.ClickFunnyCowToBuy();
            //    shopPage.ClickBunnyoBuy();

            CartPage cartPage = navBar.GetCartPage();

            Assert.IsTrue(cartPage.GetItem("Funny Cow"));
            Assert.IsTrue(cartPage.GetItem("Bunny"));
        }
        // Constructor
        #region Constructor
        public GameDriver(Texture2D buttonTexture, SpriteFont font, Texture2D patientSprite, Texture2D userAvatarSprite, Dictionary <string, ShopItem> imagesDictionary, Texture2D sprite, PlayerManager playerManager)
        {
            ButtonTexture     = buttonTexture;
            Font              = font;
            PatientTexture    = patientSprite;
            UserAvatarTexture = userAvatarSprite;

            // Initialize all pages using assets provided
            mainMenuPage  = new MainMenu(ButtonTexture, Font);
            shopPage      = new ShopPage(ButtonTexture, Font, imagesDictionary, playerManager);
            customizePage = new CustomizePage(ButtonTexture, Font, imagesDictionary, sprite);
            statsPage     = new StatsPage(ButtonTexture, Font, playerManager);
            playPage      = new PlayPage(PatientTexture, ButtonTexture, Font);
        }
Пример #11
0
        public static void Setup()
        {
            var chromeOptions = new ChromeOptions();

            driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), chromeOptions);
            driver.Manage().Window.Maximize();
            driver.Navigate().GoToUrl("https://jupiter.cloud.planittesting.com/");
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(60);

            HomePage    = new HomePage(driver);
            ContactPage = new ContactPage(driver);
            ShopPage    = new ShopPage(driver);
            CartPage    = new CartPage(driver);

            timeStamp = GetTimestamp(DateTime.Now);
        }
Пример #12
0
    private void AddButtonListener(Transform head, int shopid)
    {
        ShopConfigInfo info = ConfigReader.ShopXmlInfoDict[shopid];

        List <int> items = new List <int>();

        for (int ct = 0; ct < PackageBtnCount; ct++)
        {
            int      ctt  = ct + 1;
            ShopPage page = (ShopPage)ctt;
            switch (page)
            {
            case PackageSelect.ShopPage.ShopPage1:
                items = info.un32ItemIDPage1;
                break;

            case PackageSelect.ShopPage.ShopPage2:
                items = info.un32ItemIDPage2;
                break;

            case PackageSelect.ShopPage.ShopPage3:
                items = info.un32ItemIDPage3;
                break;

            case PackageSelect.ShopPage.ShopPage4:
                items = info.un32ItemIDPage4;
                break;

            case PackageSelect.ShopPage.ShopPage5:
                items = info.un32ItemIDPage5;
                break;

            case PackageSelect.ShopPage.ShopPage6:
                items = UIShop.Instance.GetHeroRecommendEquip();
                break;
            }
            ButtonOnPress click = head.Find("Kind" + ctt.ToString()).GetComponent <ButtonOnPress>();
            if (items == null || items.Count == 0)
            {
                click.GetComponent <BoxCollider>().enabled = false;
                continue;
            }
            click.AddListener(ctt, KindSelectFunc, ButtonOnPress.EventType.PressType);
            PageButton.Add(click);
        }
    }
Пример #13
0
    public void PageButtonToggle(int index)
    {
        Page = (ShopPage)index;
        foreach (ButtonOnPress btn in PageButton)
        {
            if (btn.PrIe == index)
            {
                btn.transform.Find("SpriteSelect").gameObject.SetActive(true);
                continue;
            }
            btn.transform.Find("SpriteSelect").gameObject.SetActive(false);
        }

        BuyPackageItem buyPack = (BuyPackageItem)UIShop.Instance.ShopItemAll[UIShop.ShopSelectType.TypeBuy];

        buyPack.arrowUpDown[0].gameObject.SetActive(false);
        buyPack.arrowUpDown[1].gameObject.SetActive(true);
    }
        public void ShopPageModel()
        {
            ShopPage page = new ShopPage(_driver);

            page.AddFalcon9RocetToCart();
        }
Пример #15
0
 public async Task shopCommand(CommandContext commandContext)
 {
     page = ShopPage.StoreFront;
     await shopLoop(commandContext);
 }
Пример #16
0
 public static void Init(ShopPage page)
 {
     _page = page;
 }
Пример #17
0
 public void WhenIClickBuyButtonTimesOnFunnyCow(int times, string itemName)
 {
     ShopPage.FindAndClickBuyForItems(times, itemName);
 }
Пример #18
0
        /// <summary>
        /// 生成登录二维码
        /// </summary>
        public void GetQrCode()
        {
            string             cid   = CookieTool.GetCookieString("qrcodeid");
            int                id    = 0;
            string             url   = "";
            int                DT_id = ShopPage.GetDT();
            Lebi_weixin_qrcode model;

            int.TryParse(cid, out id);
            string where = "id='" + id + "'";
            if (DT_id > 0)
            {
                where += " and DT_id =" + DT_id + "";
            }
            model = B_Lebi_weixin_qrcode.GetModel(where);
            if (model == null)
            {
                model         = new Lebi_weixin_qrcode();
                model.User_id = CurrentUser.id;
                model.DT_id   = DT_id;
                B_Lebi_weixin_qrcode.Add(model);
                id = B_Lebi_weixin_qrcode.GetMaxId();
                CookieTool.SetCookieString("qrcodeid", id.ToString(), 60);
            }
            string token   = RequestTool.RequestString("token");
            string backurl = RequestTool.RequestString("url");

            backurl = HttpUtility.UrlDecode(backurl);
            if (EX_User.MD5(SYS.InstallCode + backurl) != token)
            {
                backurl = URL("P_Index", "");
            }

            if (backurl.Contains("?"))
            {
                backurl += "&qrcodeid=" + id;
            }
            else
            {
                backurl += "?qrcodeid=" + id;
            }
            backurl = HttpUtility.UrlEncode(backurl);
            url     = Shop.Platform.weixin.GetInstance(DT_id, CurrentSite).LoginURL(backurl);
            //QRCode.Instance.CreateImage(url, id.ToString());
            Bitmap image = QRCode.Instance.CreateImage(url);

            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            image.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
            Response.ClearContent();
            Response.ContentType = "image/Gif";
            Response.BinaryWrite(ms.ToArray());
            //删除60分钟前的二维码
            //string where = "datediff(n,Time_add,'" + System.DateTime.Now + "')>60";
            //List<Lebi_weixin_qrcode> qs = B_Lebi_weixin_qrcode.GetList(where, "");
            //foreach (Lebi_weixin_qrcode q in qs)
            //{
            //    ImageHelper.DeleteImage("/qrcode/" + q.id + ".png");
            //}
            //B_Lebi_weixin_qrcode.Delete(where);
            ////================
            //Response.Write("{\"msg\":\"OK\",\"img\":\"" + WebPath + "/qrcode/" + id + ".png\"}");
        }
        public ShopSteps(IContextManager contextManager)
        {
            var objectContainer = contextManager?.TestThreadContext.Get <IObjectContainer>("objectContainer");

            this.shopPage = contextManager?.TestThreadContext.Get <IObjectContainer>("objectContainer")?.Resolve <ShopPage>();
        }
Пример #20
0
        public void NavigateToShopPage()
        {
            ShopPage page = App.GoTo <ShopPage>();

            page.AddFalcon9RocetToCart();
        }
Пример #21
0
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            SystemLog.Add("api_weixin");
            if (!Check())
            {
                return;
            }
            try
            {
                //微信推送消息处理
                Shop.Platform.Model.weixin.wxmessage wx     = Shop.Platform.weixin.Instance.GetWxMessage();
                string    platform_weixin_subscribe_automsg = "";
                string    parentuserid = wx.EventKey.Replace("qrscene_", "");
                Lebi_User parentuser   = B_Lebi_User.GetModel("id=" + parentuserid + "");
                if (parentuser == null)
                {
                    parentuser = new Lebi_User();
                }
                int DT_id = ShopPage.GetDT();
                if (DT_id == 0)
                {
                    BaseConfig bcf = ShopCache.GetBaseConfig();
                    platform_weixin_subscribe_automsg = bcf.platform_weixin_subscribe_automsg;
                    if (parentuser != null)
                    {
                        DT_id = parentuser.DT_id;
                    }
                }
                else
                {
                    BaseConfig_DT bcf = ShopCache.GetBaseConfig_DT(DT_id);
                    platform_weixin_subscribe_automsg = bcf.platform_weixin_subscribe_automsg;
                }
                string res = "";
                if (!string.IsNullOrEmpty(wx.EventName) && wx.EventName.Trim() == "subscribe")//未关注情况下扫码的事件推送
                {
                    string content = "";
                    if (!wx.EventKey.Contains("qrscene_"))
                    {
                        content = platform_weixin_subscribe_automsg;
                        res     = Shop.Platform.weixin.Instance.sendTextMessage(wx, content);
                    }
                    else
                    {
                        //content = "二维码参数:\n" + wx.EventKey.Replace("qrscene_", "");
                        //res = Shop.Platform.weixin.Instance.sendTextMessage(wx, content);
                        content = platform_weixin_subscribe_automsg;
                        res     = Shop.Platform.weixin.Instance.sendTextMessage(wx, content);

                        parentuserid = wx.EventKey.Replace("qrscene_", "");
                        Lebi_User user = Shop.Platform.weixin.Instance.GetUserByopenid(wx.FromUserName, DT_id);
                        if (parentuser != null)
                        {
                            if (parentuser.id != user.id && user.User_id_parent == 0)
                            {
                                //生成上下级关系
                                user = B_Lebi_User.GetModel(user.id);
                                user.User_id_parent = parentuser.id;
                                user.DT_id          = DT_id;
                                B_Lebi_User.Update(user);
                            }
                        }
                    }
                    Shop.Platform.weixin.GetInstance(DT_id, null).GetUserByopenid(wx.FromUserName, DT_id);
                }
                else if (!string.IsNullOrEmpty(wx.EventName) && wx.EventName.ToLower() == "scan")//已经关注情况下扫码的事件推送
                {
                    Lebi_User user = Shop.Platform.weixin.Instance.GetUserByopenid(wx.FromUserName);
                    if (parentuser != null)
                    {
                        if (parentuser.id != user.id && user.User_id_parent == 0)
                        {
                            //生成上下级关系
                            user = B_Lebi_User.GetModel(user.id);
                            user.User_id_parent = parentuser.id;
                            user.DT_id          = DT_id;
                            B_Lebi_User.Update(user);
                        }
                    }

                    //string str = "二维码参数:\n" + wx.EventKey;
                    //res = Shop.Platform.weixin.Instance.sendTextMessage(wx, str);
                }
                else if (!string.IsNullOrEmpty(wx.EventName) && wx.EventName.Trim() == "CLICK")
                {
                    if (wx.EventKey == "HELLO")
                    {
                        res = Shop.Platform.weixin.Instance.sendTextMessage(wx, "你好,欢迎使用公共微信平台!");
                    }
                }
                else
                {
                    if (wx.MsgType == "text" && wx.Content == "你好")
                    {
                        res = Shop.Platform.weixin.Instance.sendTextMessage(wx, "你好,欢迎使用公共微信平台!");
                    }
                    //else if (wx.MsgType == "voice")
                    //{
                    //    res = Shop.Platform.weixin.Instance.sendTextMessage(wx, wx.Recognition);
                    //}
                    else
                    {
                        res = Shop.Platform.weixin.Instance.sendTextMessage(wx, "你好,未能识别消息!");
                    }
                }

                Response.Write(res);
            }
            catch
            {
            }
        }
Пример #22
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            pageindex = RequestTool.RequestInt("page", 1);
            LoadTheme(themecode, siteid, languagecode, pcode);
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_Product'");
            int id = Rint_Para("0");

            product = EX_Product.GetProduct(id);
            if (product.id == 0)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            int num = 0;
            int Count_Views_Show = 0;

            if (SYS.ClickFlag == "0")
            {
                int.TryParse(SYS.ClickNum1, out num);
                Count_Views_Show = num;
            }
            else
            {
                int.TryParse(SYS.ClickNum2, out num);
                Random r = new Random();
                int    c = r.Next(1, num);
                Count_Views_Show = c;
            }
            string sql = "update [Lebi_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where id=" + id + "";

            Common.ExecuteSql(sql);
            if (product.Product_id > 0)
            {
                sql = "update [Lebi_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where Product_id=" + product.Product_id + "";
                Common.ExecuteSql(sql);
            }
            int DT_id = ShopPage.GetDT();

            if (DT_id > 0)
            {
                sql = "update [Lebi_DT_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where DT_id = " + DT_id + " and Product_id=" + id + "";
                Common.ExecuteSql(sql);
                if (product.Product_id > 0)
                {
                    Common.ExecuteSql("update [Lebi_DT_Product] set Count_Views=Count_Views+1,Count_Views_Show=Count_Views_Show+" + Count_Views_Show + " where DT_id = " + DT_id + " and Product_id=" + product.Product_id + "");
                }
            }
            Protype = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id);
            images  = EX_Product.ProductImages(product, CurrentTheme);
            //===============================================================
            //处理规格选项
            //ProductProperty = Get_guige(product);
            //处理规格选项结束
            //==================================================================


            //添加访问记录
            int Product_id = product.Product_id == 0 ? product.id : product.Product_id;

            EX_User.UserProduct_Edit(CurrentUser, Product_id, 1, 143, "", 0, "");
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
            if (product.Type_id_ProductType == 321)
            {
                path += "<a href=\"" + URL("P_LimitBuy", "") + "\"><span>" + Tag("限时抢购") + "</span></a><em>&raquo;</em>";
            }
            else if (product.Type_id_ProductType == 322)
            {
                path += "<a href=\"" + URL("P_GroupPurchase", "") + "\"><span>" + Tag("团购") + "</span></a><em>&raquo;</em>";
            }
            else if (product.Type_id_ProductType == 323)
            {
                path += "<a href=\"" + URL("P_Exchange", "") + "\"><span>" + Tag("积分换购") + "</span></a><em>&raquo;</em>";
            }
            else
            {
                if (Protype != null)
                {
                    string[,] parr = Categorypath(Protype.id);
                    for (int i = 0; i <= parr.GetUpperBound(0); i++)
                    {
                        path += "<a href=\"" + URL("P_ProductCategory", "" + parr[i, 0] + "") + "\"><span>" + parr[i, 1] + "</span></a><em>&raquo;</em>";
                    }
                }
            }
            path += "<a href=\"" + URL("P_Product", id) + "\"><span>" + Lang(product.Name) + "</span></a>";


            GetProWords();
            ProductStar = Convert.ToInt32(product.Star_Comment);
            if (ProductStar > 5)
            {
                ProductStar = 5;
            }
            if (ProductStar < 0)
            {
                ProductStar = 0;
            }
        }
Пример #23
0
 private void Awake()
 {
     shopPage = this;
 }
Пример #24
0
 public ShopSteps(ShopPage shopPage, ScenarioContext scenarioContext)
 {
     _shopPage        = shopPage;
     _scenarioContext = scenarioContext;
 }
Пример #25
0
 public async Task BuffsCommand(CommandContext commandContext)
 {
     page = ShopPage.Buffs;
     await shopLoop(commandContext);
 }
Пример #26
0
 public async Task ArmoryCommand(CommandContext commandContext)
 {
     page = ShopPage.Armory;
     await shopLoop(commandContext);
 }
Пример #27
0
 public async Task FlairCommand(CommandContext commandContext)
 {
     page = ShopPage.Flair;
     await shopLoop(commandContext);
 }