public void Rule_Add_Delete_Response_News_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加1个图片素材");

            WeChatManagermentPage.GoTo_AutoReply_Page();
            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply);
            AutoReplyPage.TurnOnAutoReply();
            AutoReplyPage.ClearReply();
            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.AddAutoReply);
            var regulationTextes = PortalChromeDriver.GetElementByClassName(AutoReplyElement.RegulationText);

            regulationTextes.Clear();
            regulationTextes.SendKeys("这是rule");
            AutoReplyPage.AddTrigger(1 + "", 1 + "");

            AutoReplyPage.AddReply_News(1);
            Thread.Sleep(3 * 1000);
            PortalChromeDriver.TakeScreenShot(filePath, "添加1个图片素材");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.PicValidator1, "g"));

            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();
            Mobile_Weibo_Utility.ClearAllMessage();
            Mobile_Weibo_Utility.SendMessage("1");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerName("g"));

            filePath = PortalChromeDriver.CreateFolder(@"自动回复\删除图文");
            AutoReplyPage.DeletePicReply(1);
            PortalChromeDriver.TakeScreenShot(filePath, "删除图文");
            Assert.IsFalse(Utility.IsAt(AutoReplyElement.PicValidator, "g"));
        }
        public void Rule_Add_Response_Emoj_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加表情回复");

            WeChatManagermentPage.GoTo_AutoReply_Page();
            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply);
            AutoReplyPage.TurnOnAutoReply();
            AutoReplyPage.ClearReply();
            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.AddAutoReply);
            var regulationTextes = PortalChromeDriver.GetElementByClassName(AutoReplyElement.RegulationText);

            regulationTextes.Clear();
            regulationTextes.SendKeys("我是rule");
            AutoReplyPage.AddTrigger("我是trigger", 1 + "");
            AutoReplyPage.AddEmoj();
            PortalChromeDriver.TakeScreenShot(filePath, "添加表情回复");
            Assert.IsTrue(PortalChromeDriver.GetElementByXpath(AutoReplyElement.Emoj).GetAttribute("title") == "发红包啦");

            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();
            Mobile_Weibo_Utility.ClearAllMessage();
            Mobile_Weibo_Utility.SendMessage("我是trigger");
            MobileAndroidDriver.GetScreenshot(filePath, "添加表情回复");
            Assert.IsTrue(Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("[啊_荀] 说:"));
        }
        public void EditReply_AutoReply_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\编辑关键词回复");

            WeChatManagermentPage.GoTo_AutoReply_Page();
            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply);
            AutoReplyPage.TurnOnAutoReply();
            AutoReplyPage.ClearReply();
            AutoReplyPage.AddAutoReply("A", "Hi", "第一个自动回复");
            Thread.Sleep(2 * 1000);
            PortalChromeDriver.Refresh();
            AutoReplyPage.EditRule("修改的Rule");
            PortalChromeDriver.TakeScreenShot(filePath, "修改的Rule");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.RuleContent, "修改的Rule"));

            AutoReplyPage.EditTriger("修改的Trigger");
            PortalChromeDriver.TakeScreenShot(filePath, "修改的Trigger");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.TrigerContent.Replace("[{0}]", ""), "修改的Trigger"));

            AutoReplyPage.EditReply("修改的Reply");
            PortalChromeDriver.TakeScreenShot(filePath, "修改的Reply");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", ""), "修改的Reply"));

            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();
            Mobile_Weibo_Utility.ClearAllMessage();
            Mobile_Weibo_Utility.SendMessage("修改的Trigger");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerName("[啊_荀] 说:修改的Reply"));
        }
Ejemplo n.º 4
0
        public void Menu_NoMaterial_Tips()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\素材库没有素材,是否提示去微信后台添加");

            PortalChromeDriver.ClickElementPerXpath(MenuElement.Account_Arrow_Down);
            Thread.Sleep(5 * 1000);
            PortalChromeDriver.ClickElementPerXpath(MenuElement.Logout);
            LoginPage.LoginWithPhoneNumber("13269120258");
            Thread.Sleep(10 * 1000);

            MobileAndroidDriver.AndroidMmsInitialize();
            Mobile_WeChat_Utility.GetLoginCode();

            HomePage.ClickWeChatApp("不是衣橱的海南");
            WeChatManagermentPage.GoTo_Menu_Page();
            MenuPage.DeleteMenuItem();
            MenuPage.AddMenu("1");
            PortalChromeDriver.ClickElementPerXpath(MenuElement.Send_Message);
            PortalChromeDriver.ClickElementPerXpath(MenuElement.tabNews);
            PortalChromeDriver.ClickElementPerXpath(MenuElement.ImageChoose);
            //PortalChromeDriver.TakeScreenShot(filePath, "素材库没有素材,是否提示去微信后台添加");
            Thread.Sleep(2 * 1000);

            Assert.IsTrue(Utility.IsAt(MenuElement.NoMaterial_Tip, "没有同步到素材,请去往微信后台添加。新添加素材最多需15分钟同步到本地。"));
            //Assert.IsTrue(PortalChromeDriver.GetElementByClassName("menu_button menu_highlight").Text=="1");
        }
