Ejemplo n.º 1
0
        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, "删除已添加的图片");
        }