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();
        }
예제 #2
0
        public void SingleFlowTest()
        {
            ConsoleMessage.StartTest("Flow Test", "Flow");
            Appium.Instance.Driver.LaunchApp();
            LoginActivity.LoginStep(_user, _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");
            //delete element
            FlowActivity.DeleteElement(element3);
            FlowActivity.ElementList.VerifyElementCountByClass(2, "android.widget.EditText");
            //property test
            FlowActivity.ElementList.FindAndTap(element1);
            //add property
            FlowElementDialog.AddProperty.Tap();
            FlowPropertyDialog.PropertyName.EnterText("propName1");
            FlowPropertyDialog.PropertyValue.EnterText("propValue1");
            FlowPropertyDialog.PropertyType.Tap();
            ComboBoxItemDialog.FindAndTap("Text");
            FlowPropertyDialog.VerifyPropertyType("Text");
            FlowPropertyDialog.Ok.Tap();
            FlowElementDialog.PropertyList.VerifyElementCountByClass(1, "android.widget.RelativeLayout");
            FlowElementDialog.VerifyPropertyValue("propName1", "propValue1");
            //change property value
            FlowElementDialog.OpenProperty("propName1");
            FlowPropertyDialog.PropertyValue.EnterText("CanChange");
            FlowPropertyDialog.Ok.Tap();
            FlowElementDialog.VerifyPropertyValue("propName1", "CanChange");

            //add second property
            FlowElementDialog.AddProperty.Tap();
            FlowPropertyDialog.PropertyName.EnterText("propName2");
            FlowPropertyDialog.PropertyValue.EnterText("propValue2");
            FlowPropertyDialog.IsRequired.Tap();
            FlowPropertyDialog.IsRequired.VerifyStatus(true);
            FlowPropertyDialog.Ok.Tap();
            FlowElementDialog.PropertyList.VerifyElementCountByClass(2, "android.widget.RelativeLayout");
            FlowElementDialog.VerifyPropertyMarkAsRequired("propName2");
            //delete property
            FlowElementDialog.DeleteProperty("propName1");
            FlowElementDialog.PropertyList.VerifyElementCountByClass(1, "android.widget.RelativeLayout");
            FlowElementDialog.DeleteProperty("propName2");
            FlowElementDialog.PropertyList.VerifyElementCountByClass(0, "android.widget.RelativeLayout");

            //swap properies
            //add property
            FlowElementDialog.AddProperty.Tap();
            FlowPropertyDialog.PropertyName.EnterText("swap1");
            FlowPropertyDialog.Ok.Tap();
            //add property
            FlowElementDialog.AddProperty.Tap();
            FlowPropertyDialog.PropertyName.EnterText("swap2");
            FlowPropertyDialog.Ok.Tap();
            //add property
            FlowElementDialog.AddProperty.Tap();
            FlowPropertyDialog.PropertyName.EnterText("swap3");
            FlowPropertyDialog.Ok.Tap();
            FlowElementDialog.PropertyList.VerifyElementCountByClass(3, "android.widget.RelativeLayout");
            FlowElementDialog.SwapProperty("swap1", "swap3");
            FlowElementDialog.VerifyPropertyAtPosition(2, "swap1");
            FlowElementDialog.Ok.Tap();

            //delete flow
            FlowActivity.DeleteFlow.Tap();
            FlowDeleteDialog.Delete.Tap();
            BrowserActivity.VerifyFlowNotExist(_flow);
            BrowserActivity.DeleteAssay.Tap();
            AssayDeleteDialog.Delete.Tap();
            BrowserActivity.VerifyAssayNotExit(_assay);
        }