Ejemplo n.º 5
0
        public void Rename_OneLevelMenu()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\添加一级菜单中,是否可以删除已输入的菜单名称");

            //MenuPage.AddMenu("一级菜单");
            PortalChromeDriver.GetElementByXpath(MenuElement.add_menu_item_btn).Click();
            PortalChromeDriver.GetElementByXpath(MenuElement.MenuInputBox).SendKeys("一级菜单");
            PortalChromeDriver.GetElementByXpath(MenuElement.MenuInputBox).Clear();
            PortalChromeDriver.GetElementByXpath(MenuElement.MenuInputBox).SendKeys("菜单");
            PortalChromeDriver.GetElementByXpath(MenuElement.MenuAddConfirm).Click();
            MobileAndroidDriver.GetScreenshot(filePath, "添加一级菜单中,是否可以删除已输入的菜单名称");
            Assert.IsTrue(Utility.IsAt(MenuElement.addedMenu, "菜单"));

            filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\是否能成功重命名一级菜单的名称");
            MenuPage.RenameOneLevelMenu("一级");
            MobileAndroidDriver.GetScreenshot(filePath, "是否能成功重命名一级菜单的名称");
            Assert.IsFalse(Utility.IsAt(MenuElement.addedMenu, "一级菜单"));

            //MenuPage.AddMenu_Text("重命名的一级目录");
            PortalChromeDriver.ClickElementPerXpath(MenuElement.Send_Message);
            PortalChromeDriver.SendKeysPerXpath(MenuElement.TextInput, "重命名的一级目录");
            PortalChromeDriver.ClickElementPerXpath(MenuElement.bottom_save);
            PortalChromeDriver.ClickElementPerXpath(MenuElement.confirmbox_Cancle);
            Assert.IsFalse(Utility.IsAt(MenuElement.Notification, "保存成功"));
        }
        public void TurnOff_AutoReply_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\关键词自动回复Mobile可用");

            WeChatManagermentPage.GoTo_AutoReply_Page();
            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply);
            AutoReplyPage.TurnOnAutoReply();
            AutoReplyPage.ClearReply();
            AutoReplyPage.AddAutoReply("A", "怎么办", "我是美女");


            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();
            Mobile_Weibo_Utility.ClearAllMessage();
            Mobile_Weibo_Utility.SendMessage("怎么办");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerName("[啊_荀] 说:我是美女"));

            filePath = PortalChromeDriver.CreateFolder(@"自动回复\停用关键词回复Mobile无关键词回复");
            AutoReplyPage.TurnOffAutoReply();
            Mobile_WeChat_Utility.BackButtonClick();
            Mobile_Weibo_Utility.ClearAllMessage();
            Mobile_WeChat_Utility.SendMessage("怎么办");
            Thread.Sleep(2 * 1000);
            MobileAndroidDriver.GetScreenshot(filePath, "停用关键词回复Mobile无关键词回复");
            Assert.IsFalse(Mobile_WeChat_Utility.IsAtPerName("[啊_荀] 说:[我是美女]"));
        }
        public void FaceRanking_ChangeTheAverage_Weibo()
        {
            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();
            //拼颜值功能是否正常使用
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\12.检查多次上传测试后,平均值是否被拉高或拉低了");

            FaceRankingMobilePage_Weibo.ClickFaceRanking();
            double before1 = 0;
            double after1  = 0;
            double before2 = 0;
            double after2  = 0;
            double before3 = 0;
            double after3  = 0;

            FaceRankingMobilePage_Weibo.FaceRankingFromFile(SecretRelationshipTest.美女美女);
            FaceRankingMobilePage_WeChat.Getfraction(ref before1, ref after1);
            MobileAndroidDriver.GetScreenshot(filePath, "第一次上传");
            Mobile_Weibo_Utility.BackWards();
            MobileAndroidDriver.ClickElemnetPerName(FaceRankingMobileElement.Menuitem);
            FaceRankingMobilePage_Weibo.FaceRankingFromFile(SecretRelationshipTest.美女美女);
            FaceRankingMobilePage_WeChat.Getfraction(ref before2, ref after2);
            MobileAndroidDriver.GetScreenshot(filePath, "第二次上传");
            Mobile_Weibo_Utility.BackWards();
            MobileAndroidDriver.ClickElemnetPerName(FaceRankingMobileElement.Menuitem);
            FaceRankingMobilePage_Weibo.FaceRankingFromFile(SecretRelationshipTest.美女美女);
            FaceRankingMobilePage_WeChat.Getfraction(ref before3, ref after3);
            MobileAndroidDriver.GetScreenshot(filePath, "第三次上传");
            Assert.IsTrue(before1 <= after1 && before2 <= after2 && before3 <= after3);
            Assert.IsTrue(after1 == before2 && after2 == before3);
        }
        public void Can_Continue_Chat_PressHome()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            ////H5呼叫客服
            Mobile_WeChat_Utility.GetHiCard("客服");
            Mobile_WeChat_Utility.XB_SendMessage("我是客户测试账号");
            Thread.Sleep(2 * 1000);
            Mobile_WeChat_Utility.BackButtonClick();
            Thread.Sleep(2 * 1000);
            Mobile_WeChat_Utility.BackToHome();
            HIPage.OpenHiChatWindow();
            HIPage.SendMessage("这里是客服");
            Thread.Sleep(10 * 1000);
            Mobile_WeChat_Utility.OpenWeChatFromHome();
            Mobile_WeChat_Utility.ClickReplyCard();
            string foler = PortalChromeDriver.CreateFolder(@"HI\H5.30.按home键后,是否还能进入继续聊天(不停用微信进程)");

            MobileAndroidDriver.GetScreenshot(foler, "H5)");
            Assert.IsTrue(Mobile_WeChat_Utility.GetMessage("这里是客服"));
            Mobile_WeChat_Utility.BackButtonClick();
        }
        public void Can_EditTriger_InHI_ComeFirst()
        {
            string foler = PortalChromeDriver.CreateFolder(@"HI\19.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词内容与自定义关键词回复相同的内容时");

            LoginPage.GoTo();
            HomePage.ClickWeChatApp("平台测试账号2");
            //Go to AI AutoReply Page
            WeChatManagermentPage.GoTo_AutoReply_Page();
            //AutoReplyPage.TurnOnAutoReply();\
            AutoReplyPage.AddAutoReply("A", "Hi", "这里是自动回复");

            PortalChromeDriver.TakeScreenShot(foler, "添加自动回复关键词");
            WeChatManagermentPage.GoToHIPage();
            HIPage.ClickSettings();
            HIPage.SwichHISettingTab(HIPortalPageUIElement.SubTabHITrigger);
            HIPage.ClearTriggers();
            HIPage.InputTrigger("Hello");
            HIPage.EditTrigger("Hi");
            PortalChromeDriver.TakeScreenShot(foler, "编辑HITrigger");
            //Trigger Card In H5
            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //H5呼叫客服
            Mobile_WeChat_Utility.SendMessage("Hi");
            MobileAndroidDriver.GetScreenshot(foler, "19.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词内容与自定义关键词回复相同的内容时");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath), "编辑已有触发关键词后,HI触发关键词应优先");
        }
