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 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 FollowedAutoReply_AddText() { string filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\添加文字关键词回复"); FollowedAutoReplyPage.AddAutoReplyText(""); PortalChromeDriver.Refresh(); Thread.Sleep(2 * 1000); PortalChromeDriver.TakeScreenShot(filePath, "Portal添加空回复"); Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedAutoReply, "您输入的欢迎语")); FollowedAutoReplyPage.Delete(); FollowedAutoReplyPage.AddAutoReplyText("123456"); PortalChromeDriver.Refresh(); Thread.Sleep(3 * 1000); PortalChromeDriver.TakeScreenShot(filePath, "Portal添加数字回复"); Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedAutoReply, "123456")); FollowedAutoReplyPage.Delete(); Thread.Sleep(3 * 1000); FollowedAutoReplyPage.AddAutoReplyText("!@##$%^&*()()"); PortalChromeDriver.Refresh(); Thread.Sleep(3 * 1000); PortalChromeDriver.TakeScreenShot(filePath, "Portal添加字符回复"); Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedAutoReply, "!@##$%^&*()()")); FollowedAutoReplyPage.Delete(); Thread.Sleep(3 * 1000); FollowedAutoReplyPage.AddAutoReplyText("0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"); Thread.Sleep(2 * 1000); PortalChromeDriver.Refresh(); PortalChromeDriver.TakeScreenShot(filePath, "Portal验证回复字符上限"); Assert.IsTrue(Utility.IsAt(FollowedAutoReplyElement.AddedAutoReply, "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789")); }
public void AddTrigger_Check() { //确保HI是Turn on的状态 HIPage.TurnOnSetup(); #region 4.[接入条件设置]是否可以添加一条为空的触发关键词 folder = PortalChromeDriver.CreateFolder(@"HI\4.[接入条件设置]是否可以添加一条为空的触发关键词"); HIPage.ClearTriggers(); HIPage.InputTrigger(""); PortalChromeDriver.Refresh(); PortalChromeDriver.TakeScreenShot(folder, @"\4.[接入条件设置]是否可以添加一条为空的触发关键词"); Assert.IsFalse(HIPage.iskeywordAdded(""), "添加为空的触发关键词"); #endregion #region 5.[接入条件设置]是否可以添加一条触发关键词,当输入空格时 folder = PortalChromeDriver.CreateFolder(@"HI\5.[接入条件设置]是否可以添加一条触发关键词,当输入空格时"); HIPage.ClearTriggers(); HIPage.InputTrigger(" "); PortalChromeDriver.TakeScreenShot(folder, @"5.[接入条件设置]是否可以添加一条触发关键词,当输入空格时"); Assert.IsFalse(HIPage.iskeywordAdded(" "), "添加空格为触发关键词"); #endregion #region 6.[接入条件设置]是否可以添加一条触发关键词,当输入html标签时 folder = PortalChromeDriver.CreateFolder(@"HI\6.[接入条件设置]是否可以添加一条触发关键词,当输入html标签时"); HIPage.ClearTriggers(); HIPage.InputTrigger("<div class='body'>"); PortalChromeDriver.TakeScreenShot(folder, @"6.[接入条件设置]是否可以添加一条触发关键词,当输入html标签时"); Assert.IsTrue(HIPage.iskeywordAdded("<div class='body'>"), "添加HTML标签失败"); #endregion #region 7. [接入条件设置]是否可以添加一条超过20个字的触发关键词 folder = PortalChromeDriver.CreateFolder(@"HI\7.[接入条件设置]是否可以添加一条超过20个字的触发关键词"); HIPage.ClearTriggers(); HIPage.InputTrigger("012345678901234567890"); Assert.IsFalse(HIPage.iskeywordAdded("012345678901234567890"), "添加一条超过20个字的触发关键词"); PortalChromeDriver.TakeScreenShot(folder, @"7.[接入条件设置]是否可以添加一条超过20个字的触发关键词"); #endregion #region 8. [接入条件设置]是否可以添加一条重复的触发关键词 folder = PortalChromeDriver.CreateFolder(@"HI\8.[接入条件设置]是否可以添加一条重复的触发关键词"); Thread.Sleep(2 * 1000); HIPage.ClearTriggers(); HIPage.InputTrigger("hi"); Assert.IsTrue(HIPage.iskeywordAdded("hi"), "keyword added"); HIPage.InputTrigger("hi"); PortalChromeDriver.TakeScreenShot(folder, @"8.[接入条件设置]是否可以添加一条重复的触发关键词"); Assert.IsFalse(HIPage.isTheSameKeywordAdded("hi"), "添加一条重复的触法关键词"); #endregion #region 9. [接入条件设置]是否可以添加一条包含非法词语的触发关键词 folder = PortalChromeDriver.CreateFolder(@"HI\9.[接入条件设置]是否可以添加一条包含非法词语的触发关键词"); HIPage.ClearTriggers(); HIPage.InputTrigger("赌博"); Thread.Sleep(2 * 1000); PortalChromeDriver.TakeScreenShot(folder, @"9.[接入条件设置]是否可以添加一条包含非法词语的触发关键词"); Assert.IsTrue(HIPage.HasAlert_Failure(), "添加非法触发关键词"); HIPage.ClickModifyButton(); #endregion }
public void DeleteTrigger_Check() { //确保HI是Turn on的状态 HIPage.TurnOnSetup(); #region 19, 21. [接入条件设置]是否可以成功删除5条触发关键词 folder = PortalChromeDriver.CreateFolder(@"HI\20.[接入条件设置]是否可以添加5条触发关键词"); HIPage.ClearTriggers(); HIPage.InputTrigger("Hi1"); HIPage.InputTrigger("Hi2"); HIPage.InputTrigger("Hi3"); HIPage.InputTrigger("Hi4"); HIPage.InputTrigger("Hi5"); PortalChromeDriver.TakeScreenShot(folder, "20.[接入条件设置]是否可以添加5条触发关键词"); Assert.IsTrue(HIPage.AddedFiveTrigger("最多添加5条"), "未显示'最多添加5条'提示"); folder = PortalChromeDriver.CreateFolder(@"HI\22.[接入条件设置]是否可以成功添加一条内容跟之前删除的触发关键词相同的关键词"); HIPage.InputTrigger("Hi5"); PortalChromeDriver.TakeScreenShot(folder, "22.[接入条件设置]是否可以成功添加一条内容跟之前删除的触发关键词相同的关键词"); Assert.IsTrue(HIPage.AddedFiveTrigger("最多添加5条"), "是否可以成功添加一条内容跟之前删除的触发关键词相同的关键词"); HIPage.ClearTriggers(); folder = PortalChromeDriver.CreateFolder(@"HI\23.[接入条件设置]是否可以成功删除5条触发关键词"); PortalChromeDriver.TakeScreenShot(folder, @"23.[接入条件设置]是否可以成功删除5条触发关键词"); Assert.IsFalse(HIPage.iskeywordAdded("Hi1"), "删除触发关键词失败"); #endregion #region 24. [接入条件设置]是否可以成功删除再添加触发关键词 folder = PortalChromeDriver.CreateFolder(@"HI\24.[接入条件设置]是否可以成功删除再添加触发关键词"); HIPage.ClearTriggers(); PortalChromeDriver.Refresh(); HIPage.InputTrigger("Hi1"); HIPage.InputTrigger("Hi2"); HIPage.InputTrigger("Hi3"); HIPage.InputTrigger("Hi4"); HIPage.InputTrigger("Hi5"); HIPage.DeleteTrigger(); HIPage.DeleteTrigger(); HIPage.InputTrigger("Hi6"); HIPage.InputTrigger("Hi7"); PortalChromeDriver.TakeScreenShot(folder, @"24.[接入条件设置]是否可以成功删除再添加触发关键词"); Assert.IsTrue(HIPage.iskeywordAdded("Hi7"), "删除之后再添加关键词失败"); HIPage.ClearTriggers(); #endregion #region 25. [接入条件设置]是否保存状态,当输入触发关键词后不点添加,切换到“客服人员设定tab folder = PortalChromeDriver.CreateFolder(@"HI\25.[接入条件设置]是否保存状态,当输入触发关键词后不点添加,切换到“客服人员设定tab"); HIPage.ClearTriggers(); HIPage.InputTriggerWithoutSave("Hi"); HIPage.SwichHISettingTab(HIPortalPageUIElement.SubTabHIStaff); HIPage.SwichHISettingTab(HIPortalPageUIElement.SubTabHITrigger); PortalChromeDriver.TakeScreenShot(folder, @"25.[接入条件设置]是否保存状态,当输入触发关键词后不点添加,切换到“客服人员设定tab"); Assert.IsFalse(HIPage.iskeywordAdded("Hi"), "切换到'客服人员设置',应保存失败"); #endregion }
public static void Delete() { try { PortalChromeDriver.ClickElementPerXpath(FollowedAutoReplyElement.Delete); PortalChromeDriver.ClickElementPerXpath(FollowedAutoReplyElement.Delete_Confirm); System.Threading.Thread.Sleep(2 * 1000); } catch (Exception e) { PortalChromeDriver.Refresh(); } }
public static void DeleteMenuItem() { try { PortalChromeDriver.GetElementByXpath(MenuElement.DeleteMenuButton).Click(); System.Threading.Thread.Sleep(1 * 1000); PortalChromeDriver.GetElementByXpath(MenuElement.DeleteMenuButtonConfirm).Click(); System.Threading.Thread.Sleep(1 * 1000); } catch (Exception e) { PortalChromeDriver.Refresh(); } }
public static void DeleteReply() { try { //PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.entity_expand); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.DeleteButtonXpath); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.ok_btn); Thread.Sleep(1 * 1000); } catch (Exception e) { PortalChromeDriver.Refresh(); } }
public void EditTrigger() { //确保HI是Turn on的状态 HIPage.TurnOnSetup(); #region 11. [接入条件设置]是否可以编辑已有的触发关键词 folder = PortalChromeDriver.CreateFolder(@"HI\[接入条件设置]是否可以编辑已有的触发关键词"); HIPage.ClearTriggers(); HIPage.InputTrigger("Hi"); HIPage.EditTrigger("append"); HIPage.ClickSomewhereToSave(); PortalChromeDriver.TakeScreenShot(folder, @"11.[接入条件设置]是否可以编辑已有的触发关键词"); Assert.IsTrue(HIPage.iskeywordAdded("append"), "编辑已有触发关键词失败"); #endregion #region 14. [接入条件设置]是否可以正常保存,当编辑已有的触发关键词输入html标签时 folder = PortalChromeDriver.CreateFolder(@"HI\14.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词输入html标签时"); HIPage.ClearTriggers(); HIPage.InputTrigger("Hi"); PortalChromeDriver.Refresh(); HIPage.EditTrigger("<div class='body'>"); HIPage.ClickSomewhereToSave(); PortalChromeDriver.TakeScreenShot(folder, @"14.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词输入html标签时"); Assert.IsTrue(HIPage.iskeywordAdded("<div class='body'>"), "编辑已有的触发关键词输入html标签时"); #endregion #region 17. [接入条件设置]是否可以正常保存,当编辑已有的触发关键词包含非法词语 folder = PortalChromeDriver.CreateFolder(@"HI\17.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词包含非法词语"); HIPage.ClearTriggers(); HIPage.InputTrigger("Hi"); HIPage.EditTrigger("赌博"); HIPage.ByPassAlert(); PortalChromeDriver.Refresh(); PortalChromeDriver.TakeScreenShot(folder, @"17.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词包含非法词语"); Assert.IsTrue(HIPage.iskeywordAdded("Hi"), "编辑已有的触发关键词包含非法词语"); #endregion }
public void EditTrigger_Check() { //确保HI是Turn on的状态 HIPage.TurnOnSetup(); #region 12. [接入条件设置]是否可以正常保存,当编辑已有的触发关键词删除所有内容 folder = PortalChromeDriver.CreateFolder(@"HI\12.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词删除所有内容"); HIPage.ClearTriggers(); HIPage.InputTrigger("Hi"); HIPage.DeleteTriggerByEditButton(); HIPage.ClickSomewhereToSave(); PortalChromeDriver.TakeScreenShot(folder, @"12.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词删除所有内容"); Assert.IsTrue(HIPage.iskeywordAdded("Hi"), "编辑已有的触发关键词删除所有内容"); #endregion #region 13. [接入条件设置]是否可以正常保存,当编辑已有的触发关键词输入空格 folder = PortalChromeDriver.CreateFolder(@"HI\13.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词输入空格"); HIPage.ClearTriggers(); HIPage.InputTrigger("Hi"); HIPage.EditTrigger(" "); PortalChromeDriver.Refresh(); PortalChromeDriver.TakeScreenShot(folder, @"13.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词输入空格"); Assert.IsTrue(HIPage.iskeywordAdded("Hi"), "编辑已有的触发关键词输入空格"); PortalChromeDriver.Refresh(); PortalChromeDriver.Wait(TimeSpan.FromSeconds(5)); #endregion #region 14. [接入条件设置]是否可以正常保存,当编辑已有的触发关键词输入html标签时 folder = PortalChromeDriver.CreateFolder(@"HI\14.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词输入html标签时"); HIPage.ClearTriggers(); HIPage.InputTrigger("Hi"); PortalChromeDriver.Refresh(); HIPage.EditTrigger("<div class='body'>"); HIPage.ClickSomewhereToSave(); PortalChromeDriver.TakeScreenShot(folder, @"14.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词输入html标签时"); Assert.IsTrue(HIPage.iskeywordAdded("<div class='body'>"), "编辑已有的触发关键词输入html标签时"); #endregion #region 15. [接入条件设置]是否可以正常保存,当编辑已有的触发关键词超过20个字 folder = PortalChromeDriver.CreateFolder(@"HI\15.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词超过20个字"); HIPage.ClearTriggers(); HIPage.InputTrigger("Hi"); HIPage.EditTrigger("012345678901234567890"); HIPage.ClickSomewhereToSave(); PortalChromeDriver.TakeScreenShot(folder, @"15.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词超过20个字"); Assert.IsTrue(HIPage.iskeywordAdded("01234567890123456789"), "编辑已有的触发关键词超过20个字"); #endregion #region 16. [接入条件设置]是否可以正常保存,当编辑已有的触发关键词跟其他的触发关键词重复时 folder = PortalChromeDriver.CreateFolder(@"HI\16.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词跟其他的触发关键词重复时"); HIPage.ClearTriggers(); HIPage.InputTrigger("Hi"); HIPage.InputTrigger("Hello"); HIPage.EditTrigger("Hi"); HIPage.ClickSomewhereToSave(); PortalChromeDriver.TakeScreenShot(folder, @"16.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词跟其他的触发关键词重复时"); Assert.IsTrue(HIPage.iskeywordAdded("Hello"), "编辑已有的触发关键词跟其他的触发关键词重复时"); #endregion #region 17. [接入条件设置]是否可以正常保存,当编辑已有的触发关键词包含非法词语 folder = PortalChromeDriver.CreateFolder(@"HI\17.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词包含非法词语"); HIPage.ClearTriggers(); HIPage.InputTrigger("Hi"); HIPage.EditTrigger("赌博"); HIPage.ByPassAlert(); PortalChromeDriver.Refresh(); PortalChromeDriver.TakeScreenShot(folder, @"17.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词包含非法词语"); Assert.IsTrue(HIPage.iskeywordAdded("Hi"), "编辑已有的触发关键词包含非法词语"); #endregion }