예제 #1
0
        public void WhenParticipantLogsInWithValidCredentials(string participant)
        {
            AdminOnMicrosoftLoginPage();
            var appSecrets = _testContext.TestUserSecrets;
            var password   = appSecrets.Password;

            switch (participant)
            {
            case "Individual":
                _loginPage.Logon(appSecrets.Individual, password);
                _scenarioContext.Add("Username", appSecrets.Individual);
                break;

            case "Representative":
                _loginPage.Logon(appSecrets.Representative, password);
                _scenarioContext.Add("Username", appSecrets.Representative);
                break;

            case "Person":
                _loginPage.Logon(appSecrets.Person, password);
                _scenarioContext.Add("Username", appSecrets.Person);
                break;
            }
            _scenarioContext.Add("Participant", participant);
        }
예제 #2
0
        public void GivenAUserTypesInAComment(string comment)
        {
            var mainVM = new MainWindowViewModel(context.Get <Mock <IRegionManager> >("regionMock").Object, context.Get <Mock <IEventAggregator> >("eventMock").Object);

            mainVM.CommitMessage = comment;
            context.Add("mainVM", mainVM);
        }
예제 #3
0
        protected override void BuildDataList()
        {
            var variableList = scenarioContext.Get <List <Tuple <string, string> > >("variableList");

            variableList.Add(new Tuple <string, string>(ResultVariable, ""));

            BuildShapeAndTestData();
            var flowSwitch = new DsfFlowSwitchActivity
            {
                ExpressionText =
                    string.Format(
                        "Dev2.Data.Decision.Dev2DataListDecisionHandler.Instance.FetchSwitchData(\"{0}\",AmbientDataList)",
                        variableList.First().Item1),
            };
            var sw = new FlowSwitch <string>();

            sw.Expression = flowSwitch;
            var multiAssign = new DsfMultiAssignActivity();
            int row         = 1;

            foreach (var variable in variableList)
            {
                multiAssign.FieldsCollection.Add(new ActivityDTO(variable.Item1, variable.Item2, row, true));
                row++;
            }

            TestStartNode = new FlowStep
            {
                Action = multiAssign,
                Next   = sw
            };

            scenarioContext.Add("activity", flowSwitch);
        }
예제 #4
0
        public IExecutionEnvironment ExecuteSubRequest(IDSFDataObject dataObject, Guid workspaceID, string inputDefs, string outputDefs,
                                                       out ErrorResultTO errors, int update, bool b)
        {
            if (!scenarioContext.TryGetValue("indexUpdate", out List <int> updateValues))
            {
                updateValues = new List <int>();
                scenarioContext.Add("indexUpdate", updateValues);
            }

            if (!scenarioContext.TryGetValue("inputDefs", out List <string> inputList))
            {
                inputList = new List <string>();
                scenarioContext.Add("inputDefs", inputList);
            }

            if (!scenarioContext.TryGetValue("outputDefs", out List <string> outputList))
            {
                outputList = new List <string>();
                scenarioContext.Add("outputDefs", outputList);
            }

            inputList.Add(inputDefs);
            outputList.Add(outputDefs);
            updateValues.Add(update);
            errors = new ErrorResultTO();
            return(dataObject.Environment);
        }
예제 #5
0
        public void WhenTheMoveFileToolIsExecuted()
        {
            BuildDataList();
            IDSFDataObject result = ExecuteProcess(isDebug: true, throwException: false);

            scenarioContext.Add("result", result);
        }
예제 #6
0
        public void GivenIDragASqlServerDatabaseConnector()
        {
            var sqlServerActivity         = new DsfSqlServerDatabaseActivity();
            var modelItem                 = ModelItemUtils.CreateModelItem(sqlServerActivity);
            var mockServiceInputViewModel = new Mock <IManageDatabaseInputViewModel>();
            var mockDbServiceModel        = new Mock <IDbServiceModel>();
            var mockEnvironmentRepo       = new Mock <IServerRepository>();
            var mockEnvironmentModel      = new Mock <IServer>();

            mockEnvironmentModel.Setup(model => model.IsConnected).Returns(true);
            mockEnvironmentModel.Setup(model => model.IsLocalHost).Returns(true);
            mockEnvironmentModel.Setup(model => model.EnvironmentID).Returns(Guid.Empty);
            mockEnvironmentModel.Setup(model => model.IsLocalHostCheck()).Returns(false);

            mockEnvironmentRepo.Setup(repository => repository.ActiveServer).Returns(mockEnvironmentModel.Object);
            mockEnvironmentRepo.Setup(repository => repository.FindSingle(It.IsAny <Expression <Func <IServer, bool> > >())).Returns(mockEnvironmentModel.Object);

            _greenPointSource = new DbSourceDefinition
            {
                Name = "GreenPoint",
                Type = enSourceType.SqlDatabase
            };

            var dbSources = new ObservableCollection <IDbSource> {
                _greenPointSource
            };

            mockDbServiceModel.Setup(model => model.RetrieveSources()).Returns(dbSources);
            mockServiceInputViewModel.SetupAllProperties();
            var sqlServerDesignerViewModel = new SqlServerDatabaseDesignerViewModel(modelItem, mockDbServiceModel.Object, new SynchronousAsyncWorker());

            scenarioContext.Add("viewModel", sqlServerDesignerViewModel);
            scenarioContext.Add("mockServiceInputViewModel", mockServiceInputViewModel);
            scenarioContext.Add("mockDbServiceModel", mockDbServiceModel);
        }