Ejemplo n.º 10
0
        public void EditReply_AutoReply()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\编辑关键词回复");

            AutoReplyPage.AddAutoReply("A", "Hi", "第一个自动回复");
            Thread.Sleep(2 * 1000);
            PortalChromeDriver.Refresh();
            AutoReplyPage.EditRule("修改的Rule");
            PortalChromeDriver.TakeScreenShot(filePath, "修改的Rule");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.RuleContent, "修改的Rule"));

            AutoReplyPage.EditTriger("修改的Trigger");
            PortalChromeDriver.TakeScreenShot(filePath, "修改的Trigger");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.TrigerContent.Replace("[{0}]", ""), "修改的Trigger"));

            AutoReplyPage.EditReply("修改的Reply");
            PortalChromeDriver.TakeScreenShot(filePath, "修改的Reply");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", ""), "修改的Reply"));

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.SendMessage("修改的Trigger");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(!Mobile_WeChat_Utility.GetLatestMessage("修改的Reply"));
        }
        public void TriggerHiCardAfterEditTriger()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            HIPage.ClearTriggers();
            #region 修改设置好的关键词
            HIPage.InputTrigger("Hi");
            HIPage.EditTrigger("append");
            HIPage.ClickSomewhereToSave();
            #endregion

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            //H5呼叫客服
            Mobile_WeChat_Utility.SendMessage("append");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath));

            Mobile_WeChat_Utility.ClearAllRecord();
            Thread.Sleep(5 * 1000);
            Mobile_WeChat_Utility.SendMessage("Hi");
            Thread.Sleep(5 * 1000);
            string foler = PortalChromeDriver.CreateFolder(@"HI\H5.4.修改设置好的关键词后,能否正常触发人工客服card");
            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsFalse(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath));
        }
        public void Can_secretRelationship_NoneHuman_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"关系识别\18.在没有设置奖项的情况下上传一张非人物图片");

            //设置奖励中奖概率
            PortalChromeDriver.ClickElementPerXpath(secretRelationshipElement.RewartSetting);
            SecretRelationshipPage.ClearAllAward();

            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();

            FaceRankingMobilePage_Weibo.ClickFaceRanking();
            FaceRankingMobilePage_Weibo.FaceRankingFromFile("mmexport1489570865737.jpg");
            Thread.Sleep(5 * 1000);

            MobileAndroidDriver.GetScreenshot(filePath, "图片显示是否正确");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "图片显示描述语是否正确");
            Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow("啊_荀"), "公众号名称是否正确显示");
            Assert.IsFalse(Mobile_WeChat_Utility.IsAtPerXpath(secretRelationshipElement.H5Reward_Resource_id), "奖励是否显示");

            //设置中奖概率
            SecretRelationshipPage.ClearAllAward();
            SecretRelationshipPage.CheckAward(secretRelationshipElement.Award.Replace("{0}", "1"), "100", "100");

            FaceRankingMobilePage_WeChat.FaceRankingFromFile("mmexport1489570865737.jpg");
            Thread.Sleep(5 * 1000);
            filePath = PortalChromeDriver.CreateFolder(@"关系识别\37.在设置奖项的情况下上传一张非人物图片");
            MobileAndroidDriver.GetScreenshot(filePath, "图片显示是否正确");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "图片显示描述语是否正确");
            Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow("啊_荀"), "公众号名称是否正确显示");
            Assert.IsFalse(Mobile_WeChat_Utility.IsAtPerXpath(secretRelationshipElement.H5Reward_Resource_id), "奖励是否显示");
        }
        public void Is_Big_MsgTip_ShowUp()
        {
            PortalChromeDriver.CreateFolder(@"HI\59.[对话窗口]是否有新消息提示标识显示,当开启人工客服后有消息接入_客户H5发送消息");
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //H5呼叫客服
            Mobile_WeChat_Utility.GetHiCard("客服");
            //H5用户发送消息
            Mobile_WeChat_Utility.XB_SendMessage("这里是测试账号");
            Mobile_WeChat_Utility.XB_SendMessage("这里是测试账号");

            MobileAndroidDriver.GetScreenshot(foler, "客户H5发送消息");
            Mobile_WeChat_Utility.BackButtonClick();
            Thread.Sleep(5 * 1000);
            PortalChromeDriver.TakeScreenShot(foler, "59.[对话窗口]是否有新消息提示标识显示,当开启人工客服后有消息接入");
            PortalChromeDriver.CreateFolder(@"HI\61.是否可以显示大红点,当不在人工对话栏并有新消息接入时");
            PortalChromeDriver.TakeScreenShot(foler, "61.是否可以显示大红点,当不在人工对话栏并有新消息接入时");
            Assert.IsTrue(HIPage.Is_Big_New_Msg_Tip());
            //点击人工客服之后 大红点消失
            HIPage.HiChatPoartal();
            Assert.IsFalse(HIPage.Is_Big_New_Msg_Tip());
        }
        public void Can_Staff_CheckReply_FromCustomer()
        {
            string foler = PortalChromeDriver.CreateFolder(@"HI\43.客服是否可以正常回复收到的用户消息");

            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //H5呼叫客服
            Mobile_WeChat_Utility.GetHiCard("客服");
            //H5用户发送消息
            Mobile_WeChat_Utility.XB_SendMessage("这里是测试账号");

            //Portal客服打开Hi对话窗口
            HIPage.OpenHiChatWindow();
            //点击测试账号
            HIPage.GetTestUserFromUserList();
            //客服发送消息
            HIPage.SendMessage("这里是客服");
            //验证Portal最后一条消息是不是客服回复的消息

            PortalChromeDriver.TakeScreenShot(foler, "Portal");
            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(string.Format(HIMobileH5Element.ReplyFromHi, "这里是客服")));
            Mobile_WeChat_Utility.ClickReplyCard();
        }
        public void Can_secretRelationship_Couple_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"关系识别\20.是否可以获得“公众号最亲密恋人”奖项");

            //设置奖励中奖概率
            PortalChromeDriver.ClickElementPerXpath(secretRelationshipElement.RewartSetting);
            SecretRelationshipPage.ClearAllAward();
            //设置
            SecretRelationshipPage.CheckAward(secretRelationshipElement.Award.Replace("{0}", "1"), "100", "100");

            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();

            ChoosePhotoAndCheck(美男美女);
            MobileAndroidDriver.GetScreenshot(filePath, "美男美女_公众号最亲密恋人");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "图片显示描述语是否正确");
            Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow("啊_荀"), "公众号名称是否正确显示");
            //Assert.IsTrue(MobileAndroidDriver.IsAt(secretRelationshipElement.H5Reward_Resource_id,"reward_25_1"), "奖励是否显示");

            FaceRankingMobilePage_Weibo.FaceRankingFromFile(一男一女);
            MobileAndroidDriver.GetScreenshot(filePath, "一男一女_公众号最亲密恋人");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "图片显示描述语是否正确");
            Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow("啊_荀"), "公众号名称是否正确显示");
            //Assert.IsTrue(MobileAndroidDriver.IsAt(secretRelationshipElement.H5Reward_Resource_id, "reward_25_1"), "奖励是否显示");

            //ChoosePhotoAndCheck(丑男丑女);
            //MobileAndroidDriver.GetScreenshot(filePath, "丑男丑女_公众号最亲密恋人");
            //Assert.IsTrue(MobileH5.IsAtPerXpath(CSH5.UIElement.FaceRankingMobileElement.Comment), "图片显示描述语是否正确");
            //Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow(), "公众号名称是否正确显示");
            //Assert.IsTrue(MobileAndroidDriver.IsAt(secretRelationshipElement.H5Reward_Resource_id, "reward_25_1"), "奖励是否显示");
        }
        public void Can_secretRelationship_TravelPartners_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"关系识别\是否可以获得“公众号最佳旅行拍档”奖项");

            //设置奖励中奖概率
            PortalChromeDriver.ClickElementPerXpath(secretRelationshipElement.RewartSetting);
            SecretRelationshipPage.ClearAllAward();
            SecretRelationshipPage.CheckAward(secretRelationshipElement.Award.Replace("{0}", "8"), "100", "100");

            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();

            ChoosePhotoAndCheck(美女美女);

            MobileAndroidDriver.GetScreenshot(filePath, "美女美女公_众号最高颜值组合图片");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "图片显示描述语是否正确");
            Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow("啊_荀"), "公众号名称是否正确显示");
            //Assert.IsTrue(MobileAndroidDriver.IsAt(secretRelationshipElement.H5Reward_Resource_id, "reward_25_7"), "奖励是否显示");
            //Assert.IsTrue(MobileAndroidDriver.IsAt(secretRelationshipElement.H5Reward_Resource_id), "奖励是否显示");

            //FaceRankingH5Page.FaceRankingFromFile(美男美女);
            //Thread.Sleep(1 * 1000);
            //MobileAndroidDriver.GetScreenshot(filePath, "图片显示是否正确");
            //Assert.IsTrue(HIMobileH5.IsAtPerXpath(CSH5.UIElement.FaceRankingH5Element.Comment), "图片显示描述语是否正确");
            //Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow(), "公众号名称是否正确显示");
            ////Assert.IsTrue(MobileAndroidDriver.IsAt(secretRelationshipElement.H5Reward_Resource_id, "reward_25_7"), "奖励是否显示");

            //FaceRankingH5Page.FaceRankingFromFile(美男美男);
            //Thread.Sleep(1 * 1000);
            //MobileAndroidDriver.GetScreenshot(filePath, "图片显示是否正确");
            //Assert.IsTrue(HIMobileH5.IsAtPerXpath(CSH5.UIElement.FaceRankingH5Element.Comment), "图片显示描述语是否正确");
            //Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow(), "公众号名称是否正确显示");
            ////Assert.IsTrue(MobileAndroidDriver.IsAt(secretRelationshipElement.H5Reward_Resource_id, "reward_25_7"), "奖励是否显示");
        }
