public void Edit_Text()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\检查聊天风格设置默认显示保守");

            Assert.IsTrue(Utility.IsAt(SettingElement.IsTurnOn, "未开启"));

            PortalChromeDriver.ClickElementPerXpath(SettingElement.TurnOnAutoReplyButton);

            PortalChromeDriver.ClickElementPerXpath(SettingElement.AddText);
            PortalChromeDriver.SendKeysPerXpath(SettingElement.TextInput, "北京欢迎你");
            PortalChromeDriver.ClickElementPerXpath(SettingElement.TextSave);
            PortalChromeDriver.ClickElementPerXpath(SettingElement.ReplySave);
            Thread.Sleep(1 * 1000);

            PortalChromeDriver.ClickElementPerXpath(SettingElement.EditReply);
            PortalChromeDriver.ClickElementPerXpath(SettingElement.EditText);
            PortalChromeDriver.SendKeysPerXpath(SettingElement.TextInput, "北京欢迎我");
            PortalChromeDriver.ClickElementPerXpath(SettingElement.TextSave);
            PortalChromeDriver.ClickElementPerXpath(SettingElement.ReplySave);
            Assert.IsTrue(Utility.IsAt(SettingElement.TextAddedCheck, "北京欢迎我"));

            //turn off if on
            if (Utility.IsAt(SettingElement.IsTurnOn, "已开启"))
            {
                PortalChromeDriver.ClickElementPerXpath(SettingElement.TurnOnAutoReplyButton);
                PortalChromeDriver.ClickElementPerXpath(SettingElement.TurnOffConfirm);
            }
        }
示例#2
0
 public static void CreateCampaign(string trigger)
 {
     try
     {
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.createCampaign);
         Thread.Sleep(2 * 1000);
         PortalChromeDriver.SendKeysPerXpath(MomentsSnapshotElement.text_input, "a");
         Thread.Sleep(2 * 1000);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.addKeyword);
         Thread.Sleep(2 * 1000);
         PortalChromeDriver.SendKeysPerXpath(MomentsSnapshotElement.Keyword_Input, trigger);
         Thread.Sleep(2 * 1000);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.addTextContent);
         Thread.Sleep(2 * 1000);
         PortalChromeDriver.SendKeysPerXpath(MomentsSnapshotElement.Response, "ok");
         Thread.Sleep(5 * 1000);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.OK);
         Thread.Sleep(10 * 1000);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.OK);
     }
     catch (Exception e)
     {
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.OK);
     }
 }
        public void Rename_OneLevelMenu()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\添加一级菜单中,是否可以删除已输入的菜单名称");

            //MenuPage.AddMenu("一级菜单");
            PortalChromeDriver.GetElementByXpath(MenuElement.add_menu_item_btn).Click();
            PortalChromeDriver.GetElementByXpath(MenuElement.MenuInputBox).SendKeys("一级菜单");
            PortalChromeDriver.GetElementByXpath(MenuElement.MenuInputBox).Clear();
            PortalChromeDriver.GetElementByXpath(MenuElement.MenuInputBox).SendKeys("菜单");
            PortalChromeDriver.GetElementByXpath(MenuElement.MenuAddConfirm).Click();
            MobileAndroidDriver.GetScreenshot(filePath, "添加一级菜单中,是否可以删除已输入的菜单名称");
            Assert.IsTrue(Utility.IsAt(MenuElement.addedMenu, "菜单"));

            filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\是否能成功重命名一级菜单的名称");
            MenuPage.RenameOneLevelMenu("一级");
            MobileAndroidDriver.GetScreenshot(filePath, "是否能成功重命名一级菜单的名称");
            Assert.IsFalse(Utility.IsAt(MenuElement.addedMenu, "一级菜单"));

            //MenuPage.AddMenu_Text("重命名的一级目录");
            PortalChromeDriver.ClickElementPerXpath(MenuElement.Send_Message);
            PortalChromeDriver.SendKeysPerXpath(MenuElement.TextInput, "重命名的一级目录");
            PortalChromeDriver.ClickElementPerXpath(MenuElement.bottom_save);
            PortalChromeDriver.ClickElementPerXpath(MenuElement.confirmbox_Cancle);
            Assert.IsFalse(Utility.IsAt(MenuElement.Notification, "保存成功"));
        }
示例#4
0
 public static void EditCampain()
 {
     try
     {
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.expand);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.CampainTitle);
         PortalChromeDriver.SendKeysPerXpath(MomentsSnapshotElement.text_input, "update");
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.UpdateCampain);
     }
     catch (Exception e)
     {
     }
 }
示例#5
0
 public static void EditKeyword()
 {
     try
     {
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.expand);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.UpdateKeyword);
         PortalChromeDriver.SendKeysPerXpath(MomentsSnapshotElement.Keyword_Input, "update");
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.UpdateCampain);
     }
     catch (Exception e)
     {
     }
 }
 public static void TurnToNextPage_Input(string page_Input)
 {
     try
     {
         PortalChromeDriver.GetElementByXpath(DocChatElement.Next_Page_Input).Clear();
         PortalChromeDriver.SendKeysPerXpath(DocChatElement.Next_Page_Input, page_Input);
         PortalChromeDriver.ClickElementPerXpath(DocChatElement.pagejump_btn);
         System.Threading.Thread.Sleep(3 * 1000);
     }
     catch (Exception e)
     {
     }
 }
 public static void AddMenu_Text(string text)
 {
     try
     {
         PortalChromeDriver.ClickElementPerXpath(MenuElement.Send_Message);
         PortalChromeDriver.SendKeysPerXpath(MenuElement.TextInput, text);
         PortalChromeDriver.GetElementByXpath(MenuElement.bottom_save).Click();
         PortalChromeDriver.GetElementByXpath(MenuElement.Confirm).Click();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
示例#8
0
 public static void EditResponse()
 {
     try
     {
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.expand);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.UpdateResponse);
         Thread.Sleep(1 * 1000);
         PortalChromeDriver.SendKeysPerXpath(MomentsSnapshotElement.Response, "update");
         Thread.Sleep(1 * 1000);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.UpdateCampain);
         Thread.Sleep(1 * 1000);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.UpdateCampain);
     }
     catch (Exception e)
     {
     }
 }
