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 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 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 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 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 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 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 TriggerHICardPerCustomize() { //Portal确保HI是Turn on的状态 WeChatManagermentPage.GoToHIPage(); HIPage.TurnOnSetup(); #region 添加一条触发关键词 HIPage.ClearTriggers(); HIPage.InputTrigger("hi"); PortalChromeDriver.Wait(TimeSpan.FromSeconds(2)); #endregion //H5页面进入平台测试账号对话窗口 Mobile_WeChat_Utility.GetToTestAccount(); Mobile_WeChat_Utility.ClearAllRecord(); //H5呼叫客服 Mobile_WeChat_Utility.SendMessage("hi"); Thread.Sleep(5 * 1000); string foler = PortalChromeDriver.CreateFolder(@"HI\H5.1.功能开启后,在公众号里是否能触发人工客服card"); MobileAndroidDriver.GetScreenshot(foler, "H5"); Assert.IsTrue(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath)); HIPage.ClearTriggers(); Mobile_WeChat_Utility.ClearAllRecord(); Thread.Sleep(5 * 1000); //H5呼叫客服 Mobile_WeChat_Utility.SendMessage("hi"); Thread.Sleep(5 * 1000); foler = PortalChromeDriver.CreateFolder(@"HI\H5.2.删除设置的关键词,是否还能触发人工客服card"); MobileAndroidDriver.GetScreenshot(foler, "H5.2.删除设置的关键词,是否还能触发人工客服card"); Assert.IsFalse(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath)); Mobile_WeChat_Utility.ClearAllRecord(); //H5呼叫客服 Mobile_WeChat_Utility.SendMessage("客服"); Thread.Sleep(5 * 1000); foler = PortalChromeDriver.CreateFolder(@"HI\H5.3.是否可以触发人工客服card,当输入含有找客服意向的语句"); MobileAndroidDriver.GetScreenshot(foler, "H5.3.是否可以触发人工客服card,当输入含有找客服意向的语句"); Assert.IsTrue(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath)); }
public void IsHICardAvailableAfterHITurnOff() { //Portal确保HI是Turn on的状态 WeChatManagermentPage.GoToHIPage(); HIPage.TurnOnSetup(); //H5页面进入平台测试账号对话窗口 Mobile_WeChat_Utility.GetToTestAccount(); //清空聊天记录 Mobile_WeChat_Utility.ClearAllRecord(); //H5呼叫客服 Mobile_WeChat_Utility.SendMessage("客服"); //关闭HI Utility.TurnOff(); Mobile_WeChat_Utility.ClickHICard(); string foler = PortalChromeDriver.CreateFolder(@"HI\H5.23.人工客服功能关闭,是否可以打开H5对话窗口"); MobileAndroidDriver.GetScreenshot(foler, "H5"); //Assert.IsTrue(HIMobileH5.IsAtPerXpath(HIMobileH5Element.HIOffError)); Assert.IsFalse(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath)); Mobile_WeChat_Utility.BackButtonClick(); }
public void TriggerHiCardPerHITurnOFF() { //Portal确保HI是Turn on的状态 WeChatManagermentPage.GoToHIPage(); HIPage.TurnOnSetup(); #region HIPage.InputTrigger("Hi"); PortalChromeDriver.Wait(TimeSpan.FromSeconds(5)); #endregion Utility.TurnOff(); //H5页面进入平台测试账号对话窗口 Mobile_WeChat_Utility.GetToTestAccount(); Mobile_WeChat_Utility.ClearAllRecord(); //H5呼叫客服 Mobile_WeChat_Utility.SendMessage("Hi"); string foler = PortalChromeDriver.CreateFolder(@"HI\H5.5.功能关闭后,在公众号里能否触发人工客服card"); MobileAndroidDriver.GetScreenshot(foler, "H5"); Assert.IsFalse(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.xb_chatwith_texttest)); }
public void AddOneLevelMenu_Audio() { string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\添加一级菜单_语音"); MenuPage.AddMenu("一级语音"); MenuPage.AddMenu_Audio(); MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.GetToTestAccount(); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.ClickFirstLevelMenu("一级语音"); Thread.Sleep(5 * 1000); MobileAndroidDriver.GetScreenshot(filePath, "添加一级菜单_语音"); Assert.IsTrue(Mobile_WeChat_Utility.GetAudioMessage()); filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\删除已添加的语音"); MenuPage.Delete(); Thread.Sleep(1 * 1000); Assert.IsTrue(Utility.IsAt(MenuElement.Notification, "菜单项不能为空")); MobileAndroidDriver.GetScreenshot(filePath, "删除已添加的语音"); }
public void AddOneLevelMenu_Image() { string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\添加一级菜单——文本"); MenuPage.AddMenu("一级图片"); MenuPage.AddMenu_Image(); MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.GetToTestAccount(); Mobile_WeChat_Utility.ClearAllRecord(); Mobile_WeChat_Utility.ClickFirstLevelMenu("一级图片"); Thread.Sleep(5 * 1000); MobileAndroidDriver.GetScreenshot(filePath, "添加一级菜单"); Assert.IsTrue(MobileAndroidDriver.IsAt("//android.widget.FrameLayout[contains(@resource-id,'com.tencent.mm:id/a4w')]", "")); filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\删除已添加的图片"); MenuPage.Delete(); Thread.Sleep(1 * 1000); Assert.IsTrue(Utility.IsAt(MenuElement.Notification, "菜单项不能为空")); MobileAndroidDriver.GetScreenshot(filePath, "删除已添加的图片"); }
public void Can_StaffBind_IfTimeOut() { string foler = PortalChromeDriver.CreateFolder(@"HI\29.[客服人员设定]是否可以正常使用,当登陆密码有效期超过60s时"); WeChatManagermentPage.GoTo_Menu_Page(); MenuPage.DeleteMenuItem(); //确保HI是Turn on的状态 WeChatManagermentPage.GoToHIPage(); HIPage.TurnOnSetup(); //切换到Hi的设置Tab页 HIPage.SwichHISettingTab(HIPortalPageUIElement.SubTabHIStaff); //判断是否已经绑定客服,如果绑定,则删除客服 HIPage.DeleteStaff(); //获取绑定客服验证码 var value = HIPage.GetLoginCode(); //等待60秒,超过有效期 Thread.Sleep(60 * 1000); //H5页面进入平台测试账号对话窗口 Mobile_WeChat_Utility.GetToTestAccount(); Mobile_WeChat_Utility.ClearAllRecord(); //发送验证码 Mobile_WeChat_Utility.SendMessage(value); MobileAndroidDriver.GetScreenshot(foler, "验证H5是否正确输入验证码"); PortalChromeDriver.TakeScreenShot(foler, "验证Portal端客服是否绑定成功"); Assert.IsFalse(Mobile_WeChat_Utility.IsStaffBind()); foler = PortalChromeDriver.CreateFolder(@"HI\30.[客服人员设定]是否可以正常使用,当登陆密码过期后重新获取"); value = HIPage.GetLoginCode(); //删除聊天记录 Mobile_WeChat_Utility.ClearAllRecord(); //发送验证码 Mobile_WeChat_Utility.SendMessage(value); //MobileH5.SendMessageWithMenu(value); Thread.Sleep(5 * 1000); PortalChromeDriver.TakeScreenShot(foler, "验证登陆密码过期后重新获取是否正常绑定"); Assert.IsTrue(Mobile_WeChat_Utility.IsStaffBind()); }
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("我是美女")); }