Ejemplo n.º 17
0
        public void Rule_Add_Delete_Response_News()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加1个图片素材");

            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.AddAutoReply);
            var regulationTextes = PortalChromeDriver.GetElementByClassName(AutoReplyElement.RegulationText);

            regulationTextes.Clear();
            regulationTextes.SendKeys("这是rule");
            AutoReplyPage.AddTrigger("abc" + "", 1 + "");

            AutoReplyPage.AddReply_News(1);
            Thread.Sleep(3 * 1000);
            PortalChromeDriver.TakeScreenShot(filePath, "添加1个图片素材");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.PicValidator1, "关于“东方万里行” 相关问题"));

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.SendMessageWithMenu("abc");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerName("关于“东方万里行” 相关问题"));

            filePath = PortalChromeDriver.CreateFolder(@"自动回复\删除图文");
            AutoReplyPage.DeletePicReply(1);
            PortalChromeDriver.TakeScreenShot(filePath, "删除图文");
            Assert.IsFalse(Utility.IsAt(AutoReplyElement.PicValidator, "关于“东方万里行” 相关问题"));
        }
        public void FaceRanking_ChangeTheAverage()
        {
            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.FollowWeChatOffcialAccount();
            FaceRankingMobilePage_WeChat.ClickFaceRanking();
            double before1  = 0;
            double after1   = 0;
            double before2  = 0;
            double after2   = 0;
            double before3  = 0;
            double after3   = 0;
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\12.检查多次上传测试后,平均值是否被拉高或拉低了");

            FaceRankingMobilePage_WeChat.FaceRankingFromFile(SecretRelationshipTest.美女美女);
            FaceRankingMobilePage_WeChat.Getfraction(ref before1, ref after1);
            MobileAndroidDriver.GetScreenshot(filePath, "第一次上传");
            FaceRankingMobilePage_WeChat.BackWards();
            FaceRankingMobilePage_WeChat.ClickFaceRanking();
            FaceRankingMobilePage_WeChat.FaceRankingFromFile(SecretRelationshipTest.美女美女);
            FaceRankingMobilePage_WeChat.Getfraction(ref before2, ref after2);
            MobileAndroidDriver.GetScreenshot(filePath, "第二次上传");
            FaceRankingMobilePage_WeChat.BackWards();
            FaceRankingMobilePage_WeChat.ClickFaceRanking();
            FaceRankingMobilePage_WeChat.FaceRankingFromFile(SecretRelationshipTest.美女美女);
            FaceRankingMobilePage_WeChat.Getfraction(ref before3, ref after3);
            MobileAndroidDriver.GetScreenshot(filePath, "第三次上传");
            Assert.IsTrue(before1 <= after1 && before2 <= after2 && before3 <= after3);
            Assert.IsTrue(after1 == before2 && after2 == before3);
        }
