Esempio n. 1
0
        public void WhenIInputTheFollowingInformation(Table user)
        {
            var dictionary = TableExtensions.ToDictionary(user);

            _username = dictionary["Email"].ToString();
            _password = dictionary["Password"].ToString();
        }
Esempio n. 2
0
        public void DadoPreenchiTodosOsCampos(Table table)
        {
            var dictionary    = TableExtensions.ToDictionary(table);
            var nomeCompleto  = dictionary["nomeCompleto"];
            var email         = dictionary["email"];
            var data          = dictionary["data"];
            var horas         = dictionary["horas"];
            var minutos       = dictionary["minutos"];
            var sobremesa     = dictionary["sobremesa"];
            var cor           = dictionary["cor"];
            var comida        = dictionary["comida"];
            var notaAnimal    = dictionary["notaAnimal"];
            var notaFutebol   = dictionary["notaFutebol"];
            var notaBaseball  = dictionary["notaBaseball"];
            var notaeSports   = dictionary["notaeSports"];
            var notaRugby     = dictionary["notaRugby"];
            var tipoSanduiche = dictionary["tipoSanduiche"];

            _pageObject.
            PreencherCampoNomeCompleto(dictionary["nomeCompleto"]).
            PreencherCampoEmail(dictionary["email"]).
            SelecionarCorFavorita(dictionary["cor"]).
            SelecionarSobremesaFavorita(dictionary["sobremesa"]).
            SelecionarComidaFavorita(dictionary["comida"]).
            SelecionarNotaAnimais(dictionary["notaAnimal"]).
            SelecionarNotasEsportes(notaFutebol: dictionary["notaFutebol"], notaBaseball: dictionary["notaBaseball"], notaeSports: dictionary["notaeSports"], notaRugby: dictionary["notaRugby"]).
            SelecionarIngredientesSanduiches(dictionary["tipoSanduiche"]).
            PreencherCampoData(dataAtual).
            PreencherHoraAtual(horaAtual, minutoAtual);
        }
        public void WhenPreenchoOsCampos(Table table)
        {
            cadastroCursosPage = new CadastroCursosPage(_driver);

            var dictionary = TableExtensions.ToDictionary(table);

            cadastroCursosPage.PreencherCamposPasso1(dictionary["Titulo"], dictionary["Descricao"]);
        }
        public void POSTOperation(Table table, string url)
        {
            _Settings.restRequest = new RestRequest(url, Method.POST);

            //foreach(TableRow row in table.Rows)
            //{
            //    string value = row[1] + System.Web.Security.Membership.GeneratePassword(10, 0);
            //    _Settings.restRequest.AddParameter(row[0], value);
            //}

            var dictionary = _TableExtension.ToDictionary(table);

            _Settings.restRequest.AddParameter("username", dictionary["username"]);
            _Settings.restRequest.AddParameter("password", dictionary["password"]);

            _Settings.restResponse = _Settings.restClient.Execute(_Settings.restRequest);
        }
        public void insertUserInfomationToDB(Table user)
        {
            var uInfo = TableExtensions.ToDictionary(user);

            using (var item = new AccountController())
            {
                item.Register(uInfo["Fullname"].ToString(), uInfo["Email"].ToString(), uInfo["Phone"].ToString(), uInfo["Address"].ToString(), uInfo["Password"].ToString(), uInfo["Password"].ToString());
            }
        }
        public void WhenUserEnterCrendentials(Table table)
        {
            // ScenarioContext.Current.Pending();
            var dictionary = TableExtensions.ToDictionary(table);
            var test       = dictionary["Username"];

            driver.FindElement(By.XPath("//input[@id='UserName']")).SendKeys(dictionary["Username"]);
            driver.FindElement(By.XPath("//input[@id='Password']")).SendKeys(dictionary["Password"]);
        }
Esempio n. 7
0
        public void WhenIInputTheFollowingInformation(Table User)
        {
            var dictionary = TableExtensions.ToDictionary(User);

            _username = dictionary["Email"].ToString();
            string _password = dictionary["Password"].ToString();

            Browser.SetTextBoxValue("email", _username);
            Browser.SetTextBoxValue("password", _password);
        }
        public bool checkLogged(Table user)
        {
            var sID = TableExtensions.ToDictionary(user);

            using (var item = new AccountController())
            {
                _sessionName = item.Session["FullName"].ToString();
            }
            if (_sessionName == sID["SessionID"])
            {
                return(true);
            }
            return(false);
        }
