예제 #1
0
        public void PlateTest()
        {
            string comp1 = "Component 1";
            string comp2 = "Component 2";
            string comp3 = "Component 3";
            string comp4 = "Component 4";
            string input = "10";

            ConsoleMessage.StartTest("PlateTest", "Plate");
            Appium.Instance.Driver.LaunchApp();
            LoginActivity.LoginStep(_user, _timeout);
            BrowserActivity.CreateAssay(_assay);
            BrowserActivity.CreateFlow(_flow);
            BrowserActivity.FlowList.FindAndTap(_flow);
            FlowActivity.AddElement(element);
            FlowActivity.OpenElement(element);
            FlowElementDialog.OpenPlugin.Tap();
            //chage size
            string[] size = { "2x3", "3x4", "4x6", "16x24", "8x12" };
            foreach (var s in size)
            {
                PlateActivity.ChangeSize(s);
                PlateActivity.VerifyCurrentSize(s);
            }
            //add labels
            PlateActivity.NewLabel.Tap();
            PlateActivity.NewLabel.Tap();
            PlateActivity.NewLabel.Tap();
            PlateActivity.NewLabel.Tap();
            PlateActivity.LabelList.VerifyElementCountById(4, "component_name");
            //fill wells
            PlateActivity.LabelList.FindAndTap(comp1);
            PlateActivity.TapByCoordinate(125, 420);
            PlateActivity.TapByCoordinate(275, 420);
            PlateActivity.TapByCoordinate(415, 420);
            PlateActivity.LabelList.FindAndTap(comp2);
            PlateActivity.TapByCoordinate(560, 420);
            PlateActivity.TapByCoordinate(700, 420);
            PlateActivity.TapByCoordinate(845, 420);
            PlateActivity.LabelList.FindAndTap(comp3);
            PlateActivity.TapByCoordinate(125, 560);
            PlateActivity.TapByCoordinate(275, 560);
            PlateActivity.TapByCoordinate(415, 560);
            PlateActivity.LabelList.FindAndTap(comp4);
            PlateActivity.TapByCoordinate(560, 560);
            PlateActivity.TapByCoordinate(700, 560);
            PlateActivity.TapByCoordinate(845, 560);
            //create sheet
            PlateActivity.AddSheet.Tap();
            PlateCreateSheetDialog.Name.EnterText("Test");
            PlateCreateSheetDialog.Ok.Tap();
            PlateActivity.SheetList.VerifyElementCountByClass(2, "android.widget.LinearLayout");

            //fill function
            PlateActivity.AddSheet.Tap();
            PlateCreateSheetDialog.Name.EnterText("Fill");
            PlateCreateSheetDialog.Ok.Tap();
            PlateActivity.SheetList.VerifyElementCountByClass(3, "android.widget.LinearLayout");
            PlateActivity.ToolEdit.Tap();
            PlateActivity.TapByCoordinate(125, 420);
            PlateWellEditDialog.Name.EnterText(input);
            PlateWellEditDialog.Ok.Tap();
            //fill right
            PlateActivity.ToolSelect.Tap();
            PlateActivity.TapByCoordinate(125, 420);
            PlateSelectionToolbar.FillRight.Tap();
            ConsoleMessage.TakeScreen("Verify: Fill Right");
            //fill down
            PlateActivity.ToolSelect.Tap();
            PlateActivity.TapByCoordinate(125, 420);
            PlateSelectionToolbar.FillDown.Tap();
            ConsoleMessage.TakeScreen("Verify: Fill Down");

            //dilute function
            PlateActivity.AddSheet.Tap();
            PlateCreateSheetDialog.Name.EnterText("Dilute");
            PlateCreateSheetDialog.Ok.Tap();
            PlateActivity.SheetList.VerifyElementCountByClass(4, "android.widget.LinearLayout");
            PlateActivity.ToolEdit.Tap();
            PlateActivity.TapByCoordinate(125, 420);
            PlateWellEditDialog.Name.EnterText(input);
            PlateWellEditDialog.Ok.Tap();
            //dilute right
            PlateActivity.ToolSelect.Tap();
            PlateActivity.TapByCoordinate(125, 420);
            PlateSelectionToolbar.DiluteRight.Tap();
            CommonOperation.HideKeyboard();
            PlateDiluteDialog.Ok.Tap();
            ConsoleMessage.TakeScreen("Verify: Dilute Right");
            //dilute down
            PlateActivity.ToolSelect.Tap();
            PlateActivity.TapByCoordinate(125, 420);
            PlateSelectionToolbar.DiluteDown.Tap();
            CommonOperation.HideKeyboard();
            PlateDiluteDialog.Ok.Tap();
            ConsoleMessage.TakeScreen("Verify: Dilute Down");

            //clear function
            PlateActivity.AddSheet.Tap();
            PlateCreateSheetDialog.Name.EnterText("Clear");
            PlateCreateSheetDialog.Ok.Tap();
            PlateActivity.SheetList.VerifyElementCountByClass(5, "android.widget.LinearLayout");
            PlateActivity.ToolEdit.Tap();
            PlateActivity.TapByCoordinate(125, 420);
            PlateWellEditDialog.Name.EnterText(input);
            PlateWellEditDialog.Ok.Tap();
            //clear
            PlateActivity.ToolClear.Tap();
            PlateActivity.TapByCoordinate(125, 420);
            PlateActivity.ToolEdit.Tap();
            PlateActivity.TapByCoordinate(125, 420);
            PlateWellEditDialog.Name.VerifyText("");
            CommonOperation.HideKeyboard();
            PlateWellEditDialog.Ok.Tap();
            TabMenu.Logout.Tap();
        }
