// 更新 TeamActivity 資料 private bool UpdateTeamActivity() { bool ret = false; try { List <TeamActivity> actList = db.GetSql().Queryable <TeamActivity>().With(SqlSugar.SqlWith.RowLock).ToList(); SaveLog($"[Info] Update Team Activity , Total Count: {actList.Count}"); for (int idx = 0; idx < actList.Count; idx++) { TeamActivity info = actList[idx]; redis.GetRedis((int)Connect.RedisDB.emRedisDB_Team).HashSet($"TeamActivity_" + info.ActID, hashTransfer.TransToHashEntryArray(info)); redis.GetRedis((int)Connect.RedisDB.emRedisDB_Team).HashSet($"ActIdList_" + info.TeamID, info.ActID, info.ActID); SaveLog($"[Info] Update Team Activity , Activity: {info.ActID}"); } ret = true; } catch (Exception ex) { SaveLog($"[Error] Update Team Activity Catch Error, Msg:{ex.Message}"); } return(ret); }
public void BeforeClass() { _user1 = Settings.Instance.User1; _user2 = Settings.Instance.User2; _timeout = Settings.Instance.LoginTimeout; _shareDelay = Settings.Instance.ShareDelay; _loginDelay = Settings.Instance.LoginDelay; _version = Settings.Instance.Version; _assay = string.Format("{0}-ShareAssayWithUser", _version); _flow = string.Format("{0}-ShareAssayWithUser", _version); _team = String.Format("!{0}-ShareAssay", _version); ConsoleMessage.StartTest("Share assay with user: Setup", "ShareAssay"); try { Appium.Instance.Driver.LaunchApp(); LoginActivity.LoginStep(_user1, _timeout); TabMenu.Teams.Tap(); TeamActivity.NewTeam.Tap(); TeamCreateDialog.TeamName.EnterText(_team); TeamCreateDialog.Create.Tap(); TeamActivity.TeamMemberList.VerifyElementCountById(1, "user_picture"); //add user to team TeamActivity.AddUserToTeam(_user2.Name); TeamActivity.TeamMemberList.VerifyElementCountById(2, "user_picture"); CommonOperation.Delay(5); TabMenu.Logout.Tap(); } finally { Appium.Instance.Driver.CloseApp(); ConsoleMessage.EndTest(); } }
public void ShareLibraryAndRemoveUserFromTeamTest() { Permission permission = new Permission(false, true, true, true); ConsoleMessage.StartTest("Share library with team and remove user from team", "ShareLibrary"); //Login as Library owner and share a library with a Team Appium.Instance.Driver.LaunchApp(); LoginActivity.LoginStep(_user1, _timeout); TabMenu.Library.Tap(); LibraryActivity.LibraryList.FindAndTap(_baseLibrary); LibraryActivity.SelectAndShareLibrary(_baseLibrary, _shareName); LibraryShareDialog.ShareWithTeamStep(_team, permission); CommonOperation.Delay(_shareDelay); TabMenu.Logout.Tap(); //Login as a Team member and verify user received the shared library LoginActivity.LoginStep(_user2, _timeout); CommonOperation.Delay(_loginDelay); TabMenu.Library.Tap(); LibraryActivity.LibraryList.FindAndTap(_shareName); LibraryActivity.ElementList.VerifyElementCountById(1, "library_document_icon"); TabMenu.Logout.Tap(); //Login as Owner and add a new user to the team LoginActivity.LoginStep(_user1, _timeout); TabMenu.Teams.Tap(); CommonOperation.Delay(2); TeamActivity.TeamList.FindAndTap(_team); TeamActivity.AddUserToTeam(_user3.Name); TeamActivity.TeamMemberList.VerifyElementCountById(3, "user_picture"); CommonOperation.Delay(_shareDelay); TabMenu.Logout.Tap(); //Login as new user and verify user received shared library LoginActivity.LoginStep(_user3, _timeout); CommonOperation.Delay(_loginDelay); TabMenu.Library.Tap(); LibraryActivity.LibraryList.FindAndTap(_shareName); LibraryActivity.ElementList.VerifyElementCountById(1, "library_document_icon"); TabMenu.Logout.Tap(); //Login as Owner and remove the new user from the team LoginActivity.LoginStep(_user1, _timeout); TabMenu.Teams.Tap(); CommonOperation.Delay(2); TeamActivity.TeamList.FindAndTap(_team); TeamActivity.RemoveUserFromTeam(_user3.Name); TeamActivity.TeamMemberList.VerifyElementCountById(2, "user_picture"); CommonOperation.Delay(_shareDelay); TabMenu.Logout.Tap(); //Login as new user and verify user does not have the shared library LoginActivity.LoginStep(_user3, _timeout); CommonOperation.Delay(_loginDelay); TabMenu.Library.Tap(); LibraryActivity.VerifyLibraryNotExist(_shareName); TabMenu.Logout.Tap(); }
public void BeforeClass() { _user1 = Settings.Instance.User1; _user2 = Settings.Instance.User2; _user3 = Settings.Instance.User3; _timeout = Settings.Instance.LoginTimeout; _shareDelay = Settings.Instance.ShareDelay; _loginDelay = Settings.Instance.LoginDelay; _version = Settings.Instance.Version; _assay = string.Format("{0}-ShareFlowAndRemoveUserFromTeam", _version); _flow = string.Format("{0}-ShareFlowAndRemoveUserFromTeam", _version); _team = String.Format("!{0}-Flow{1}", _version, Settings.Instance.TeamRemove); ConsoleMessage.StartTest("Share flow with team and remove user from team: Setup", "ShareFlow"); try { Appium.Instance.Driver.LaunchApp(); LoginActivity.LoginStep(_user1, _timeout); BrowserActivity.CreateAssay(_assay); BrowserActivity.CreateFlow(_flow); BrowserActivity.FlowList.FindAndTap(_flow); FlowActivity.AddElement(element1); FlowActivity.AddElement(element2); FlowActivity.AddElement(element3); FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText"); //create team TabMenu.Teams.Tap(); CommonOperation.Delay(1); TeamActivity.NewTeam.Tap(); TeamCreateDialog.TeamName.EnterText(_team); TeamCreateDialog.Create.Tap(); TeamActivity.TeamMemberList.VerifyElementCountById(1, "user_picture"); //add user to team TeamActivity.AddUserToTeam(_user2.Name); TeamActivity.TeamMemberList.VerifyElementCountById(2, "user_picture"); CommonOperation.Delay(5); } finally { Appium.Instance.Driver.CloseApp(); ConsoleMessage.EndTest(); } }
public void BeforeClass() { _user1 = Settings.Instance.User1; _user2 = Settings.Instance.User2; _user3 = Settings.Instance.User3; _timeout = Settings.Instance.LoginTimeout; _shareDelay = Settings.Instance.ShareDelay; _loginDelay = Settings.Instance.LoginDelay; _version = Settings.Instance.Version; _team = String.Format("!{0}-Lib{1}", _version, Settings.Instance.TeamRemove); _baseLibrary = String.Format("!{0}-UserRemoveBase", _version); _shareName = String.Format("!{0}-UserRemove", _version); ConsoleMessage.StartTest("Share library with team and remove user from team: Setup", "ShareLibrary"); try { Appium.Instance.Driver.LaunchApp(); LoginActivity.LoginStep(_user1, _timeout); TabMenu.Library.Tap(); LibraryActivity.CreateLibrary(_baseLibrary); LibraryActivity.AddElement.Tap(); LibraryElementActivity.ElementName.ClearText(); LibraryElementActivity.ElementName.EnterText(element1); LibraryElementActivity.Ok.Tap(); LibraryActivity.ElementList.VerifyElementCountById(1, "library_document_icon"); //create team TabMenu.Teams.Tap(); CommonOperation.Delay(1); TeamActivity.NewTeam.Tap(); TeamCreateDialog.TeamName.EnterText(_team); TeamCreateDialog.Create.Tap(); TeamActivity.TeamMemberList.VerifyElementCountById(1, "user_picture"); //add user to team TeamActivity.AddUserToTeam(_user2.Name); TeamActivity.TeamMemberList.VerifyElementCountById(2, "user_picture"); CommonOperation.Delay(5); } finally { Appium.Instance.Driver.CloseApp(); ConsoleMessage.EndTest(); } }
public void Setup() { try { ConsoleMessage.StartTest("Flow Object: Chain and Exe: Setup", "FlowObject"); Appium.Instance.Driver.LaunchApp(); LoginActivity.LoginStep(_user1, _timeout); //create team TabMenu.Teams.Tap(); TeamActivity.NewTeam.Tap(); TeamCreateDialog.TeamName.EnterText(_team); TeamCreateDialog.Create.Tap(); TeamActivity.TeamMemberList.VerifyElementCountById(1, "user_picture"); TeamActivity.AddUserToTeam(_user2.Name); TeamActivity.TeamMemberList.VerifyElementCountById(2, "user_picture"); CommonOperation.Delay(5); TabMenu.Logout.Tap(); } finally { Appium.Instance.Driver.CloseApp(); ConsoleMessage.EndTest(); } }
public void ShareFlowAndRemoveUserFromTeamTest() { Permission permission = new Permission(false, true, true, true); //create flow ConsoleMessage.StartTest("Share flow with team and remove user from team", "ShareFlow"); //share flow Appium.Instance.Driver.LaunchApp(); LoginActivity.LoginStep(_user1, _timeout); BrowserActivity.AssayList.FindAndTap(_assay); BrowserActivity.FlowList.FindAndTap(_flow); FlowActivity.Share.Tap(); FlowActivity.ShareOk.Tap(); FlowShareDialog.ShareWithTeamStep(_team, permission); CommonOperation.Delay(_shareDelay); TabMenu.Logout.Tap(); //Login as a Team member and verify user received the shared flow LoginActivity.LoginStep(_user2, _timeout); CommonOperation.Delay(_loginDelay); BrowserActivity.AssayList.FindAndTap("Shared With: " + _team); BrowserActivity.FlowList.FindAndTap(_assay); BrowserActivity.FlowList.FindAndTap(_flow); FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText"); TabMenu.Logout.Tap(); //Login as Owner and add a new user to the team LoginActivity.LoginStep(_user1, _timeout); TabMenu.Teams.Tap(); CommonOperation.Delay(2); TeamActivity.TeamList.FindAndTap(_team); TeamActivity.AddUserToTeam(_user3.Name); TeamActivity.TeamMemberList.VerifyElementCountById(3, "user_picture"); CommonOperation.Delay(15); TabMenu.Logout.Tap(); //Login as new user and verify user received shared flow LoginActivity.LoginStep(_user3, _timeout); CommonOperation.Delay(_loginDelay); BrowserActivity.AssayList.FindAndTap("Shared With: " + _team); BrowserActivity.FlowList.FindAndTap(_assay); BrowserActivity.FlowList.FindAndTap(_flow); FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText"); TabMenu.Logout.Tap(); //Login as Owner and remove the new user from the team LoginActivity.LoginStep(_user1, _timeout); TabMenu.Teams.Tap(); CommonOperation.Delay(2); TeamActivity.TeamList.FindAndTap(_team); TeamActivity.RemoveUserFromTeam(_user3.Name); TeamActivity.TeamMemberList.VerifyElementCountById(2, "user_picture"); CommonOperation.Delay(15); TabMenu.Logout.Tap(); //Login as Owner and remove the new user from the team LoginActivity.LoginStep(_user3, _timeout); CommonOperation.Delay(_loginDelay); BrowserActivity.VerifyAssayNotExit("Shared With: " + _team); TabMenu.Logout.Tap(); }