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 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 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("客服接入成功")); }
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 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 AutoReply_ClearAll_TurnOff() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\老用户删除所有创建的规则后,停用并且启用关键词回复功能"); AutoReplyPage.TurnOffAutoReply(); MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.FollowWeChatOffcialAccount(); //MobileH5.GetToTestAccount(); Mobile_WeChat_Utility.ResetKeyboard("Appium Android Input Manager for Unicode"); Mobile_WeChat_Utility.SendMessageWithMenu("a"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(!Mobile_WeChat_Utility.GetLatestMessage("[平台测试账号2]说:")); }
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("我不是素材")); }
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("我不是素材")); }
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("我不是素材")); }
public void DeleteAutoReply_AutoReply() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\删除自动回复"); AutoReplyPage.AddAutoReply("A", "Hi", "第一个自动回复"); AutoReplyPage.DeleteReply(); PortalChromeDriver.TakeScreenShot(filePath, "删除自动回复"); Assert.IsFalse(Utility.IsAt(AutoReplyElement.RuleContent, "规则1:A")); MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.GetToTestAccount(); Mobile_WeChat_Utility.SendMessage("A"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(!Mobile_WeChat_Utility.GetLatestMessage("[平台测试账号2]说:")); }
public void FollowedAutoReply_AddedAll_VideoFirst() { string filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\同时添加文本图文图片和语音自动回复信息,当前选中的素材被保存并发布到微信公众号上"); FollowedAutoReplyPage.AddAutoReplyText("hello,谢谢关注"); FollowedAutoReplyPage.AddAutoReplyImage(FollowedAutoReplyElement.ImageChoose); FollowedAutoReplyPage.AddAutoReplyNews(FollowedAutoReplyElement.NewsChoose); FollowedAutoReplyPage.AddAutoReplyVideo(FollowedAutoReplyElement.VideoEdit); MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.UnFollowWeChatOffcialAccount(); Mobile_WeChat_Utility.FollowWeChatOffcialAccount(); MobileAndroidDriver.GetScreenshot(filePath, "同时添加所有回复素材,video会上传至微信平台"); Assert.IsTrue((Mobile_WeChat_Utility.GetLatestMessage("测试视频10"))); }
public void ChitChatSkill_Weather_Sun() { MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.GetToTestAccount(); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.SendMessage("北京天气"); Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("℃")); Utility.TurnOff(); Thread.Sleep(60 * 1000); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.SendMessage("北京天气"); Thread.Sleep(60 * 1000); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.SendMessage("北京天气"); Assert.IsTrue(!Mobile_WeChat_Utility.GetLatestMessage("℃")); }
public void ChitChatSkill_Star_Arena() { MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.GetToTestAccount(); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.SendMessage("韩寒和小四谁更火"); Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("郭敬明")); Utility.TurnOff(); Thread.Sleep(60 * 1000); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.SendMessage("韩寒和小四谁更火"); Thread.Sleep(60 * 1000); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.SendMessage("韩寒和小四谁更火"); Assert.IsTrue(!Mobile_WeChat_Utility.GetLatestMessage("郭敬明")); }
public void Rule_Add_Response_href_script() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\回复为超链接和脚本"); AutoReplyPage.AddAutoReply("A", "A", "<a href='http://bing.com'>必应</a>"); Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", "[" + 1 + "]"), "http://bing.com")); AutoReplyPage.AddAutoReply("B", "B", "<script>alert(“123”);</script>"); Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", "[" + 1 + "]"), "<script>alert(“123”);</script>")); MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.GetToTestAccount(); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.SendMessageWithMenu("A"); PortalChromeDriver.TakeScreenShot(filePath, "关键词为超链接"); Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("必应")); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.SendMessageWithMenu("B"); PortalChromeDriver.TakeScreenShot(filePath, "关键词为脚本"); Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("<script>alert(“123”);</script>")); }
public void Rule_Add_Response_Emoj() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加表情回复"); 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(); Mobile_WeChat_Utility.GetToTestAccount(); Mobile_WeChat_Utility.SendMessageWithMenu("trigger"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("[平台测试账号2] 说:")); }
public void TurnOff_AutoReply() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\关键词自动回复Mobile可用"); AutoReplyPage.AddAutoReply("A", "A", "我是美女"); MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.GetToTestAccount(); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.SendMessageWithMenu("A"); Thread.Sleep(2 * 1000); MobileAndroidDriver.GetScreenshot(filePath, "关键词自动回复Mobile可用"); Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("我是美女")); filePath = PortalChromeDriver.CreateFolder(@"自动回复\停用关键词回复Mobile无关键词回复"); AutoReplyPage.TurnOffAutoReply(); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.SendMessageWithMenu("A"); Thread.Sleep(2 * 1000); MobileAndroidDriver.GetScreenshot(filePath, "停用关键词回复Mobile无关键词回复"); Assert.IsFalse(Mobile_WeChat_Utility.GetLatestMessage("我是美女")); }
public void FollowedAutoReply_Add_Delete_Edit_Video() { string filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\添加删除修改视频回复"); FollowedAutoReplyPage.AddAutoReplyVideo(FollowedAutoReplyElement.VideoChoose); PortalChromeDriver.TakeScreenShot(filePath, "添加"); Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedVideo, "测试视频11"), "添加视频回复"); MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.UnFollowWeChatOffcialAccount(); Mobile_WeChat_Utility.FollowWeChatOffcialAccount(); Thread.Sleep(5 * 1000); MobileAndroidDriver.GetScreenshot(filePath, "验证添加回复"); Assert.IsTrue((Mobile_WeChat_Utility.GetLatestMessage("测试视频11")), "验证添加回复"); FollowedAutoReplyPage.Delete(); PortalChromeDriver.TakeScreenShot(filePath, "删除视频回复"); Assert.IsFalse(Utility.IsAt(FollowedAutoReplyElement.AddedVideo, "测试视频11"), "删除视频回复"); FollowedAutoReplyPage.AddAutoReplyVideo(FollowedAutoReplyElement.VideoEdit); Thread.Sleep(2 * 1000); PortalChromeDriver.TakeScreenShot(filePath, "修改音频回复"); Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedVideo, "测试视频10"), "修改音频回复"); }