Ejemplo n.º 19
0
        public void FollowedAutoReply_AddText_BVT_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\添加文字关键词回复");

            FollowedAutoReplyPage.AddAutoReplyText("hello,谢谢关注");
            Thread.Sleep(2 * 1000);
            PortalChromeDriver.TakeScreenShot(filePath, "Portal添加一条回复");
            Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedAutoReply, "hello,谢谢关注"));

            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.UnFollow();
            Mobile_Weibo_Utility.Follow();
            MobileAndroidDriver.GetScreenshot(filePath, "Mobile端check");
            Assert.IsTrue((Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("hello,谢谢关注")));

            FollowedAutoReplyPage.AddAutoReplyText("我是更改的文字回复");
            Thread.Sleep(2 * 1000);
            PortalChromeDriver.TakeScreenShot(filePath, "Portal修改文字回复");
            Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedAutoReply, "我是更改的文字回复"));

            FollowedAutoReplyPage.Delete();
            Thread.Sleep(2 * 1000);
            PortalChromeDriver.TakeScreenShot(filePath, "Portal删除一条回复");
            Assert.IsFalse(Utility.IsAt(FollowedAutoReplyElement.AddedAutoReply, "我是更改的文字回复"));
        }
        public void CheckReplyBackFromHI_NotInH5()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //Thread.Sleep(5*1000);
            //H5呼叫客服
            Mobile_WeChat_Utility.GetHiCard("客服");
            Mobile_WeChat_Utility.XB_SendMessage("这里是测试账号");

            //退出当前对话窗口
            Mobile_WeChat_Utility.BackButtonClick();

            //Portal端客服回复
            HIPage.OpenHiChatWindow();
            HIPage.GetTestUserFromUserList();
            Thread.Sleep(90 * 1000);
            Mobile_WeChat_Utility.SendMessage("a");
            Thread.Sleep(10 * 1000);;
            HIPage.SendMessage("这里是客服");
            Thread.Sleep(2 * 1000);
            //验证最后一条消息是不是客服回复的消息
            string foler = PortalChromeDriver.CreateFolder(@"HI\H5.11.当用户不在H5对话窗口时, 是否可以收到客服的回复");

            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.ReplyCardFromHI));
            Mobile_WeChat_Utility.ClickReplyCard();
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(string.Format(HIMobileH5Element.ReplyFromHi, "这里是客服")));
            Mobile_WeChat_Utility.BackButtonClick();
        }
