Пример #1
0
        internal void NewRecord(String code, String description)
        {
            Assert.That(driver.FindElement(By.XPath("//*[@id='container']/h2")).Text, Is.EqualTo("Time and Materials"));
            //Find Code button
            IWebElement Code = driver.FindElement(By.Id("Code"));

            Code.Clear();
            Code.SendKeys(code);

            //Find description button and entering value//
            IWebElement Description = driver.FindElement(By.XPath("//input[contains(@id,'Description')]"));

            Description.Clear();
            Description.SendKeys(description);

            //Finding pricePerUnit and entering value//

            IWebElement pricePerUnit = driver.FindElement(By.XPath("//input[contains(@class,'k-formatted-value k-input')]"));

            pricePerUnit.Clear();
            pricePerUnit.SendKeys("7000");
            //finding  save button and then click
            WaitHelpers.waitClickableElement(driver, "XPath", "//*[@id='SaveButton']");
            driver.FindElement(By.XPath("//*[@id='SaveButton']")).Click();
            Console.WriteLine("Created Successfully");
        }
Пример #2
0
        public static void flashmessage(String data)
        {
            WaitHelpers.waitClickableElement(driver, "XPath", "//div[@class='ns-box-inner']");

            var actual = driver.FindElement(By.XPath("//div[@class='ns-box-inner']")).Text;

            var languageAdd    = (data + " " + "has been added to your languages");
            var languageUpdate = (data + " " + "has been updated to your languages");
            var languagedelete = (data + " " + "has been deleted from your languages");

            var skillAdd    = (data + " " + "has been added to your skills");
            var skillUpdate = (data + " " + "has been updated to your skills");
            var skilldelete = (data + " " + "has been deleted");


            if (actual == languageAdd)
            {
                Assert.Pass();
                Console.WriteLine(data + "has been added to your languages");
                return;
            }
            else if (actual == languageUpdate)
            {
                Assert.Pass();
                Console.WriteLine(data + "has been updated to your languages");
                return;
            }
            else if (actual == languagedelete)
            {
                Assert.Pass();
                Console.WriteLine(data + "has been deleted from your languages");
                return;
            }
            else if (actual == skillAdd)
            {
                Assert.Pass();
                Console.WriteLine(data + "has been added to your skills");
                return;
            }
            else if (actual == skillUpdate)
            {
                Assert.Pass();
                Console.WriteLine(data + "has been updated to your skills");
                return;
            }
            else if (actual == skilldelete)
            {
                Assert.Pass();
                Console.WriteLine(data + "has been deleted");
                return;
            }

            else
            {
                Assert.Fail();
            }
        }
Пример #3
0
        internal void ValidateNewRecord(String code, String description)
        {
            WaitHelpers.waitClickableElement(driver, "XPath", "//*[@id='tmsGrid']/div[4]/a[4]/span");
            //last page button
            driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[4]/a[4]/span")).Click();
            var Code = driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[3]/table/tbody/tr[last()]/td[1]"));

            var testDescription = driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[3]/table/tbody/tr[last()]/td[3]")).Text;

            // logic to compare the one we wanted
            Assert.That(Code.Text, Is.EqualTo(code));
        }
Пример #4
0
        /* internal void EditNewRecord()
         * {
         *
         *   Thread.Sleep(3000);
         *
         *   // Clicking the last page button on pagination field
         *   driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[4]/a[4]/span")).Click();
         *
         *   for (i = 1; i <= 10; i++)
         *   {
         *       var Code = driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[3]/table/tbody/tr[" + i + "]/td[1]"));
         *
         *
         *       var testDescription = driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[3]/table/tbody/tr[" + i + "]/td[3]")).Text;
         *
         *       // logic to compare the one we wanted
         *
         *       if (Code.Text == "158" && testDescription == "tesdec5")
         *       {
         *           driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[3]/table/tbody/tr[" + i + "]/td[5]/a[1]")).Click();
         *           IWebElement code = driver.FindElement(By.Id("Code"));
         *           code.Clear();
         *           code.SendKeys("Hey");
         *           driver.FindElement(By.XPath("//*[@id='SaveButton']")).Click();
         *           break;
         *       }
         *
         *   }
         *
         * }*/

        internal void EditNewRecord()
        {
            WaitHelpers.waitClickableElement(driver, "XPath", "//*[@id='tmsGrid']/div[4]/a[4]/span");
            driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[4]/a[4]/span")).Click();
            driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[3]/table/tbody/tr[last()]/td[5]/a[1]")).Click();
            Assert.That(driver.FindElement(By.XPath("//*[@id='container']/h2")).Text, Is.EqualTo("Time and Materials"));
            IWebElement Code = driver.FindElement(By.Id("Code"));

            Code.Clear();
            Code.SendKeys("Jay");
            driver.FindElement(By.XPath("//*[@id='SaveButton']")).Click();
        }
Пример #5
0
        public void ThenIValidateThatTheDescriptionHasBeenAddedSuccessfully()
        {
            //verify the success confirmation flash message
            WaitHelpers.waitClickableElement(driver, "XPath", "//div[@class='ns-box-inner']");
            var message = driver.FindElement(By.XPath("//div[@class='ns-box-inner']")).Text;

            try
            {
                Assert.IsTrue(message.Contains("Description has been saved successfully"));
            }
            catch (Exception)
            {
                Assert.Fail();
            }
        }
Пример #6
0
 internal void DeleteNewRecord()
 {
     try
     {
         WaitHelpers.waitClickableElement(driver, "XPath", "//*[@id='tmsGrid']/div[4]/a[4]/span");
         driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[4]/a[4]/span")).Click();
         Thread.Sleep(3000);
         driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[3]/table/tbody/tr[last()]/td[5]/a[2]")).Click();
         IAlert alert = driver.SwitchTo().Alert();
         alert.Accept();
         // Assert.Pass();
     }
     catch (Exception exp)
     {
         Assert.Fail();
     }
 }
Пример #7
0
 public void ThenIvalidateThatILoggedIntoThePortalSuccessfully()
 {
     WaitHelpers.waitClickableElement(driver, "XPath", "//div[@class='ui eight item menu']//a[@class='item'][contains(text(),'Profile')]");
     Assert.That(Drivers.driver.FindElement(By.XPath("//div[@class='ui eight item menu']//a[@class='item'][contains(text(),'Profile')]")).Text, Is.EqualTo("Profile"));
 }