public void ThenEveryInputIsSetToItsDefaultValues() { _actor.AsksFor(Text.Of(SubmissionPage.UrlInputField)).Should().BeEmpty(); _actor.AsksFor(SelectedOptionText.Of(SubmissionPage.TypeSelect)).Should().Be("Blog Posts"); _actor.AsksFor(Text.Of(SubmissionPage.EmailInputField)).Should().BeEmpty(); _actor.AsksFor(Text.Of(SubmissionPage.DescriptionInputField)).Should().BeEmpty(); _actor.AsksFor(SelectedState.Of(SubmissionPage.PrivacyPolicy)).Should().BeFalse(); }
public void ThenIShouldSeeTheStoredCustomerDetails() { _storedCustomer.Should().NotBeNull(); _actor.AsksFor(SelectedOptionText.Of(CustomerMaintenancePage.Title)).Should().Be(_storedCustomer.Title); _actor.AsksFor(Value.Of(CustomerMaintenancePage.Name)).Should().Be(_storedCustomer.Name); _actor.AsksFor(Value.Of(CustomerMaintenancePage.AddressLine1)).Should().Be(_storedCustomer.AddressLine1); _actor.AsksFor(Value.Of(CustomerMaintenancePage.AddressLine2)).Should().Be(_storedCustomer.AddressLine2); _actor.AsksFor(Value.Of(CustomerMaintenancePage.AddressLine3)).Should().Be(_storedCustomer.AddressLine3); _actor.AsksFor(Value.Of(CustomerMaintenancePage.Postcode)).Should().Be(_storedCustomer.Postcode); _actor.AsksFor(Value.Of(CustomerMaintenancePage.HomePhone)).Should().Be(_storedCustomer.HomePhone); _actor.AsksFor(Value.Of(CustomerMaintenancePage.Mobile)).Should().Be(_storedCustomer.Mobile); }
public void TestNoOptionSelected() { var selectedOption = new Mock <IWebElement>(); selectedOption.SetupGet(x => x.Selected).Returns(false); selectedOption.SetupGet(x => x.Text).Returns("zip"); var element = new Mock <IWebElement>(); element.SetupGet(x => x.TagName).Returns("select"); element.Setup(x => x.GetAttribute(It.IsAny <string>())).Returns <string>(null); element.Setup(x => x.FindElements(By.TagName("option"))).Returns(new List <IWebElement> { selectedOption.Object }.AsReadOnly()); WebDriver.Setup(x => x.FindElement(It.IsAny <By>())).Returns(element.Object); WebDriver.Setup(x => x.FindElements(It.IsAny <By>())).Returns(new List <IWebElement> { element.Object }.AsReadOnly()); Actor.Invoking(x => x.AsksFor(SelectedOptionText.Of(Locator))).Should().Throw <NoSuchElementException>(); }
public void TestElementDoesNotExist() { SetUpFindElementsReturnsEmpty(); Actor.Invoking(x => x.AsksFor(SelectedOptionText.Of(Locator))).Should().Throw <WaitingException <bool> >(); }