Beispiel #1
0
 public RecordSetBases(ScenarioContext scenarioContext)
 {
     if (scenarioContext == null)
     {
         throw new ArgumentNullException("scenarioContext");
     }
     this.scenarioContext = scenarioContext;
     _commonSteps         = new CommonSteps(this.scenarioContext);
 }
 public SchedulerSteps(ScenarioContext scenarioContext)
 {
     if (scenarioContext == null)
     {
         throw new ArgumentNullException("scenarioContext");
     }
     _scenarioContext = scenarioContext;
     _commonSteps     = new CommonSteps(_scenarioContext);
 }
 public SequenceSteps(ScenarioContext scenarioContext)
     : base(scenarioContext)
 {
     if (scenarioContext == null)
     {
         throw new ArgumentNullException("scenarioContext");
     }
     this.scenarioContext = scenarioContext;
     _commonSteps         = new CommonSteps(this.scenarioContext);
 }
        public void WhenANewEventEOfTypeTestAggregateCreatedIsAppliedToTheAggregateWithId(string @eventName, Guid aggregateId)
        {
            var createdEvent = new TestAggregateCreatedEvent(aggregateId);

            ScenarioContext.Current.Set <IEvent>(createdEvent, @eventName);

            var aggregate = ScenarioContext.Current.Get <IAggregate>();

            CommonSteps.RunExceptionControlledStep(() => aggregate.ApplyEvent(createdEvent));
        }
Beispiel #5
0
        public void GivenCountOnInto(string parentName, string activityName, string recordSet, string result)
        {
            CommonSteps.AddVariableToVariableList(result);

            DsfCountRecordsetActivity countRecordsetActivity = new DsfCountRecordsetActivity {
                CountNumber = result, RecordsetName = recordSet, DisplayName = activityName
            };

            CommonSteps.AddActivityToActivityList(parentName, activityName, countRecordsetActivity);
        }
        public void WhenANewEventOfTypeTestAggregateOtherIsAppliedToTheAggregate(string @eventName)
        {
            var otherEvent = new TestAggregateOtherEvent();

            ScenarioContext.Current.Set <IEvent>(otherEvent, @eventName);

            var aggregate = ScenarioContext.Current.Get <IAggregate>();

            CommonSteps.RunExceptionControlledStep(() => aggregate.ApplyEvent(otherEvent));
        }
Beispiel #7
0
        public void GivenCalculateWithFormulaInto(string parentName, string activityName, string formula, string resultVariable)
        {
            CommonSteps.AddVariableToVariableList(resultVariable);

            DsfCalculateActivity calculateActivity = new DsfCalculateActivity {
                Expression = formula, Result = resultVariable, DisplayName = activityName
            };

            CommonSteps.AddActivityToActivityList(parentName, activityName, calculateActivity);
        }
Beispiel #8
0
        public void GivenIHaveASequence(string sequenceName)
        {
            var dsfSequence = new DsfSequenceActivity {
                DisplayName = sequenceName
            };

            ScenarioContext.Current.Add("activityList", new Dictionary <string, Activity>());
            ScenarioContext.Current.Add("activity", dsfSequence);
            CommonSteps.AddActivityToActivityList("", sequenceName, dsfSequence);
            Assert.AreEqual(enFindMissingType.Sequence, dsfSequence.GetFindMissingType());
        }
        public void WhenISplit(ActionSide side, string countWord, Location from, Location to)
        {
            var count = CommonSteps.ParseWordNumber(countWord);

            Assert.NotNull(_context.BoardState, "Board State has not been initialized.");
            var action = new GameSplitAction {
                Location = from, Side = side, Target = to, Size = count
            };

            TryApplyAction(action, from, to);
        }
Beispiel #10
0
        public SchedulerSteps(ScenarioContext scenarioContext)
        {
            if (scenarioContext == null)
            {
                throw new ArgumentNullException("scenarioContext");
            }

            _scenarioContext = scenarioContext;
            _commonSteps     = new CommonSteps(_scenarioContext);
            CustomContainer.Register(new Mock <IExplorerTooltips>().Object);
        }
Beispiel #11
0
        public void ThenTheHistoryDebugOutputForForRowIs(string p0, int p1, Table table)
        {
            IList <IResourceHistory> resources = ScenarioContext.Current["History"] as IList <IResourceHistory>;
            // ReSharper disable AssignNullToNotNullAttribute
            var debug = resources.First().DebugOutput;
            // ReSharper restore AssignNullToNotNullAttribute
            var debugTocompare = debug.Last();
            var commonSteps    = new CommonSteps();

            commonSteps.ThenTheDebugOutputAs(table, debugTocompare.Outputs.SelectMany(s => s.ResultsList).ToList(), true);
        }
