public void GetRootElementReturnsCorrectElementInRootElementDefinedBlock() { WebDriverWait wait = new WebDriverWait(this.Driver, TimeSpan.FromSeconds(5)); IWebElement rootElement = wait.Until( driver => driver.FindElement(By.CssSelector(TableBlock.CustomerTableRootElementCssSelector))); TableBlock tableBlock = new TableBlock(rootElement, this.Driver); tableBlock.GetRootElement().Should().Be(rootElement); }
public void GetRootElementReturnsCorrectElementInCssSelectorDefinedBlock() { By rootElementBy = By.CssSelector(TableBlock.CustomerTableRootElementCssSelector); WebDriverWait wait = new WebDriverWait(this.Driver, TimeSpan.FromSeconds(5)); IWebElement expectedRootElement = wait.Until( driver => driver.FindElement(rootElementBy)); // TableBlock(IWebDriver.....) constructor calls the BlockController(string rootCssSelector....) constructor TableBlock tableBlock = new TableBlock(this.Driver); tableBlock.GetRootElement().Should().Be(expectedRootElement); }