예제 #7
0
        public void WhenTheNewReadFolderFileToolIsExecuted()
        {
            BuildDataList();
            var result = ExecuteProcess(isDebug: true, throwException: false);

            _scenarioContext.Add("result", result);
        }
예제 #8
0
        public void WhenAdminInputTitleAs()
        {
            string title = new AutogeneratorService().GenerateStreetAddressTitle();

            _scenarioContext.Add("address_title", title);
            dreamHomePg.inputTitle(title);//p0
        }
예제 #9
0
        public void LoginUsers(Table table)
        {
            var inputSet = table.CreateSet <UserCredentialsInput>();
            var queries  = inputSet
                           .ToList()
                           .Select(uc => _httpClient.PostAsJsonAsync("api/Auth/login", uc))
                           .ToArray();

            Task.WaitAll(queries);

            var results = queries
                          .Select(r => r.Result)
                          .Select(ReadResponseAsync)
                          .Select(r => r.Result)
                          .ToList();


            var accessTokens = results
                               .Where(r => r.AccessToken != default)
                               .Select(r => r.AccessToken)
                               .ToList();
            var errors = results
                         .Where(r => r.Errors != default)
                         .Select(r => r.Errors)
                         .ToList();

            _scenarioContext.Add(AccessTokensLabel, accessTokens);
            _scenarioContext.Add(ErrorsLabel, errors);
        }
예제 #10
0
 public void WhenIHaveSpecifiedACategory()
 {
     createMenuRequest     = new MenuBuilder().SetDefaultValues("Yumido Menu").Build();
     createCategoryRequest = new CategoryBuilder().WithName("Vegan Category").Build();
     scenarioContext.Add("Menu", createMenuRequest);
     scenarioContext.Add("Category", createCategoryRequest);
 }
예제 #11
0
 public void WhenITypeIntoFieldAnd(string email, string pass)
 {
     _user.TypesInto(LoginForm.EMIAL_FIELD, email);
     _user.TypesInto(LoginForm.PASSWORD_FIELD, pass);
     _scenarioContext.Add("typedEmail", email);
     _scenarioContext.Add("typedPass", pass);
 }
예제 #12
0
        public void GivenThereIsAComplexobjectInTheDatalistWithThisShape(Table table)
        {
            var rows = table.Rows.ToList();

            if (rows.Count == 0)
            {
                var obj   = table.Header.ToArray()[0];
                var field = table.Header.ToArray()[1];


                var isAdded = scenarioContext.TryGetValue("obj", out List <Tuple <string, string> > emptyRecordset);
                if (!isAdded)
                {
                    emptyRecordset = new List <Tuple <string, string> >();
                    scenarioContext.Add("obj", emptyRecordset);
                }
                emptyRecordset.Add(new Tuple <string, string>(obj, field));
            }

            foreach (TableRow tableRow in rows)
            {
                scenarioContext.TryGetValue("objList", out List <Tuple <string, string> > objList);

                if (objList == null)
                {
                    objList = new List <Tuple <string, string> >();
                    scenarioContext.Add("objList", objList);
                }
                objList.Add(new Tuple <string, string>(tableRow[0], tableRow[1]));
            }
        }
예제 #13
0
        public void GivenIAssignTheValueToAJsonObject(string value, string variable)
        {
            value = value.Replace('"', ' ').Trim();

            if (value.StartsWith("="))
            {
                value = value.Replace("=", "");
                value = string.Format("!~calculation~!{0}!~~calculation~!", value);
            }

            List <Tuple <string, string> > variableList;

            scenarioContext.TryGetValue("variableList", out variableList);

            List <AssignObjectDTO> fieldCollection;

            scenarioContext.TryGetValue("fieldCollection", out fieldCollection);

            if (variableList == null)
            {
                variableList = new List <Tuple <string, string> >();
                scenarioContext.Add("variableList", variableList);
            }

            if (fieldCollection == null)
            {
                fieldCollection = new List <AssignObjectDTO>();
                scenarioContext.Add("fieldCollection", fieldCollection);
            }

            fieldCollection.Add(new AssignObjectDTO(variable, value, 1, true));
        }
예제 #14
0
        public void GivenANewPeriod()
        {
            var program = new LotteryProgram();

            context.Add("period", program.p);
            context.Add("vendor", program.lv);
            context.Add("program", program);
        }
예제 #15
0
        public void WhenNoticeListOfCategories()
        {
            lifeStylePage.formList();
            List <Product> products = lifeStylePage.GetProductList();

            Console.WriteLine(products);
            _scenarioContext.Add("users_products", products);
        }