Esempio n. 9
0
        public void CreatePerson(Table Person)
        {
            var dictionary = TableExtensions.ToDictionary(Person);
            var test       = dictionary["Identifier"];

            WaitForElementText("//div[@class='modal-header']/h4", "Create Person");
            driver.FindElement(By.Name("identifiername")).SendKeys(dictionary["Identifier"]);
            driver.FindElement(By.Name("firstname")).SendKeys(dictionary["Firstname"]);
            driver.FindElement(By.Name("lastname")).SendKeys(dictionary["Lastname"]);

            SelectElement Organization = new SelectElement(driver.FindElement(By.XPath("//SELECT[@data-ng-options='organization.ID as organization.Description for organization in ctrl.organizations']['Operator Machine']")));

            Organization.SelectByValue("0");

            WaitingForElement("//div[@class='modal-body']/div[1]/div[12]/div/input");
            driver.FindElement(By.XPath("//div[@class='modal-body']/div[1]/div[12]/div/input")).Click();
        }
        public void WhenIFillInNewEmployeeDataWithTheFollowing(Table table)
        {
            dynamic newEmployee        = table.CreateDynamicInstance();
            var     employeeManagement = ScenarioContext.Current.Get <EmployeeManagementPage>();

            if (newEmployee.StartDate.ToString() == "Today")
            {
                employeeManagement.FillInNewEmployeeData(newEmployee.FirstName, newEmployee.LastName, DateTime.Now.Date.ToString("yyyy-MM-dd"), newEmployee.Email);
            }
            else
            {
                var dictionary = TableExtensions.ToDictionary(table);
                ScenarioContext.Current.Remove("StartDate");
                ScenarioContext.Current.Add("StartDate", dictionary["Start date"]);
                string startDate = ScenarioContext.Current.Get <string>("StartDate");
                employeeManagement.FillInNewEmployeeData(newEmployee.FirstName, newEmployee.LastName, startDate, newEmployee.Email);
            }
        }
Esempio n. 11
0
        public void inputPropertyInfo(Table property)
        {
            var propInfo = TableExtensions.ToDictionary(property);

            K21T1_Team3Entities db = new K21T1_Team3Entities();

            _prop.PropertyName    = propInfo["PropertyName"].ToString();
            _prop.PropertyType_ID = int.Parse(propInfo["PropertyType_ID"].ToString());
            _prop.Content         = propInfo["Content"].ToString();
            _prop.Street_ID       = int.Parse(propInfo["Street_ID"].ToString());
            _prop.Ward_ID         = int.Parse(propInfo["Ward_ID"].ToString());
            _prop.District_ID     = int.Parse(propInfo["District_ID"].ToString());
            _prop.Price           = int.Parse(propInfo["Price"].ToString());
            _prop.UnitPrice       = propInfo["UnitPrice"].ToString();
            _prop.Area            = propInfo["Area"].ToString();
            _prop.BedRoom         = int.Parse(propInfo["BedRoom"].ToString());
            _prop.BathRoom        = int.Parse(propInfo["Bathroom"].ToString());
            _prop.PackingPlace    = int.Parse(propInfo["PackingPlace"].ToString());
            _prop.UserID          = int.Parse(propInfo["UserId"].ToString());
            _prop.Status_ID       = int.Parse(propInfo["Status_ID"].ToString());
        }
Esempio n. 12
0
        public void ThenICanEditTheUserProfile(Table editProfileTable)
        {
            Sync.ExplicitWait(1);
            AppointmentManagerPages.MyProfilePage.EditProfileButton.Click();
            Sync.ExplicitWait(1);

            var dictionary = TableExtensions.ToDictionary(editProfileTable);

            Sync.ExplicitWait(1);
            AppointmentManagerPages.MyProfilePage.FirstNameField.Clear();
            Sync.ExplicitWait(1);
            AppointmentManagerPages.MyProfilePage.FirstNameField.SendKeys(dictionary["FirstName"]);
            Sync.ExplicitWait(1);
            AppointmentManagerPages.MyProfilePage.LastNameField.Clear();
            Sync.ExplicitWait(1);
            AppointmentManagerPages.MyProfilePage.LastNameField.SendKeys(dictionary["LastName"]);
            Sync.ExplicitWait(1);
            AppointmentManagerPages.MyProfilePage.PhoneField.Clear();
            Sync.ExplicitWait(1);
            AppointmentManagerPages.MyProfilePage.PhoneField.SendKeys(dictionary["Phone"]);

            Sync.ExplicitWait(2);
            AppointmentManagerPages.MyProfilePage.UpdateInfoButton.Click();
        }