public void ProductStockOnHandEnquiry(String product) { driver.Navigate().Refresh(); // navigate to stock on hand enquiry page LandingPage landingPage = new LandingPage(driver); wait.Until(ExpectedConditions.ElementIsVisible(landingPage.shortcutMenuIcon)); landingPage.menuIcon.Click(); wait.Until(ExpectedConditions.ElementToBeClickable(LandingPage.stockOnHandEnquiry)); landingPage.stockOnHandEnquiryMenu.Click(); StockOnHandEnquiryPage stockOnHandEnquiryPage = new StockOnHandEnquiryPage(driver); wait.Until(ExpectedConditions.ElementIsVisible(stockOnHandEnquiryPage.enquiryForm)); // search product stockOnHandEnquiryPage.prodCodeSearchBtn.Click(); wait.Until(ExpectedConditions.ElementIsVisible(stockOnHandEnquiryPage.prodSearchForm)); stockOnHandEnquiryPage.productSearchInput.SendKeys(product + Keys.Enter); wait.Until(ExpectedConditions.ElementIsVisible(stockOnHandEnquiryPage.prodSearcFirstResult)).Click(); wait.Until(ExpectedConditions.ElementIsVisible(stockOnHandEnquiryPage.btnRun)).Click(); wait.Until(ExpectedConditions.ElementIsVisible(StockOnHandEnquiryPage.prodListFirstRow)); }
public void IRetrieveTheStockInformation(String product) { ProductStockOnHandEnquiry(product); StockOnHandEnquiryPage stockOnHandEnquiryPage = new StockOnHandEnquiryPage(driver); prodStockOnHand = stockOnHandEnquiryPage.stockOnHandDtl.Text; }
public void ThenISeeTheStockInformationOfCOUCHIsUpdated(String product) { ProductStockOnHandEnquiry(product); StockOnHandEnquiryPage stockOnHandEnquiryPage = new StockOnHandEnquiryPage(driver); Assert.Less(stockOnHandEnquiryPage.stockOnHandDtl.Text, prodStockOnHand, "The number of stocks on hand should not be greater than " + prodStockOnHand); driver.Quit(); }