public void ChainFlowsAndExe()
        {
            string     parentFlow  = "Parent";
            string     nestedFlow1 = "Nested1";
            Permission permission  = new Permission(true, true, true, true);

            ConsoleMessage.StartTest("Flow Object: Chain and Exe", "FlowObject");
            Appium.Instance.Driver.LaunchApp();
            LoginActivity.LoginStep(_user1, _timeout);
            BrowserActivity.CreateAssay(_assay);
            //setup parent
            BrowserActivity.CreateFlow(parentFlow);
            BrowserActivity.FlowList.FindAndTap(parentFlow);
            FlowActivity.AddElement("Add");
            FlowActivity.AddElement("Flow");
            FlowActivity.ElementList.VerifyElementCountByClass(2, "android.widget.EditText");
            TabMenu.Browser.Tap();
            //setup nested1
            BrowserActivity.AssayList.FindAndTap(_assay);
            BrowserActivity.CreateFlow(nestedFlow1);
            BrowserActivity.FlowList.FindAndTap(nestedFlow1);
            FlowActivity.AddElement("Add");
            FlowActivity.ElementList.VerifyElementCountByClass(1, "android.widget.EditText");
            TabMenu.Browser.Tap();

            //link parent and nested1
            BrowserActivity.AssayList.FindAndTap(_assay);
            BrowserActivity.FlowList.FindAndTap(parentFlow);
            FlowActivity.ElementList.FindAndTap("Flow");
            FlowElementDialog.SelectFlow.Tap();
            FlowSelectNesting.ItemList.FindAndTap(_assay);
            FlowSelectNesting.ItemList.FindAndTap(nestedFlow1);
            FlowElementDialog.Ok.Tap();
            FlowActivity.ElementList.FindAndTap(nestedFlow1);
            FlowElementDialog.ShowNested.Tap();
            FlowActivity.FlowName.VerifyText(nestedFlow1);
            FlowActivity.NavPanel(NavPanel.Parent);
            //share
            FlowActivity.Share.Tap();
            FlowActivity.ShareOk.Tap();
            FlowShareNestedDialog.Yes.Tap();
            FlowShareDialog.ShareWithUserStep(_team, _user2.Name, permission);
            CommonOperation.Delay(_shareDelay);
            TabMenu.Logout.Tap();

            //check shared flow on recipient
            LoginActivity.LoginStep(_user2, _timeout);
            CommonOperation.Delay(_loginDelay);
            BrowserActivity.AssayList.FindAndTap("Shared With: " + _user1.Name);
            BrowserActivity.FlowList.FindAndTap(_assay);
            BrowserActivity.FlowList.FindAndTap(parentFlow);
            FlowActivity.ElementList.VerifyElementCountByClass(2, "android.widget.EditText");
            FlowActivity.ElementList.FindAndTap(nestedFlow1);
            FlowElementDialog.ShowNested.Tap();
            FlowActivity.FlowName.VerifyText(nestedFlow1);
        }
        public void ViewOnly()
        {
            string     flowName   = "View";
            Permission permission = new Permission(true, false, false, false);

            //create flow
            ConsoleMessage.StartTest("Share flow with user: View", "ShareFlow");
            Appium.Instance.Driver.LaunchApp();
            LoginActivity.LoginStep(_user1, _timeout);
            BrowserActivity.AssayList.FindAndTap(_assay);
            BrowserActivity.CreateFlow(flowName);
            BrowserActivity.FlowList.FindAndTap(flowName);
            FlowActivity.AddElement(element1);
            FlowActivity.AddElement(element2);
            FlowActivity.AddElement(element3);
            FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText");
            //share

            //worked
//            FlowActivity.Share.Tap();
//            FlowActivity.ShareOk.Tap();
//            FlowShareDialog.TeamList.FindAndTap(_team);
//            FlowShareDialog.AddUser(_user2.Name);
//            FlowShareDialog.ShareWithList.VerifyElementCountById(1, "user_picture");
//            FlowShareDialog.SetPermission(permission);
//            FlowShareDialog.Ok.Tap();

            FlowActivity.Share.Tap();
            FlowActivity.ShareOk.Tap();
            FlowShareDialog.ShareWithUserStep(_team, _user2.Name, permission);
            CommonOperation.Delay(_shareDelay);
            TabMenu.Logout.Tap();
            //verify
            LoginActivity.LoginStep(_user2, _timeout);
            CommonOperation.Delay(_loginDelay);
            BrowserActivity.AssayList.FindAndTap("Shared With: " + _user1.Name);
            BrowserActivity.FlowList.FindAndTap(_assay);
            BrowserActivity.FlowList.FindAndTap(flowName);
            FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText");
            //verify can't add element
            FlowActivity.AddElement("Add");
            FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText");
            //verify can't delete element
            FlowActivity.DeleteElement("Add");
            FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText");
            //verify can't share flow
            FlowActivity.Share.Tap();
            FlowPermissionErrorDialog.DialogName.VerifyText("Share Permission");
            FlowPermissionErrorDialog.Ok.Tap();
            //verify can't delete flow
            FlowActivity.DeleteFlow.Tap();
            FlowPermissionErrorDialog.DialogName.VerifyText("Delete Permission");
            FlowPermissionErrorDialog.Ok.Tap();
            TabMenu.Logout.Tap();
        }
        public void Unshare()
        {
            string     flowName   = "Unshare";
            Permission permission = new Permission(true, true, true, true);

            //create flow
            ConsoleMessage.StartTest("Share flow with user: Unshare", "ShareFlow");
            Appium.Instance.Driver.LaunchApp();
            LoginActivity.LoginStep(_user1, _timeout);
            BrowserActivity.AssayList.FindAndTap(_assay);
            BrowserActivity.CreateFlow(flowName);
            BrowserActivity.FlowList.FindAndTap(flowName);
            FlowActivity.AddElement(element1);
            FlowActivity.AddElement(element2);
            FlowActivity.AddElement(element3);
            FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText");
            //share
            FlowActivity.Share.Tap();
            FlowActivity.ShareOk.Tap();
            FlowShareDialog.ShareWithUserStep(_team, _user2.Name, permission);
            CommonOperation.Delay(_shareDelay);
            TabMenu.Logout.Tap();
            //verify
            LoginActivity.LoginStep(_user2, _timeout);
            CommonOperation.Delay(_loginDelay);
            BrowserActivity.AssayList.FindAndTap("Shared With: " + _user1.Name);
            BrowserActivity.FlowList.FindAndTap(_assay);
            BrowserActivity.FlowList.FindAndTap(flowName);
            FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText");
            TabMenu.Logout.Tap();

            //unshare
            LoginActivity.LoginStep(_user1, _timeout);
            BrowserActivity.AssayList.FindAndTap(_assay);
            BrowserActivity.FlowList.FindAndTap(flowName);
            FlowActivity.Permission.Tap();
            FlowShareDialog.Unshare(_user2.Name);
            FlowShareDialog.ShareWithList.VerifyElementCountById(0, "user_picture");
            FlowShareDialog.Ok.Tap();
            CommonOperation.Delay(_shareDelay);
            TabMenu.Logout.Tap();

            //verify flow not exist
            LoginActivity.LoginStep(_user2, _timeout);
            CommonOperation.Delay(_loginDelay);
            BrowserActivity.AssayList.FindAndTap("Shared With: " + _user1.Name);
            BrowserActivity.FlowList.FindAndTap(_assay);
            BrowserActivity.VerifyFlowNotExist(flowName);
            TabMenu.Logout.Tap();
        }
        public void ShareFlowAsBlocked()
        {
            string     flowName   = "BlockedBase";
            Permission permission = new Permission(true, true, true, true);

            //create flow
            ConsoleMessage.StartTest("Share flow with user: Share As Blocked", "ShareFlow");
            Appium.Instance.Driver.LaunchApp();
            LoginActivity.LoginStep(_user1, _timeout);
            BrowserActivity.AssayList.FindAndTap(_assay);
            BrowserActivity.CreateFlow(flowName);
            BrowserActivity.FlowList.FindAndTap(flowName);
            FlowActivity.AddElement(element1);
            FlowActivity.AddElement(element2);
            FlowActivity.AddElement(element3);
            FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText");
            FlowActivity.Share.Tap();
            FlowActivity.TapOnFlowElement(0);
            FlowActivity.ShareOk.Tap();
            FlowShareDialog.TeamList.FindAndTap(_team);
            FlowShareDialog.AddUser(_user2.Name);
            FlowShareDialog.ShareWithList.VerifyElementCountById(1, "user_picture");
            FlowShareDialog.SetPermission(permission);
            FlowShareDialog.Ok.Tap();
            FlowSelectAssayDialog.AssayList.FindAndTap(_assay);
            FlowActivity.VerifyElementName(0, "Blocked");
            CommonOperation.Delay(_shareDelay);
            TabMenu.Logout.Tap();

            //verify blocked flow
            LoginActivity.LoginStep(_user2, _timeout);
            CommonOperation.Delay(_loginDelay);
            BrowserActivity.AssayList.FindAndTap("Shared With: " + _user1.Name);
            BrowserActivity.FlowList.FindAndTap(_assay);
            BrowserActivity.FlowList.FindAndTap(flowName + "-BLK");
            FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText");
            FlowActivity.VerifyElementName(0, "Blocked");
            TabMenu.Logout.Tap();
        }
예제 #5
0
        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();
        }