Ejemplo n.º 21
0
        public void FollowedAutoReply_Add_Delete_Edit_Image_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\添加图片回复");

            FollowedAutoReplyPage_Weibo.AddAutoReplyImage("Capture.PNG");
            PortalChromeDriver.TakeScreenShot(filePath, "添加");
            Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedImage, "Capture.PNG"));

            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.UnFollow();
            Mobile_Weibo_Utility.Follow();
            MobileAndroidDriver.GetScreenshot(filePath, "Mobile端check");
            Assert.IsTrue(MobileAndroidDriver.IsAt("//android.widget.ImageView[contains(@resource-id,'com.sina.weibo:id/message_pic_shadow')]"));

            filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\删除图片回复");
            FollowedAutoReplyPage.Delete_Image();
            PortalChromeDriver.TakeScreenShot(filePath, "删除图片回复");
            Assert.IsFalse(Utility.IsAt(FollowedAutoReplyElement.AddedImage, "Capture.PNG"), "删除图片");

            filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\修改图片回复");
            FollowedAutoReplyPage_Weibo.AddAutoReplyImage("efwe.jpg");
            Thread.Sleep(2 * 1000);
            PortalChromeDriver.TakeScreenShot(filePath, "修改图片回复");
            Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedImage, "efwe.jpg"), "修改图片");
        }
