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();
        }
Пример #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);
        }