Beispiel #12
0
        public void ThenTestWillBeCreated()
        {
            //Переключаемся на первую вкладку, обновляем таблицу
            CommonSteps common = new CommonSteps();

            FirstTab = common.ThenTheTabWithTitleShouldBeOpened("BatchDropper");
            BDNewTestPage  BDNewTest  = new BDNewTestPage(FirstTab);
            BDDictTestPage BDDictTest = new BDDictTestPage();

            BDDictTest.CheckCountOfTests();
            // и проверяем что запись добавлена
            IsTrue(BDDictTest.AssertCountOfTestInfo(), "Не найдена информация о количестве записей");
        }
Beispiel #13
0
        public void WhenANewEventOfTypeTestAggregateModifiedVersionTwoIsAppliedToTheAggregateWithValue(string @eventName, string value, int intValue)
        {
            var modifiedEvent = new TestAggregateModifiedEvent_V2()
            {
                Value = value, IntValue = intValue
            };

            ScenarioContext.Current.Set <IEvent>(modifiedEvent, @eventName);

            var aggregate = ScenarioContext.Current.Get <IAggregate>();

            CommonSteps.RunExceptionControlledStep(() => aggregate.ApplyEvent(modifiedEvent));
        }
Beispiel #14
0
        public void LoginTest()
        {
            var testUser1 = new PortalUser(CommonVar.TestRep1);

            var(Username, Driver, _) = DriverHelper.GetUsersDriver <TWebDriver>(testUser1.UserName);

            var commonStepsUser1 = new CommonSteps(Username, Driver);

            CommonSteps.Login(new List <CommonSteps>()
            {
                commonStepsUser1
            });
        }
Beispiel #15
0
        public void ThenDebugOutputsAs(string toolName, Table table)
        {
            Dictionary <string, Activity> activityList;

            ScenarioContext.Current.TryGetValue("activityList", out activityList);
            DsfSequenceActivity sequence;

            ScenarioContext.Current.TryGetValue("activity", out sequence);
            var         sequenceActivity = sequence.Activities.ToList().FirstOrDefault(activity => activity.DisplayName == toolName) ?? activityList[toolName];
            var         actualDebugItems = GetDebugOutputItemResults(sequenceActivity);
            CommonSteps commonSteps      = new CommonSteps();

            commonSteps.ThenTheDebugOutputAs(table, actualDebugItems);
        }