Ejemplo n.º 22
0
        public void FollowedAutoReply_Add_Delete_Edit_Image()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\添加图片回复");

            FollowedAutoReplyPage.AddAutoReplyImage(FollowedAutoReplyElement.ImageChoose);
            PortalChromeDriver.TakeScreenShot(filePath, "添加");
            Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedImage, "u=115503548,1566568049&fm=23&gp=0.jpg"));

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.UnFollowWeChatOffcialAccount();
            Mobile_WeChat_Utility.FollowWeChatOffcialAccount();
            Thread.Sleep(5 * 1000);
            Assert.IsTrue(MobileAndroidDriver.IsAt("//android.widget.FrameLayout[contains(@resource-id,'com.tencent.mm:id/a4w')]"), "添加第一页图片");

            filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\删除图片回复");
            FollowedAutoReplyPage.Delete();
            PortalChromeDriver.TakeScreenShot(filePath, "删除图片回复");
            Assert.IsFalse(Utility.IsAt(FollowedAutoReplyElement.AddedImage, "u=115503548,1566568049&fm=23&gp=0.jpg"), "删除图片");

            filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\修改图片回复");
            FollowedAutoReplyPage.AddAutoReplyImage(FollowedAutoReplyElement.EditImage);
            Thread.Sleep(2 * 1000);
            PortalChromeDriver.TakeScreenShot(filePath, "修改图片回复");
            Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedImage, "1114.png"), "修改图片");
        }
Ejemplo n.º 23
0
 public void ChitChatSkill_BedTime_Story()
 {
     MobileAndroidDriver.AndroidInitialize();
     Mobile_WeChat_Utility.GetToTestAccount();
     Mobile_WeChat_Utility.ClearAllRecord();
     Mobile_WeChat_Utility.SendMessage("讲个税前故事");
     Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage(null));
 }
