static public void CheckCorrectness(MainDriver driver) { WebDriverWait waits = new WebDriverWait(driver.Driver, TimeSpan.FromSeconds(10)); waits.Until(ExpectedConditions.ElementIsVisible(By.XPath("//em[contains(text(),'There are no items in your cart.')]"))); Assert.IsTrue(driver.Driver.FindElements(By.XPath("//em[contains(text(),'There are no items in your cart.')]")).Count > 0, "Error"); }
public static MainDriver getInstance(IWebDriver driver) { if (instance == null) { instance = new MainDriver(driver); } return(instance); }
public MainPage(MainDriver driver_) { driver = driver_; }
public Checkout(MainDriver driver_) { driver = driver_; }
public void init() { IWebDriver ch_driver = new ChromeDriver(); driver = MainDriver.getInstance(ch_driver); // Singleton }
static public void EndDriver(MainDriver driver) { driver.Driver.Quit(); }
public ProductPage(MainDriver driver_) { driver = driver_; }