public void ShareOnly()
        {
            string     shareName     = string.Format("{0}=Share", _version);
            string     reshareName   = string.Format("{0}=Rshr", _version);
            Permission permission    = new Permission(true, true, false, false);
            Permission allPermission = new Permission(true, true, true, true);

            ConsoleMessage.StartTest("Share library with user: Share", "ShareLibrary");
            //share on owner
            Appium.Instance.Driver.LaunchApp();
            LoginActivity.LoginStep(_user1, _timeout);
            TabMenu.Library.Tap();
            LibraryActivity.SelectAndShareLibrary(_baseLibrary, shareName);
            LibraryShareDialog.ShareWithUserStep(_team, _user2.Name, permission);
            CommonOperation.Delay(_shareDelay);
            TabMenu.Logout.Tap();

            //verify on recipient
            LoginActivity.LoginStep(_user2, _timeout);
            CommonOperation.Delay(_loginDelay);
            TabMenu.Library.Tap();
            LibraryActivity.LibraryList.FindAndTap(shareName);
            LibraryActivity.ElementList.VerifyElementCountById(20, "library_document_icon");
            //verify can't add element
            LibraryActivity.AddElement.Tap();
            LibraryPermissionErrorDialog.DialogName.VerifyText("Add Permission");
            LibraryPermissionErrorDialog.Ok.Tap();
            //verify can't delete library
            LibraryActivity.DeleteLibrary.Tap();
            LibraryPermissionErrorDialog.DialogName.VerifyText("Delete Permission");
            LibraryPermissionErrorDialog.Ok.Tap();
            //verify can't delete library element
            LibraryActivity.ElementList.FindAndTap("Add");
            LibraryElementActivity.Delete.Tap();
            LibraryPermissionErrorDialog.DialogName.VerifyText("Delete Permission");
            LibraryPermissionErrorDialog.Ok.Tap();
            LibraryElementActivity.Cancel.Tap();
            //verify can't share library
            LibraryActivity.SelectAndShareLibrary(shareName, reshareName);
            LibraryShareDialog.ShareWithUserStep(_team, _user1.Name, allPermission);
            CommonOperation.Delay(_shareDelay);
            TabMenu.Logout.Tap();

            //verify on owner
            LoginActivity.LoginStep(_user1, _timeout);
            CommonOperation.Delay(_loginDelay);
            TabMenu.Library.Tap();
            LibraryActivity.LibraryList.FindAndTap(reshareName);
            LibraryActivity.ElementList.VerifyElementCountById(20, "library_document_icon");
            TabMenu.Logout.Tap();
        }
        public void ModifyOnly()
        {
            string     shareName  = string.Format("{0}=Modify", _version);
            Permission permission = new Permission(true, false, true, false);

            ConsoleMessage.StartTest("Share library with user: Modify", "ShareLibrary");
            //share on owner
            Appium.Instance.Driver.LaunchApp();
            LoginActivity.LoginStep(_user1, _timeout);
            TabMenu.Library.Tap();
            LibraryActivity.SelectAndShareLibrary(_baseLibrary, shareName);
            LibraryShareDialog.ShareWithUserStep(_team, _user2.Name, permission);
            CommonOperation.Delay(_shareDelay);
            TabMenu.Logout.Tap();

            //verify on recipient
            LoginActivity.LoginStep(_user2, _timeout);
            CommonOperation.Delay(_loginDelay);
            TabMenu.Library.Tap();
            LibraryActivity.LibraryList.FindAndTap(shareName);
            LibraryActivity.ElementList.VerifyElementCountById(20, "library_document_icon");
            //verify can add element
            LibraryActivity.AddElement.Tap();
            LibraryElementActivity.ElementName.ClearText();
            LibraryElementActivity.ElementName.EnterText("Element1");
            LibraryElementActivity.Ok.Tap();
            LibraryActivity.ElementList.VerifyElementCountById(21, "library_document_icon");
            //verify can delete library element
            LibraryActivity.ElementList.FindAndTap("Add");
            LibraryElementActivity.Delete.Tap();
            LibraryDeleteElementDialog.Delete.Tap();
            LibraryActivity.ElementList.VerifyElementCountById(20, "library_document_icon");
            //verify can delete library
            LibraryActivity.DeleteLibrary.Tap();
            LibraryDeleteDialog.Cancel.Tap();
            //verify can't share library
            LibraryActivity.ShareLibrary.Tap();
            LibraryActivity.VerifyCantShareLibrary(shareName);
            LibraryActivity.CancelShare.Tap();
            TabMenu.Logout.Tap();

            //verify on owner
            LoginActivity.LoginStep(_user1, _timeout);
            CommonOperation.Delay(_loginDelay);
            TabMenu.Library.Tap();
            LibraryActivity.LibraryList.FindAndTap(shareName);
            LibraryActivity.ElementList.VerifyElementCountById(20, "library_document_icon");
            TabMenu.Logout.Tap();
        }
        public void Unshare()
        {
            string     shareName  = string.Format("{0}=Unshare", _version);
            Permission permission = new Permission(true, true, true, true);

            ConsoleMessage.StartTest("Share library with user: Unshare", "ShareLibrary");
            //share on owner
            Appium.Instance.Driver.LaunchApp();
            LoginActivity.LoginStep(_user1, _timeout);
            TabMenu.Library.Tap();
            LibraryActivity.SelectAndShareLibrary(_baseLibrary, shareName);
            LibraryShareDialog.ShareWithUserStep(_team, _user2.Name, permission);
            CommonOperation.Delay(_shareDelay);
            TabMenu.Logout.Tap();

            //verify on recipient
            LoginActivity.LoginStep(_user2, _timeout);
            CommonOperation.Delay(_loginDelay);
            TabMenu.Library.Tap();
            LibraryActivity.LibraryList.FindAndTap(shareName);
            LibraryActivity.ElementList.VerifyElementCountById(20, "library_document_icon");
            TabMenu.Logout.Tap();

            //unshare on owner
            LoginActivity.LoginStep(_user1, _timeout);
            TabMenu.Library.Tap();
            LibraryActivity.LibraryList.FindAndTap(shareName);
            LibraryActivity.Permission.Tap();
            LibraryShareDialog.Unshare(_user2.Name);
            LibraryShareDialog.ShareWithList.VerifyElementCountById(0, "user_picture");
            LibraryShareDialog.Ok.Tap();
            CommonOperation.Delay(_shareDelay);
            TabMenu.Logout.Tap();

            //verify on recipient, library not exist
            LoginActivity.LoginStep(_user2, _timeout);
            CommonOperation.Delay(_loginDelay);
            TabMenu.Library.Tap();
            LibraryActivity.VerifyLibraryNotExist(shareName);
        }