예제 #1
0
        /// <summary>
        /// Fills in user details and click create.
        /// </summary>
        /// <param name="user">The user.</param>
        public void FillInUserDetailsAndClickCreate(string user)
        {
            uName = "Regression" + user + PageHelper.RandomNumber(3);
            UserName.SendKeys(uName);
            uniqueEmail = PageHelper.RandomEmailAddress();
            EmailAddress.SendKeys(uniqueEmail);
            Description.SendKeys(PageHelper.RandomString(15));
            Title.SendKeys("Dr");
            FirstName.SendKeys("Test");
            Surname.SendKeys("User");
            PhoneNumber.SendKeys(PageHelper.RandomNumber(10));

            if (user.ToLower().Contains("ctu"))
            {
                ClinicalTrialUnitUser.Click();
                PageHelper.PickAllValuesFromDropdown(CT_Units);
            }
            else if (user.ToLower().Contains("admin"))
            {
                ClinicalTrialAdminUser.Click();
            }
            else if (user.ToLower().Contains("lhd"))
            {
                LocalHealthDistrictUser.Click();
                PageHelper.PickAllValuesFromDropdown(LH_Districts);
            }

            CreateAndEmailUserButton.Click();
            BackToListButton.Click();
        }
예제 #2
0
        /// <summary>
        /// Search and edit the created user.
        /// </summary>
        /// <param name="fromUser">From user.</param>
        /// <param name="toUser">To user.</param>
        /// <param name="editedEmail">The edited email.</param>
        public void SearchAndEditTheCreatedUser(string fromUser, string toUser, string editedEmail)
        {
            UserSearch.SendKeys(uName);
            EditButton.Click();
            EmailAddress.Clear();
            EmailAddress.SendKeys(editedEmail);

            if (fromUser.ToLower().Contains("ctu"))
            {
                ClinicalTrialUnitUser.Click();
            }
            else if (fromUser.ToLower().Contains("admin"))
            {
                ClinicalTrialAdminUser.Click();
            }
            else if (fromUser.ToLower().Contains("lhd"))
            {
                LocalHealthDistrictUser.Click();
            }

            if (toUser.ToLower().Contains("ctu"))
            {
                ClinicalTrialUnitUser.Click();
                PageHelper.PickAllValuesFromDropdown(CT_Units);
            }
            else if (toUser.ToLower().Contains("admin"))
            {
                ClinicalTrialAdminUser.Click();
            }
            else if (toUser.ToLower().Contains("lhd"))
            {
                LocalHealthDistrictUser.Click();
                PageHelper.PickAllValuesFromDropdown(LH_Districts);
            }
            SaveUserButton.Click();
            BackToListButton.Click();
        }