public void AutocloseableTest() { WarningButton.Click(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(0); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5)); wait.Until(d => WarningMessageModal == null); Assert.IsNull(WarningMessageModal); }
public void TestWarningMessage() { WarningButton.Click(); Assert.IsNotNull(WarningModal); Assert.IsTrue(WarningModal.Text.Contains("I'm an autocloseable warning message. I will hide in 3 seconds")); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(0); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5)); wait.Until(d => WarningModal == null); Assert.IsNull(WarningModal); }
public void WhenWarningButtonInvoked_ThenViewModelIsUpdated(string key, string expected) { var component = new WarningButton(); component.ViewComponentContext = ViewComponentTestHelper.GetViewComponentContext(); ViewViewComponentResult result = component.Invoke(new Dictionary <string, string>()) as ViewViewComponentResult; ButtonModel resultModel = (ButtonModel)result.ViewData.Model; //Assert expected.Should().Be(ViewComponentTestHelper.GetPropertyValue(resultModel, key)); }