Example #1
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 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 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 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"));
        }
Example #5
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 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_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触发关键词应优先");
        }
        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();
        }
        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");
        }
        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"), "奖励是否显示");
        }
        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));
        }
Example #13
0
        public void FollowedAutoReply_AddText_BVT()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\添加文字关键词回复");

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

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.UnFollowWeChatOffcialAccount();
            Mobile_WeChat_Utility.FollowWeChatOffcialAccount();
            MobileAndroidDriver.GetScreenshot(filePath, "Mobile端check");
            Assert.IsTrue((Mobile_WeChat_Utility.GetLatestMessage("hello,谢谢关注")));
            Mobile_WeChat_Utility.BackButtonClick();

            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 Check_Bind_CodeAvailable()
        {
            PortalChromeDriver.CreateFolder(@"HI\31.[客服人员设定]是否可以正常使用,当登陆密码有效期内(首次绑定)");
            //确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            //切换到Hi的设置Tab页
            HIPage.SwichHISettingTab(HIPortalPageUIElement.SubTabHIStaff);
            //判断是否已经绑定客服,如果绑定,则删除客服
            HIPage.DeleteStaff();
            //获取绑定客服验证码
            var value = HIPage.GetLoginCode();

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //删除聊天记录
            Mobile_WeChat_Utility.ClearAllRecord();
            //发送验证码
            Mobile_WeChat_Utility.SendMessage(value);
            //验证网页版是否成功绑定
            Assert.IsTrue(!HIPage.IsStaffBindOnPortal());

            //验证Mobile是否有绑定成功提示
            PortalChromeDriver.TakeScreenShot(foler, "验证过期验证码是否能正常使用");
            Assert.IsTrue(Mobile_WeChat_Utility.IsStaffBind());

            Mobile_WeChat_Utility.SendMessage(value);
            Assert.IsFalse(Mobile_WeChat_Utility.GetLatestMessage("客服接入成功"));
        }
Example #15
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"), "修改图片");
        }
        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 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);
        }
        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 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"));
        }
Example #20
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));
 }
        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 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_Celebrity()
        {
            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.FollowWeChatOffcialAccount();
            FaceRankingMobilePage_WeChat.ClickFaceRanking();
            FaceRankingMobilePage_WeChat.FaceRankingFromFile("mmexport1489570800142.jpg");
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\9.检查上传明星图片的效果");

            MobileAndroidDriver.GetScreenshot(filePath, "9.检查上传明星图片的效果");

            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment, "杨洋"), "未显示明星名字,当前case为林丹");
        }
        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("关闭"));
        }
        public void FaceRanking_Celebrity_Weibo()
        {
            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();
            //拼颜值功能是否正常使用
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\5.检查在手机端”拼颜值“功能是否可以正常使用");

            FaceRankingMobilePage_Weibo.ClickFaceRanking();
            FaceRankingMobilePage_Weibo.FaceRankingFromFile("mmexport1489570800142.jpg");
            MobileAndroidDriver.GetScreenshot(filePath, "图片显示描述语");

            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment, "杨洋"), "未显示明星名字,当前case为林丹");
        }
        public void FaceRanking_NoneHuman_Weibo()
        {
            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();
            //拼颜值功能是否正常使用
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\5.检查在手机端”拼颜值“功能是否可以正常使用");

            FaceRankingMobilePage_Weibo.ClickFaceRanking();
            FaceRankingMobilePage_Weibo.FaceRankingFromFile("mmexport1489570865737.jpg");
            MobileAndroidDriver.GetScreenshot(filePath, "图片显示描述语");

            Assert.IsFalse(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment, "公众号颜值"), "Comment不出现评分");
        }
        public void AddOneLevelMenu_Text()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\添加一级菜单_文本");

            MenuPage.AddMenu("一");
            MenuPage.AddMenu_Text("这里是一级菜单");
            Thread.Sleep(300 * 1000);
            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClickFirstLevelMenu("一");
            MobileAndroidDriver.GetScreenshot(filePath, "是否能成功添加一个一级菜单_文本");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessageWithMenu().Text == "这里是一级菜单");
        }
Example #28
0
        public void Rule_Fuzzy_Matching()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\模糊匹配");

            AutoReplyPage.AddAutoReply_Fuzzy_Matching("A", "abcdef", "我不是素材");

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessageWithMenu("abcdef123");
            Thread.Sleep(2 * 1000);
            MobileAndroidDriver.GetScreenshot(filePath, "模糊匹配");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("我不是素材"));
        }
Example #29
0
        public void Rule_Trigger_SameWith_Material()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\如果设置关键词的内容跟素材的名称一致,优先回复关键词");

            AutoReplyPage.AddAutoReply("A", "jdw", "我不是素材");
            PortalChromeDriver.TakeScreenShot(filePath, "Portal如果设置关键词的内容跟素材的名称一致,优先回复关键词");

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.SendMessageWithMenu("jdw");
            Thread.Sleep(1 * 1000);
            MobileAndroidDriver.GetScreenshot(filePath, "H5如果设置关键词的内容跟素材的名称一致,优先回复关键词");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("我不是素材"));
        }
Example #30
0
        public void Rule_Exact_Match()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\关键词精确匹配");

            AutoReplyPage.AddAutoReply("A", "A", "我不是素材");
            PortalChromeDriver.TakeScreenShot(filePath, "关键词精确匹配");

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessageWithMenu("A");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("我不是素材"));
        }