public PagedResultDto <NSX_DTO> NSX_Search(NSX_DTO filterInput)
        {
            if (filterInput.RECORD_STATUS == null)
            {
                filterInput.RECORD_STATUS = "1";
            }

            var list = procedureHelper.GetData <NSX_DTO>("NhaSanXuat_Search", filterInput);

            var totalCount = list.Count();


            return(new PagedResultDto <NSX_DTO>(
                       totalCount,
                       list
                       ));
        }
        public void Delete_NSX_With_Cancel()
        {
            Login();

            driver.Navigate().GoToUrl(homeURL + "/app/admin/nsx-list");
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15);
            Thread.Sleep(8000);
            //Act
            Random rnd    = new Random();
            int    number = rnd.Next(1, 5);

            IWebElement         ele      = driver.FindElement(By.XPath("/html/body/app-root/ng-component/div/div/div[2]/ng-component/div[3]/div/div/div/div/div/p-table/div/div/div/div[2]/table/tbody/tr[" + number + "]/td[2]"));
            IJavaScriptExecutor executor = (IJavaScriptExecutor)driver;

            executor.ExecuteScript("arguments[0].click();", ele);
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(7);


            String Code = ele.Text;


            IWebElement         eleDel      = driver.FindElement(By.XPath("/html/body/app-root/ng-component/div/div/div[2]/ng-component/div[1]/ul/li[2]"));
            IJavaScriptExecutor executorDel = (IJavaScriptExecutor)driver;

            executorDel.ExecuteScript("arguments[0].click();", eleDel);
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(7);

            IWebElement         eleYes      = driver.FindElement(By.XPath("/html/body/div/div/div[4]/div[1]/button"));
            IJavaScriptExecutor executorYes = (IJavaScriptExecutor)driver;

            executorYes.ExecuteScript("arguments[0].click();", eleYes);
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30);



            //Check with value of DB
            NSX_DTO finalRow = DataProvider.Instance.GetData <NSX_DTO>("NhaSanXuat_SEARCH", new { NSX_CODE = Code, RECORD_STATUS = 1 }).ToList().FirstOrDefault();

            //Assert
            //Assert.AreEqual("0", finalRow.RECORD_STATUS);
            Assert.AreEqual("1", finalRow.RECORD_STATUS);

            driver.Close();
        }
Ejemplo n.º 3
0
 public PagedResultDto <NSX_DTO> NSX_Search([FromBody] NSX_DTO filterInput)
 {
     return(_nsxAppService.NSX_Search(filterInput));
 }