示例#9
0
        public static void Unbundling()
        {
            try
            {
                PortalChromeDriver.Instance.Navigate().GoToUrl(@"http://weibo.com/login.php#_loginLayer_1482828075835");
                PortalChromeDriver.SendKeysPerXpath("//*[@id='loginname']", "18660207496");
                PortalChromeDriver.GetElementByXpath("//*[@id='pl_login_form']/div/div[3]/div[2]/div/input").SendKeys("dongni816721");
                PortalChromeDriver.ClickElementPerXpath("//*[@id='pl_login_form']/div/div[3]/div[6]/a");
                PortalChromeDriver.ClickElementPerXpath("//*[@id='plc_top']/div/div/div[3]/div[1]/ul/li[5]/a");

                PortalChromeDriver.ClickElementPerXpath("//*[@id='Pl_Official_Nav__2']/div/div/table/tbody/tr/td[3]/a");
                Thread.Sleep(10 * 1000);
                PortalChromeDriver.ClickElementPerXpath("//*[@id='Pl_Official_LeftManageCenter__72']/div/ul/li[7]/a/span");
                // Thread.Sleep(10* 1000);
                PortalChromeDriver.ClickElementPerXpath("//*[@id='Pl_Official_LeftManageCenter__72']/div/ul/li[7]/ul/li[1]/a");

                if (Utility.IsAt("//*[@id='Pl_Core_AppList__75']/div/div/div[2]/div/ul/li[1]/div[2]/p[1]/a", "微软小冰服务平台"))
                {
                    PortalChromeDriver.ClickElementPerXpath("//*[@id='Pl_Core_AppList__75']/div/div/div[2]/div/ul/li[1]/div[2]/p[3]/span[2]/a");

                    var a = PortalChromeDriver.GetElementsByTagName("span");
                    foreach (var item in a)
                    {
                        if (item.Text == "确定")
                        {
                            Thread.Sleep(10 * 1000);
                            item.Click();
                        }
                    }
                }
                else
                {
                    PortalChromeDriver.Instance.Navigate().GoToUrl(PortalChromeDriver.BaseProductAddress);
                }
                PortalChromeDriver.Instance.Navigate().GoToUrl(PortalChromeDriver.BaseProductAddress);
            }
            catch (Exception e)
            {
                PortalChromeDriver.Instance.Navigate().GoToUrl(PortalChromeDriver.BaseProductAddress);
            }
        }
示例#10
0
 public static void CreateCampaign_News()
 {
     try
     {
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.createCampaign);
         PortalChromeDriver.SendKeysPerXpath(MomentsSnapshotElement.text_input, "a");
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.addKeyword);
         PortalChromeDriver.SendKeysPerXpath(MomentsSnapshotElement.Keyword_Input, "河北");
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.addImageContent);
         Thread.Sleep(2 * 1000);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.image);
         PortalChromeDriver.ClickElementPerXpath(CommonElement.ImageConfirm);
         Thread.Sleep(2 * 1000);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.OK);
         Thread.Sleep(2 * 1000);
         PortalChromeDriver.ClickElementPerXpath(MomentsSnapshotElement.OK);
     }
     catch (Exception e)
     {
     }
 }
示例#11
0
 public static void AddVideo_NextPageInput()
 {
     try
     {
         PortalChromeDriver.ClickElementPerXpath(MenuElement.Send_Message);
         PortalChromeDriver.ClickElementPerXpath(MenuElement.tabVideo);
         PortalChromeDriver.ClickElementPerXpath(MenuElement.ImageChoose);
         System.Threading.Thread.Sleep(2 * 1000);
         PortalChromeDriver.SendKeysPerXpath(FollowedAutoReplyElement.Next_Page_Image_Input, "2");
         System.Threading.Thread.Sleep(2 * 1000);
         PortalChromeDriver.ClickElementPerXpath(FollowedAutoReplyElement.Next_Page_Image_Input_Go);
         System.Threading.Thread.Sleep(2 * 1000);
         PortalChromeDriver.ClickElementPerXpath(MenuElement.VideoLink);
         System.Threading.Thread.Sleep(2 * 1000);
         PortalChromeDriver.ClickElementPerXpath(MenuElement.ChooseConfirm);
         System.Threading.Thread.Sleep(2 * 1000);
         PortalChromeDriver.GetElementByXpath(MenuElement.bottom_save).Click();
         PortalChromeDriver.GetElementByXpath(MenuElement.Confirm).Click();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
示例#12
0
 public static void AddAutoReplyText(string text)
 {
     PortalChromeDriver.ClearPerXpath(FollowedAutoReplyElement.TextInput);
     PortalChromeDriver.SendKeysPerXpath(FollowedAutoReplyElement.TextInput, text);
     PortalChromeDriver.ClickElementPerXpath(FollowedAutoReplyElement.Bottom_Save);
 }