예제 #2
0
        public void JitTest()
        {
            string key    = "MyKey";
            string filed1 = "Field1";
            string filed2 = "Field2";
            string filed3 = "Field3";
            string filed4 = "Field4";

            ConsoleMessage.StartTest("Jit Test", "Jit");
            Appium.Instance.Driver.LaunchApp();
            LoginActivity.LoginStep(_user, _timeout);
            BrowserActivity.CreateAssay(_assay);
            BrowserActivity.CreateFlow(_flow);
            BrowserActivity.FlowList.FindAndTap(_flow);
            FlowActivity.AddElement(element);
            FlowActivity.OpenElement(element);
            //add key
            JitActivity.AddKey.Tap();
            JitActivity.FieldName.EnterText(key);
            JitActivity.CreateField.Tap();
            JitActivity.FieldList.VerifyElementCountByClass(1, "android.widget.Button");
            //add 4 fields
            JitActivity.AddField.Tap();
            JitActivity.FieldName.EnterText(filed1);
            JitActivity.CreateField.Tap();
            JitActivity.AddField.Tap();
            JitActivity.FieldName.EnterText(filed2);
            JitActivity.CreateField.Tap();
            JitActivity.AddField.Tap();
            JitActivity.FieldName.EnterText(filed3);
            JitActivity.CreateField.Tap();
            JitActivity.AddField.Tap();
            JitActivity.FieldName.EnterText(filed4);
            JitActivity.CreateField.Tap();
            JitActivity.FieldList.VerifyElementCountByClass(5, "android.widget.Button");
            //add single row
            JitActivity.AddRow.Tap();
            JitActivity.TableList.VerifyElementCountById(1, "row_layout");
            //Set num row
            JitActivity.RowNumber.ClearText();
            JitActivity.RowNumber.EnterText("6");
            JitActivity.SetRowNum.Tap();
            JitActivity.TableList.VerifyElementCountById(6, "row_layout");
            JitActivity.RowNumber.ClearText();
            JitActivity.RowNumber.EnterText("4");
            JitActivity.SetRowNum.Tap();
            JitActivity.TableList.VerifyElementCountById(4, "row_layout");
            //populate row
            for (int i = 0; i < 4; i++)
            {
                JitActivity.PopulateCell(i, 0, (i + 1).ToString());
                JitActivity.VerifyCell(i, 0, (i + 1).ToString());
            }
            //set formula
            JitActivity.FieldList.FindAndTap(filed3);
            CommonOperation.HideKeyboard();
            JitFieldDialog.SetFormula.Tap();
            JitFormulaDialog.FormulaExpression.EnterText("20 + [Field1]");
            JitFormulaDialog.Ok.Tap();
            JitFieldDialog.Ok.Tap();
            for (int i = 0; i < 4; i++)
            {
                JitActivity.VerifyCell(i, 2, (i + 21).ToString("0.0", System.Globalization.CultureInfo.InvariantCulture));
            }
            //update formula
            JitActivity.FieldList.FindAndTap(filed3);
            CommonOperation.HideKeyboard();
            JitFieldDialog.SetFormula.Tap();
            CommonOperation.DeleteText(JitFormulaDialog.FormulaExpression.GetInternalElement());
            JitFormulaDialog.FormulaExpression.EnterText("20 * [Field1]");
            JitFormulaDialog.Ok.Tap();
            JitFieldDialog.Ok.Tap();
            for (int i = 0; i < 4; i++)
            {
                JitActivity.VerifyCell(i, 2,
                                       ((i + 1) * 20).ToString("0.0", System.Globalization.CultureInfo.InvariantCulture));
            }
            //delete formula
            JitActivity.FieldList.FindAndTap(filed3);
            CommonOperation.HideKeyboard();
            JitFieldDialog.SetFormula.Tap();
            CommonOperation.DeleteText(JitFormulaDialog.FormulaExpression.GetInternalElement());
            JitFormulaDialog.Ok.Tap();
            JitFieldDialog.Ok.Tap();
            ConsoleMessage.TakeScreen("Verify, formula is deleted");
            //create group
            JitActivity.Groups.Tap();
            JitGroupCreateDialog.GroupNumber.ClearText();
            JitGroupCreateDialog.GroupNumber.EnterText("2");
            JitGroupCreateDialog.GroupSize.ClearText();
            JitGroupCreateDialog.GroupSize.EnterText("2");
            JitGroupCreateDialog.Create.Tap();
            JitGroupActivity.ClickEditGroupName("Group 1");
            JitGroupNameDialog.GroupName.EnterText("MyGroup1");
            JitGroupNameDialog.Ok.Tap();
            JitGroupActivity.ClickEditGroupName("Group 2");
            JitGroupNameDialog.GroupName.EnterText("MyGroup2");
            JitGroupNameDialog.Ok.Tap();
            JitGroupActivity.ClickExpand("MyGroup1");
            JitGroupActivity.ClickExpand("MyGroup2");
            JitGroupActivity.MoveGroupRow(0, 1, 1, 1);
            JitGroupActivity.VerifyFroupRow(1, 3);
            JitGroupActivity.MoveToNotInGroup(1, 1);
            JitGroupActivity.NotInGroupList.VerifyElementCountById(1, "row_layout");
            JitGroupActivity.MoveFromNotInGroupToGroup(0, 0, 1);
            JitGroupActivity.NotInGroupList.VerifyElementCountById(0, "row_layout");
            ConsoleMessage.TakeScreen("Jit group activity");
            JitGroupActivity.Close.Tap();
            //show/hide functionality
            JitActivity.ShowGroups.Tap();
            JitActivity.VerifyGroupIsShown(0, "MyGroup1 - 1");
            JitActivity.VerifyGroupIsShown(1, "MyGroup1 - 2");
            JitActivity.VerifyGroupIsShown(2, "MyGroup2 - 1");
            JitActivity.VerifyGroupIsShown(3, "MyGroup2 - 2");
            JitActivity.HideGroups.Tap();
            JitActivity.VerifyGroupIsHide();
            //show/hide functionality
            JitActivity.ShowGroups.Tap();
            JitActivity.Ungroup.Tap();
            JitUngroupDialog.Ungroup.Tap();
            JitActivity.VerifyGroupIsHide();
            JitActivity.Close.Tap();

            //add second jit
            string secFiled1 = "Second_Field1";
            string secFiled2 = "Second_Field2";

            FlowActivity.AddElement(element);
            CommonOperation.Delay(1);
            FlowActivity.OpenElement(1);
            //select key field
            JitActivity.SelectKeyField.Tap();
            JitSelectKeyDialog.KeyList.FindAndTap(key);
            JitActivity.FieldList.VerifyElementCountByClass(5, "android.widget.Button");
            JitActivity.AddField.Tap();
            JitActivity.FieldName.EnterText(secFiled1);
            JitActivity.CreateField.Tap();
            JitActivity.AddField.Tap();
            JitActivity.FieldName.EnterText(secFiled2);
            JitActivity.CreateField.Tap();
            JitActivity.FieldList.VerifyElementCountByClass(7, "android.widget.Button");
            //populate row
            for (int i = 0; i < 4; i++)
            {
                JitActivity.PopulateCell(i, 0, (i + 100).ToString());
                JitActivity.VerifyCell(i, 0, (i + 100).ToString());
            }
            //show/hide functionality
            JitActivity.HideAll.Tap();
            JitActivity.FieldList.VerifyElementCountByClass(3, "android.widget.Button");
            JitActivity.ShowAll.Tap();
            JitActivity.FieldList.VerifyElementCountByClass(7, "android.widget.Button");
            JitActivity.Close.Tap();
            TabMenu.Logout.Tap();
        }
        public void ChainFlowsAndExe()
        {
            string parentFlow  = "Parent";
            string nestedFlow1 = "Nested1";
            string nestedFlow2 = "Nested2";

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

            //setup nested1
            BrowserActivity.CreateFlow(nestedFlow1);
            BrowserActivity.FlowList.FindAndTap(nestedFlow1);
            FlowActivity.AddElement("Add");
            FlowActivity.AddElement("Flow");
            FlowActivity.ElementList.VerifyElementCountByClass(2, "android.widget.EditText");
            TabMenu.Browser.Tap();

            //setup nested2
            BrowserActivity.CreateFlow(nestedFlow2);
            BrowserActivity.FlowList.FindAndTap(nestedFlow2);
            FlowActivity.AddElement("Aspirate");
            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();


            //link nested1 and nested2
            FlowActivity.ElementList.FindAndTap("Flow");
            FlowElementDialog.SelectFlow.Tap();
            FlowSelectNesting.ItemList.FindAndTap(_assay);
            FlowSelectNesting.ItemList.FindAndTap(nestedFlow2);
            FlowElementDialog.Ok.Tap();
            FlowActivity.ElementList.FindAndTap(nestedFlow2);
            FlowElementDialog.ShowNested.Tap();
            CommonOperation.Delay(1);

            //move to parent and start flow
            FlowActivity.NavPanel(NavPanel.Parent);
            FlowActivity.Start.Tap();
            FlowStartDialog.Ok.Tap();
            FlowSelectAssayDialog.AssayList.FindAndTap(_preExeAssay);
            CommonOperation.Delay(2);
            FlowActivity.OpenElement(0);
            FlowElementDialog.Done.Tap();
            FlowActivity.OpenElement(1);
            FlowElementDialog.Done.Tap();
            FlowActivity.OpenElement(2);
            FlowElementDialog.ShowNested.Tap();

            //exe nested1
            FlowActivity.Start.Tap();
            FlowStartDialog.Ok.Tap();
            FlowActivity.OpenElement(0);
            FlowElementDialog.Done.Tap();
            FlowActivity.OpenElement(1);
            FlowElementDialog.ShowNested.Tap();

            //exe nested2
            FlowActivity.Start.Tap();
            FlowStartDialog.Ok.Tap();
            FlowActivity.OpenElement(0);
            FlowElementDialog.Done.Tap();
            //sign nested2
            FlowSignActivity.SignSignature.Tap();
            SignDialog.Ok.Tap();
            FlowSignActivity.Ok.Tap();

            //move to nested1 and finish
            FlowActivity.NavPanel(NavPanel.Nested1);
            FlowActivity.OpenElement(1);
            FlowElementDialog.Done.Tap();
            //sign nested1
            FlowSignActivity.SignSignature.Tap();
            SignDialog.Ok.Tap();
            FlowSignActivity.Ok.Tap();

            //move to parent and finish
            FlowActivity.NavPanel(NavPanel.Parent);
            FlowActivity.OpenElement(2);
            FlowElementDialog.Done.Tap();
            //sign parent
            FlowSignActivity.SignSignature.Tap();
            SignDialog.Ok.Tap();
            FlowSignActivity.Ok.Tap();
        }