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_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 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 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")); }
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 Rule_Fuzzy_Matching_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\模糊匹配"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply_Fuzzy_Matching("A", "abcdef", "我不是素材"); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); Mobile_Weibo_Utility.ClearAllMessage(); Mobile_Weibo_Utility.SendMessage("abcdef123"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("我不是素材"));; }
public void Rule_Trigger_SameWith_Material_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\如果设置关键词的内容跟素材的名称一致,优先回复关键词"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("A", "g", "我不是素材"); PortalChromeDriver.TakeScreenShot(filePath, "Portal如果设置关键词的内容跟素材的名称一致,优先回复关键词"); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); Mobile_Weibo_Utility.ClearAllMessage(); Mobile_Weibo_Utility.SendMessage("g"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("我不是素材"));; }
public void AutoReply_ClearAll_TurnOff_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\老用户删除所有创建的规则后,停用并且启用关键词回复功能"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.TurnOffAutoReply(); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); Mobile_Weibo_Utility.ClearAllMessage(); Mobile_Weibo_Utility.SendMessage("A"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(!Mobile_WeChat_Utility.IsAtPerName("[啊_荀] 说:a")); }
public void DeleteAutoReply_AutoReply_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\删除自动回复"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("A", "Hi", "第一个自动回复"); AutoReplyPage.DeleteReply(); PortalChromeDriver.TakeScreenShot(filePath, "删除自动回复"); Assert.IsFalse(Utility.IsAt(AutoReplyElement.RuleContent, "规则1:A")); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); Mobile_Weibo_Utility.ClearAllMessage(); Mobile_Weibo_Utility.SendMessage("A"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(!Mobile_WeChat_Utility.IsAtPerName("[啊_荀] 说:Hi")); }
public void Rule_Add_Response_href_script_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\回复为超链接和脚本"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("A", "怎么办", "<a href='http://bing.com'>必应</a>"); Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", "[" + 1 + "]"), "http://bing.com")); AutoReplyPage.AddAutoReply("B", "这么办", "<script>alert(“123”);</script>"); Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", "[" + 1 + "]"), "<script>alert(“123”);</script>")); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); Mobile_Weibo_Utility.ClearAllMessage(); Mobile_Weibo_Utility.SendMessage("怎么办"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("必应")); Mobile_Weibo_Utility.SendMessage("这么办"); PortalChromeDriver.TakeScreenShot(filePath, "关键词为脚本"); Assert.IsTrue(Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("[啊_荀] 说:<script>alert(“123”);</script>")); }