Beispiel #1
0
        public async Task a1System_Test_Opret()
        {
            FireFoxSetup(out service, out op);

            setUp(service, op, out driver);

            driver.FindElement(By.XPath("//button[2]")).Click();

            typeUser  = driver.FindElement(By.Name("Username"));
            typePass  = driver.FindElement(By.Name("Password"));
            typePass2 = driver.FindElement(By.Name("ConfirmPassword"));
            GivenName = driver.FindElement(By.Name("GivenName"));
            LastName  = driver.FindElement(By.Name("LastName"));
            Email     = driver.FindElement(By.Name("Email"));


            typeUser.SendKeys(FirefoxUser);
            typePass.SendKeys(user.Password);
            typePass2.SendKeys(user.Password);
            GivenName.SendKeys(user.GivenName);
            LastName.SendKeys(user.GivenName);
            Email.SendKeys(user.Email);

            driver.FindElement(By.XPath("//div/div/div/div/form/div/div/div/input[1]")).Click();



            string testUrl = driver.Url;

            driver.Quit();

            Assert.That(testUrl, Is.EqualTo(host));
        }
Beispiel #2
0
        public async Task System_Test_OpretUsernameFail()
        {
            FireFoxSetup(out service, out op);

            setUp(service, op, out driver);

            driver.FindElement(By.XPath("//button[2]")).Click();

            typeUser  = driver.FindElement(By.Name("Username"));
            typePass  = driver.FindElement(By.Name("Password"));
            typePass2 = driver.FindElement(By.Name("ConfirmPassword"));
            GivenName = driver.FindElement(By.Name("GivenName"));
            LastName  = driver.FindElement(By.Name("LastName"));
            Email     = driver.FindElement(By.Name("Email"));


            typeUser.SendKeys("0!!=)#");
            typePass.SendKeys(user.Password);
            typePass2.SendKeys(user.Password);
            GivenName.SendKeys(user.Username);
            LastName.SendKeys(user.GivenName);
            Email.SendKeys(user.Email);

            driver.FindElement(By.XPath("//div/div/div/div/form/div/div/div/input[1]")).Click();

            string usernameFail = driver.FindElement(By.XPath("//div/div/div/div/form/div/ul/li[1]")).Text;


            string testUrl = driver.Url;

            driver.Quit();

            Assert.That(usernameFail, Is.EqualTo("value cannot be less than 8 characters"));
        }
Beispiel #3
0
        public async Task System_Test_Passw2Fail()
        {
            FireFoxSetup(out service, out op);

            setUp(service, op, out driver);

            driver.FindElement(By.XPath("//button[2]")).Click();

            typeUser  = driver.FindElement(By.Name("Username"));
            typePass  = driver.FindElement(By.Name("Password"));
            typePass2 = driver.FindElement(By.Name("ConfirmPassword"));
            GivenName = driver.FindElement(By.Name("GivenName"));
            LastName  = driver.FindElement(By.Name("LastName"));
            Email     = driver.FindElement(By.Name("Email"));

            string password2 = "forkertkode";

            typeUser.SendKeys("NybrugerOK");
            typePass.SendKeys(password2);
            typePass2.SendKeys(user.Password);
            GivenName.SendKeys(user.GivenName);
            LastName.SendKeys(user.LastName);
            Email.SendKeys(user.Email);

            driver.FindElement(By.XPath("//div/div/div/div/form/div/div/div/input[1]")).Click();

            string usernameFail = driver.FindElement(By.XPath("//div/div/div/div/form/div/ul/li[1]")).Text;


            string testUrl = driver.Url;

            driver.Quit();

            Assert.That(usernameFail, Is.EqualTo("Password not the same"));
        }
Beispiel #4
0
        public void FillDetails()
        {
            TitleCombo.Click();
            GivenName.Clear();
            GivenName.SendKeys(ExcelOperation.GetData[19]);

            Surname.Clear();
            Surname.SendKeys(ExcelOperation.GetData[20]);
            RelationshipText.Clear();

            RelationshipText.SendKeys(ExcelOperation.GetData[21]);
            PasswordText.Clear();
            PasswordText.SendKeys(ExcelOperation.GetData[22]);
            PasswordPromptText.Clear();

            PasswordPromptText.SendKeys(ExcelOperation.GetData[23]);
            GenericHelper.AllScreenShot(driver);
        }
Beispiel #5
0
        public void FillPersonalDetails()
        {
            SelectElement oSelect = new SelectElement(driver.FindElement(By.Id("TitleCombo")));

            oSelect.SelectByText(ExcelOperation.GetData[1]);
            GivenName.Clear();

            string GivenNameString = GenericHelper.RandomString(5);

            ExcelOperation.AddData("TestData2", GivenNameString, "TC1_CreateAnEmployee");
            GivenName.SendKeys(GivenNameString);
            OtherName.Clear();

            OtherName.SendKeys(ExcelOperation.GetData[3]);
            Surname.Clear();
            Surname.SendKeys(ExcelOperation.GetData[4]);
            PreferenceName.Clear();

            PreferenceName.SendKeys(ExcelOperation.GetData[5]);
            DateOfBirth.Clear();
            DateOfBirth.SendKeys(ExcelOperation.GetData[6]);
            Gender.Click();

            MobNumber.Clear();
            // MobNumber.SendKeys(ExcelOperation.GetData[7]);
            MobNumber.SendKeys("9999 999999");
            EmailID.Clear();
            EmailID.SendKeys(ExcelOperation.GetData[8]);

            PerferedMethodToContact.Click();
            GenericHelper.AllScreenShot(driver);
            var ele = driver.FindElement(By.Id("CommandButtons_cmdNextEnabled"));
            IJavaScriptExecutor executor = (IJavaScriptExecutor)driver;

            executor.ExecuteScript("var ele=arguments[0];setTimeout(function(){ele.click();},100)", ele);
        }