コード例 #1
0
 public static void DeleteAllLibs()
 {
     try
     {
         string standard = "Standard";
         ReadOnlyCollection <AppiumWebElement> libList =
             LibraryList.GetInternalElement().FindElementsById("library_row_layout");
         int shift = 0;
         while (libList.Count > 1)
         {
             string libName = libList[shift].FindElementById("library_title").Text;
             if (libName == standard)
             {
                 shift++;
             }
             ConsoleMessage.Pass(String.Format("{0}. Select library with name: {1}", ActivityName, libName));
             libList[shift].Click();
             DeleteLibrary.Tap();
             LibraryDeleteDialog.Delete.Tap();
             libList =
                 LibraryList.GetInternalElement().FindElementsById("library_row_layout");
         }
     }
     catch (Exception ex)
     {
         ConsoleMessage.Fail(String.Format("{0}. Can't delete all libraries: {1}", ActivityName), ex);
         throw;
     }
 }
コード例 #2
0
 public static void VerifyCantShareLibrary(string libraryName)
 {
     try
     {
         ReadOnlyCollection <AppiumWebElement> libList =
             LibraryList.GetInternalElement().FindElementsById("library_row_layout");
         foreach (var element in libList)
         {
             if (element.FindElementById("library_title").Text == libraryName)
             {
                 element.Click();
                 element.FindElementById("chkLibrary").Click();
                 CommonOperation.Delay(1);
                 Assert.False(Boolean.Parse(element.FindElementById("chkLibrary").GetAttribute("checked")),
                              "Can check " + libraryName + " checkbox without share permission");
                 ConsoleMessage.Pass(String.Format("{0}. Can't Checked library for share with name: {1} without permission", ActivityName, libraryName));
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         ConsoleMessage.Fail(String.Format("{0}. Can checked library for share with name: {1} without permission", ActivityName, libraryName), ex);
         throw;
     }
 }
コード例 #3
0
 public static void VerifyLibraryNotExist(string libraryName)
 {
     try
     {
         Assert.True(LibraryList.GetInternalElement().FindElementsByName(libraryName).Count == 0, "Library with name: " + libraryName + " exist");
         ConsoleMessage.Pass(String.Format("{0}. Verify, library with name: {1} not exist", ActivityName, libraryName));
     }
     catch (Exception ex)
     {
         ConsoleMessage.Fail(String.Format("{0}. Verify fail. Library with name: {1} still exist", ActivityName, libraryName), ex);
         throw;
     }
 }