예제 #16
0
        public void WhenISendPostRequestWithValidNewUserData()
        {
            userData = TestDataHelper.GetValidUserData();

            response = apiClient.PostData(userData);

            scenarioContext.Add("NewUserAdded", userData);
        }
        public void WhenUserChooseNumberOfTicketAs()
        {
            int[] arr = { 1, 5, 10, 20, 50, 100 };
            int   num = arr[new Random().Next(arr.Length)];

            dialogP.ClickTicketsQuantity(num);
            _scenarioContext.Add("ticketQuantity", num);
        }
        public void GivenYouAreAtTheYamlView()
        {
            var kubeMock   = context.Get <Mock <IKubeService> >(TestConstants.KubeMock);
            var regionMock = context.Get <Mock <IFileService> >(TestConstants.FileMock);
            var vm         = new YamlViewModel(kubeMock.Object, regionMock.Object);

            context.Add(TestConstants.YamlViewModel, vm);
        }
예제 #19
0
        public void WhenILoginUserWith(Table table)
        {
            var user = table.CreateInstance <User>();

            var responseCode = _restClient.GetPOSTResponseCode(GetConfigurationProperty().Named(Properties.REST_LOGIN_ENDPOINT), user);

            _scenarioContext.Add("postResponseLogin", responseCode);
        }
        public void GivenIHaveAddEndpointToAConferenceRequestWithAValidConferenceId(Scenario scenario)
        {
            var conferenceId       = GetConferenceIdForTest(scenario);
            var addEndpointRequest = PrepareAddEndpointRequest();

            _scenarioContext.Add(_addEndPointRequest, addEndpointRequest);
            _context.Request = _context.Post(AddEndpointsToConference(conferenceId), addEndpointRequest);
        }
        public static void AddValueOrNull <T>(this ScenarioContext context, string propertyName, T value) where T : class
        {
            if (value == null)
            {
                context.Add(propertyName + "Null", true);
            }

            context.Add(propertyName, value);
        }
 public void GivenIHaveAWord(string word)
 {
     if (!context.ContainsKey("words"))
     {
         context.Add("words", new List <string>(2));
     }
     ((List <string>)context["words"])
     .Add(word);
 }
예제 #23
0
        public void GivenAnItemWithTheFollowingFields(Table table)
        {
            ItemModel newItem = new ItemModel();

            newItem.Label          = table.Rows[0]["Label"].ToString();
            newItem.ItemType       = table.Rows[0]["ItemType"].ToString();
            newItem.ExpirationDate = table.Rows[0]["ExpirationDate"].ToString();
            _scenarioContext.Add("NewItem", newItem);
        }
 public void GivenIEnterLeftNumberOperatorAndRightNumber(Table table)
 {
     foreach (var row in table.Rows)
     {
         context.Add("leftNumber", Int32.Parse(row[0]));
         context.Add("operator", row[1]);
         context.Add("rightNumber", Int32.Parse(row[2]));
     }
 }
        public void GivenIHaveEnteredIntoTheCalculator(int number)
        {
            if (!_scenarioContext.ContainsKey(NumbersKey))
            {
                _scenarioContext.Add(NumbersKey, new List <int>());
            }

            _scenarioContext.Get <List <int> >(NumbersKey).Add(number);
        }
예제 #26
0
        public void ConnectServers()
        {
            AppUsageStats.LocalHost = $"http://{Environment.MachineName}:3142";
            ConnectToRemoteServerContainer();
            var localhost = ServerRepository.Instance.Source;

            _scenarioContext.Add("sourceServer", localhost);
            localhost.Connect();
        }
        public void GivenIHaveNavigatedTo(string url)
        {
            _scenarioContext.Add(UrlKey, url);
            _chromeDriver.Navigate().GoToUrl(url);

            // Tried to use this but didn't work. For time sake, using Thread.Sleep although this isn't recommended
            //wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.CssSelector("section#text-10")));
            Thread.Sleep(2000);
        }
예제 #28
0
        public void GivenOpenTwitterWith(Device device)
        {
            _context.Add("device", device);
            var pageFactory = ResolvePageFactory(device);

            driver           = pageFactory.Driver;
            pages["Login"]   = loginPage = pageFactory.GetTwitterLoginPage();
            pages["Account"] = accountPage = pageFactory.GetTwitterAccountPage();
        }
예제 #29
0
        public void ConnectServers()
        {
            WorkflowExecutionSteps._containerOps = new ContainerLauncher("warewolfserver");
            AppUsageStats.LocalHost = $"http://{Environment.MachineName}:3142";
            ConnectToRemoteServerContainer();
            var localhost = ServerRepository.Instance.Source;

            _scenarioContext.Add("sourceServer", localhost);
            localhost.Connect();
        }
예제 #30
0
        public void ConnectServers()
        {
            WorkflowExecutionSteps._containerOps = new Depends(Depends.ContainerType.Warewolf, true);
            AppUsageStats.LocalHost = $"http://{Environment.MachineName}:3142";
            ConnectToRemoteServerContainer(new Depends(Depends.ContainerType.CIRemote, true));
            var localhost = ServerRepository.Instance.Source;

            _scenarioContext.Add("sourceServer", localhost);
            localhost.Connect();
        }