Ejemplo n.º 24
0
 public void LoginWith_PhoneNumber()
 {
     LoginPage.LoginWithPhoneNumber("13269120258");
     Thread.Sleep(10 * 1000);
     MobileAndroidDriver.AndroidMmsInitialize();
     Mobile.Mobile_WeChat_Utility.GetLoginCode();
     PortalChromeDriver.TakeScreenShot("手机号码获取登陆密码进行登陆");
     Assert.IsTrue(Utility.IsAt("/html/body/div/div[2]/div/div[1]/div/div[2]/a/span", "添加账号"));
 }
        public void Can_secretRelationship_1_100_DiffPhoto_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"关系识别\32.只选中任一一个奖项后,上传一张跟该奖项无关的人物图片,是否会中奖(所有奖项都试一遍)");

            for (int i = 1; i < 8; i++)
            {
                WeChatManagermentPage.GoToCS_Skill_Page();
                SecretRelationshipPage.ClickSecretRelationship();
                SecretRelationshipPage.TurnOn();
                //设置奖励中奖概率
                PortalChromeDriver.ClickElementPerXpath(secretRelationshipElement.RewartSetting);
                SecretRelationshipPage.ClearAllAward();
                SecretRelationshipPage.CheckAward(secretRelationshipElement.Award.Replace("{0}", i + ""), "1", "100");

                MobileAndroidDriver.AndroidInitialize_Weibo();
                Mobile_Weibo_Utility.Follow();
                string file = string.Empty;
                switch (i)
                {
                case 1:
                    file = 美女美女;
                    break;

                case 2:
                    file = 美男美女;
                    break;

                case 3:
                    file = 美男美女;
                    break;

                case 4:
                    file = 美男美女;
                    break;

                case 5:
                    file = 美男美女;
                    break;

                case 6:
                    file = 美男美女;
                    break;

                case 7:
                    file = 小孩小孩;
                    break;
                }
                //上传不同图片
                FaceRankingMobilePage_WeChat.FaceRankingFromFile(file);
                MobileAndroidDriver.GetScreenshot(filePath, file + i);
                Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "图片显示描述语是否正确");
                Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow("啊_荀"), "公众号名称是否正确显示");
                Assert.IsFalse(MobileAndroidDriver.IsAt(secretRelationshipElement.H5Reward_Resource_id, "reward_25_" + i), "奖励是否显示");
                MobileAndroidDriver.androidDriver.Dispose();
            }
        }
        public void SecretRelationship_Unbind_WeiBo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\检查在没有关闭拼颜值功能的情况下,解绑小冰该功能是否被关闭");

            LoginPage_Weibo.Unbundling();
            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();
            Mobile_Weibo_Utility.SendMessage("关系识别");
            Assert.IsTrue(Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("关系识别"));
        }
        public void FaceRanking_Trigger_WeiBo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\检查输入以下trigger,是否会触发拼颜值功能:");

            Utility.TurnOff();
            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();
            Mobile_Weibo_Utility.SendMessage("拼颜值");
            Assert.IsTrue(Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("关闭"));
        }
 public void LoginWith_Inner_AddWeibo()
 {
     LoginPage_Weibo.Unbundling();
     MobileAndroidDriver.AndroidMmsInitialize();
     LoginPage.LoginWithPhoneNumber("13269120258");
     Thread.Sleep(10 * 1000);
     Mobile.Mobile_WeChat_Utility.GetLoginCode();
     LoginPage_Weibo.AddWeiboAccount();
     PortalChromeDriver.TakeScreenShot("手机号码获取登陆密码进行登陆");
     Assert.IsTrue(LoginPage_Weibo.GetApp("啊_荀"));
 }
        public void FaceRanking_NoneHuman()
        {
            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.FollowWeChatOffcialAccount();
            FaceRankingMobilePage_WeChat.ClickFaceRanking();
            FaceRankingMobilePage_WeChat.FaceRankingFromFile("mmexport1489570865737.jpg");
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\11.检查上传非人物图片的效果");

            MobileAndroidDriver.GetScreenshot(filePath, "11.检查上传非人物图片的效果");
            Assert.IsFalse(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment, "公众号颜值"), "Comment不出现评分");
        }
        public void FaceRanking_Trigger()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\检查输入以下trigger,是否会触发拼颜值功能:");

            Utility.TurnOff();
            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.FollowWeChatOffcialAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessageWithMenu("拼颜值");
            Thread.Sleep(2 * 1000);
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("关闭"));
        }