Beispiel #16
0
        public void GivenItContainsCaseConvertAs(string parentName, string activityName, Table table)
        {
            DsfCaseConvertActivity activity = new DsfCaseConvertActivity {
                DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variableToConvert = tableRow["Variable"];
                var conversionType    = tableRow["Type"];

                activity.ConvertCollection.Add(new CaseConvertTO(variableToConvert, conversionType, variableToConvert, 1, true));
            }

            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Beispiel #17
0
        public void WhenICreateTestWithCells(int count)
        {
            BDMainPage BDMain = new BDMainPage();

            BDMain.OpenDictionaries();
            IsTrue(BDMain.AssertOpenDictTest(), "Не найден заголовок на странице Тесты");

            BDDictTestPage BDDictTest = new BDDictTestPage();

            BDDictTest.ClickAddTestBtn();


            CommonSteps commons = new CommonSteps();

            SecondTab = commons.ThenTheTabWithTitleShouldBeOpened("BatchDropper");
            BDNewTestPage BDNewTest = new BDNewTestPage(SecondTab);

            BDNewTest.SetNameOfTest();

            //BDNewTest.SetControlOption();

            BDNewTest.SetNameOfProgAmp();
            BDNewTest.SetTubeVolume();
            BDNewTest.SetCheckboxIsActive();

            for (int i = 1; i < count; i++)
            {
                BDNewTest.ClickTheAddCellBtn();
                System.Threading.Thread.Sleep(200);
            }

            for (int j = 0; j < count; j++)
            {
                BDNewTest.SetNameForSomeCell(j);
                //BDNewTest.SetControlOfSomeCell(j); //неактуально
                BDNewTest.SetFirstChannelOfSomeCell(j);
                System.Threading.Thread.Sleep(500);
            }

            for (int k = 1; k < count; k++)
            {
                // BDNewTest.SetStandartOfSomeCell(k);
                //  BDNewTest.SetReagentOfSomeCell(k);
            }

            BDNewTest.SaveTest();
        }
Beispiel #18
0
 public static void SearchSubmissionWithAutoClient(string strProvince, string strBaseEntPrName, string[] serviceNames)
 {
     BasePage.validation.StringLogger.LogWrite("************TC_InternalCallTestHarness - Execution Begin**************");
     KYC_Domain.Harness.TestClientPage.LoginPage
     .RadioButtonSelect()
     .SelectDropDown()
     .NavBar.GoToUserAccountSetup()
     .SelectUser()
     .NavBar.GoToSearchSubmit()
     .SubmitSearchDetails(strProvince, strBaseEntPrName)
     .SelectEnterprise()
     .SelectServices(serviceNames)
     .NavBar.SignOut();
     CommonSteps.AdminLoginAndGetPackageId("", serviceNames.Length);
     CommonSteps.AutoClientComplete();
     CommonSteps.ClientLoginAndCheckResults(strProvince, serviceNames);
 }
Beispiel #19
0
        public void GivenItContainsBaseConvertAs(string parentName, string activityName, Table table)
        {
            DsfBaseConvertActivity activity = new DsfBaseConvertActivity {
                DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variableToConvert = tableRow["Variable"];
                var from = tableRow["From"];
                var to   = tableRow["To"];

                activity.ConvertCollection.Add(new BaseConvertTO(variableToConvert, from, to, variableToConvert, 1, true));
            }

            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Beispiel #20
0
        public void GivenItContainsDeleteAs(string parentName, string activityName, Table table)
        {
            DsfDeleteRecordActivity activity = new DsfDeleteRecordActivity {
                DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var result   = tableRow["result"];
                var variable = tableRow["Variable"];

                CommonSteps.AddVariableToVariableList(result);
                activity.RecordsetName = variable;
                activity.Result        = result;
            }

            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Beispiel #21
0
        public void GivenItContainsGatherSystemInfoAs(string parentName, string activityName, Table table)
        {
            var activity = new DsfGatherSystemInformationActivity {
                DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variable = tableRow["Variable"];

                CommonSteps.AddVariableToVariableList(variable);

                enTypeOfSystemInformationToGather systemInfo = (enTypeOfSystemInformationToGather)Dev2EnumConverter.GetEnumFromStringDiscription(tableRow["Selected"], typeof(enTypeOfSystemInformationToGather));
                activity.SystemInformationCollection.Add(new GatherSystemInformationTO(systemInfo, variable, 1));
            }

            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Beispiel #22
0
        private static ValidationType ValidateLocationSideCountInternal(ActionSide side, string countWord, Location location)
        {
            var count      = CommonSteps.ParseWordNumber(countWord);
            var validation = new ValidationType {
                Location = location, Size = count, Type = ValidationFlag.Normal
            };

            if (side == ActionSide.Blue)
            {
                validation.Contents = ValidationPiece.Blue;
            }
            else if (side == ActionSide.Red)
            {
                validation.Contents = ValidationPiece.Red;
            }

            return(validation);
        }
Beispiel #23
0
        public void GivenItContainsDataMergeAs(string parentName, string activityName, string resultVariable, Table table)
        {
            DsfDataMergeActivity activity = new DsfDataMergeActivity {
                Result = resultVariable, DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variable  = tableRow["Variable"];
                var type      = tableRow["Type"];
                var at        = tableRow["Using"];
                var padding   = tableRow["Padding"];
                var alignment = tableRow["Alignment"];

                activity.MergeCollection.Add(new DataMergeDTO(variable, type, at, 1, padding, alignment, true));
            }
            CommonSteps.AddVariableToVariableList(resultVariable);
            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Beispiel #24
0
        public void GivenItContainsReplaceIntoAs(string parentName, string activityName, string resultVariable, Table table)
        {
            DsfReplaceActivity activity = new DsfReplaceActivity {
                Result = resultVariable, DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variable     = tableRow["In Fields"];
                var find         = tableRow["Find"];
                var replaceValue = tableRow["Replace With"];

                activity.FieldsToSearch = variable;
                activity.Find           = find;
                activity.ReplaceWith    = replaceValue;
            }
            CommonSteps.AddVariableToVariableList(resultVariable);
            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Beispiel #25
0
        public void GivenItContainsFindRecordIndexSearchAndResultAs(string parentName, string activityName, string recsetToSearch, string resultVariable, Table table)
        {
            var result = resultVariable;
            var recset = recsetToSearch;

            CommonSteps.AddVariableToVariableList(result);
            DsfFindRecordsMultipleCriteriaActivity activity = new DsfFindRecordsMultipleCriteriaActivity {
                RequireAllFieldsToMatch = false, RequireAllTrue = false, Result = result, FieldsToSearch = recset, DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var matchType  = tableRow["Match Type"];
                var matchValue = tableRow["Match"];

                activity.ResultsCollection.Add(new FindRecordsTO(matchValue, matchType, 1, true));
            }

            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Beispiel #26
0
        public void GivenItContainFindUniqueAs(string parentName, string activityName, Table table)
        {
            DsfUniqueActivity activity = new DsfUniqueActivity {
                DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var inFields     = tableRow["In Fields"];
                var returnFields = tableRow["Return Fields"];
                var result       = tableRow["Result"];

                activity.InFields     = inFields;
                activity.ResultFields = returnFields;
                activity.Result       = result;

                CommonSteps.AddVariableToVariableList(result);
            }
            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Beispiel #27
0
 public static void SearchSubmission(string strProvince, string strBaseEntPrName, string[] serviceNames)
 {
     BasePage.validation.StringLogger.LogWrite("************TC_InternalCallTestHarness - Execution Begin**************");
     KYC_Domain.Harness.TestClientPage.LoginPage
     .RadioButtonSelect()
     .SelectDropDown()
     .NavBar.GoToUserAccountSetup()
     .SelectUser()
     .NavBar.GoToSearchSubmit()
     .SubmitSearchDetails(strProvince, strBaseEntPrName)
     .SelectEnterprise()
     .SelectServices(serviceNames)
     .NavBar.SignOut();
     CommonSteps.AdminLoginAndCompleteSearch("KYC Testing PDF.pdf", serviceNames.Length);
     KYC_Domain.Harness.TestClientPage.LoginPage
     .RadioButtonSelect()
     .SelectDropDown()
     .NavBar.GoToCompletedPackageItem()
     .NavigateToPackage()
     .downloadPDFClick();
 }
Beispiel #28
0
        public void GivenItContainsFindIndexIntoAs(string parentName, string activityName, string resultVariable, Table table)
        {
            DsfIndexActivity activity = new DsfIndexActivity {
                Result = resultVariable, DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variable  = tableRow["In Fields"];
                var index     = tableRow["Index"];
                var character = tableRow["Character"];
                var direction = tableRow["Direction"];

                activity.InField    = variable;
                activity.Index      = index;
                activity.Characters = character;
                activity.Direction  = direction;
            }
            CommonSteps.AddVariableToVariableList(resultVariable);
            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Beispiel #29
0
        public void GivenContainsAnDeleteFolderAs(string parentName, string activityName, Table table)
        {
            DsfPathDelete activity = new DsfPathDelete {
                DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var variable = tableRow["Recordset"];
                //var userName = tableRow["Username"];
                //var password = tableRow["Password"];
                var result = tableRow["Result"];

                activity.Result    = result;
                activity.InputPath = variable;
                //activity.Username = userName;
                //activity.Password = password;

                CommonSteps.AddVariableToVariableList(result);
            }
            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
Beispiel #30
0
        public void GivenItContainsRandomAs(string parentName, string activityName, Table table)
        {
            var activity = new DsfRandomActivity {
                DisplayName = activityName
            };

            foreach (var tableRow in table.Rows)
            {
                var type   = (enRandomType)Enum.Parse(typeof(enRandomType), tableRow["Type"]);
                var from   = tableRow["From"];
                var to     = tableRow["To"];
                var result = tableRow["Result"];

                CommonSteps.AddVariableToVariableList(result);

                activity.RandomType = type;
                activity.To         = to;
                activity.From       = from;
                activity.Result     = result;
            }

            CommonSteps.AddActivityToActivityList(parentName, activityName, activity);
        }
 public void ThenTheHistoryDebugOutputForForRowIs(string p0, int p1, Table table)
 {
     IList<IResourceHistory> resources = ScenarioContext.Current["History"] as IList<IResourceHistory>;
     // ReSharper disable AssignNullToNotNullAttribute
     var debug = resources.First().DebugOutput;
     // ReSharper restore AssignNullToNotNullAttribute
     var debugTocompare = debug.Last();
     var commonSteps = new CommonSteps();
     commonSteps.ThenTheDebugOutputAs(table, debugTocompare.Outputs.SelectMany(s => s.ResultsList).ToList(), true);
 }
 public void ThenDebugOutputsAs(string toolName, Table table)
 {
     Dictionary<string, Activity> activityList;
     ScenarioContext.Current.TryGetValue("activityList", out activityList);
     DsfSequenceActivity sequence;
     ScenarioContext.Current.TryGetValue("activity", out sequence);
     var sequenceActivity = sequence.Activities.ToList().FirstOrDefault(activity => activity.DisplayName == toolName) ?? activityList[toolName];
     var actualDebugItems = GetDebugOutputItemResults(sequenceActivity);
     CommonSteps commonSteps = new CommonSteps();
     commonSteps.ThenTheDebugOutputAs(table, actualDebugItems);
 }