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 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 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 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 DeleteReply_AutoReply() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\删除reply"); AutoReplyPage.AddAutoReply("A", "Hi", "第一个自动回复"); AutoReplyPage.DeleteReplyInner(); PortalChromeDriver.TakeScreenShot(filePath, "删除reply"); Assert.IsFalse(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", "[" + 1 + "]"), 1 + "")); }
public void AddAutoReply_IllegalReply() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\不能添加包含敏感词汇的回复"); AutoReplyPage.AddAutoReply("A", "Hi", "法轮功"); PortalChromeDriver.TakeScreenShot(filePath, "不能添加包含敏感词汇的回复"); Assert.IsTrue(Utility.IsAt(AutoReplyElement.Alert_Failure, "抱歉,您的回复中包含了不当内容,请修改后重新保存。")); AutoReplyPage.Alert_Failure_OK(); }
public void AddReply_Total_200() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加200自动回复"); for (int i = 1; i <= 200; i++) { AutoReplyPage.AddAutoReply(i + "", "Hi", "第一个自动回复"); Thread.Sleep(3 * 1000); Assert.IsTrue(Utility.IsAt(AutoReplyElement.RuleContent, "规则" + i)); } PortalChromeDriver.TakeScreenShot(filePath, "添加200自动回复"); }
public static void AddText_AutoReply_BVT() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加关键词回复"); AutoReplyPage.AddAutoReply("A", "A", "第一个自动回复"); PortalChromeDriver.TakeScreenShot(filePath, "添加关键词回复"); Assert.IsTrue(Utility.IsAt(AutoReplyElement.RuleContent, "规则1:A")); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("", "A", "第一个自动回复"); PortalChromeDriver.TakeScreenShot(filePath, "规则名为空"); Assert.IsTrue(Utility.IsAt(CommonElement.notification), "规则名为空"); }
public void DeleteTrigger_AutoReply_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\删除Trigger"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("A", "Hi", "第一个自动回复"); AutoReplyPage.DeleteTrigger(); PortalChromeDriver.TakeScreenShot(filePath, "删除Trigger"); Assert.IsFalse(Utility.IsAt(AutoReplyElement.TrigerContent.Replace("[{0}]", "[" + 1 + "]"), 1 + "")); }
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_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 AddText_AutoReply_BVT_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加关键词回复"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("A", "A", "第一个自动回复"); PortalChromeDriver.TakeScreenShot(filePath, "添加关键词回复"); Assert.IsTrue(Utility.IsAt(AutoReplyElement.RuleContent, "规则1:A")); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("", "A", "第一个自动回复"); PortalChromeDriver.TakeScreenShot(filePath, "规则名为空"); Assert.IsTrue(Utility.IsAt(CommonElement.notification), "规则名为空"); }
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 Rule_Exact_Match_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\关键词精确匹配"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("A", "谁是最漂亮的人", "我不是素材"); PortalChromeDriver.TakeScreenShot(filePath, "关键词精确匹配"); 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("我不是素材"));; }
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 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 AddText_AutoReply() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加关键词回复"); AutoReplyPage.AddAutoReply("", "Hi", "第一个自动回复"); Assert.IsTrue(Utility.IsAt(CommonElement.notification), "规则名不能为空"); AutoReplyPage.AddAutoReply("A", "", "第一个自动回复"); Assert.IsTrue(Utility.IsAt(CommonElement.notification), "关键词不能为空"); AutoReplyPage.AddAutoReply("A", "Hi", ""); Assert.IsTrue(Utility.IsAt(CommonElement.notification), "回复文本不能为空"); AutoReplyPage.AddAutoReply("012345678901234567890123456789012345678901234567890", "0123456789012345678901234567890", "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"); Thread.Sleep(2 * 1000); PortalChromeDriver.TakeScreenShot(filePath, "字数限制"); Assert.IsTrue(Utility.IsAt(AutoReplyElement.RuleContent, "01234567890123456789012345678901234567890123456789")); Assert.IsTrue(Utility.IsAt(AutoReplyElement.TrigerContent.Replace("{0}", 1 + ""), "012345678901234567890123456789")); Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", "[" + 1 + "]"), "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789")); AutoReplyPage.DeleteReply(); }
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 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>")); }