public void When_FindElements_is_used_Child_elements_can_be_found() { Threaded <Session> .CurrentBlock <InlineFramesPage>() .Child.FindElements(By.Id(ChildFrame.TheLinkId)) .Count() .Should().BeGreaterThan(0); }
public void Given_session_has_been_loaded_with_driver_When_ending_Then_should_end_session() { Threaded <Session> .With <HeadlessChrome>(); Threaded <Session> .End(); }
public void When_loading_with_generic_driver_Then_should_return_session_with_correct_driver_with_default_settings() { Threaded <Session> .With <HeadlessChrome>() .Verify(x => x.Driver is ChromeDriver) .VerifyThat(x => x.Settings.ShouldBeEquivalentTo(new Settings())) .End(); }
public void BeforeAutoLoginScenario() { Threaded <Session> .CurrentBlock <LoggedOutPage>() .Username.EnterText(_settings.ValidUserName) .Password.EnterText(_settings.ValidPassword) .Login.Click <LoggedInPage>(); }
public void When_finding_textfield_by_selector_with_wait_Then_should_return_value(Expression <Func <SlowPageWithExplicitWait, ITextField> > selectorWithWait) { Threaded <Session> .CurrentBlock <SlowPageWithExplicitWait>() .Apply(selectorWithWait) .Text .VerifyThat(t => t.Should().Be("Todd")); }
public void When_item_that_does_not_exist_is_selected_by_index_Then_exception_is_thrown() { Action fn = () => Threaded <Session> .CurrentPage <SelectPage>() .Toppings.SelectByIndex(-1); fn.ShouldThrow <NoSuchElementException>(); }
public void When_grandparent_is_searched_for_Then_no_exception_is_thrown() { Threaded <Session> .CurrentBlock <JavaScriptPopUpPage>() .Region.OpenPopUp.Click() .Close.Click() .Verify(x => x.OpenPopUp.Text == "Open Pop Up"); }
public void When_item_that_does_not_exist_is_selected_by_value_Then_exception_is_thrown() { Action fn = () => Threaded <Session> .CurrentPage <HundredThousandItemSelectPage>() .SelectBox.SelectByValue("Hello"); fn.ShouldThrow <NoSuchElementException>(); }
public void When_finding_with_wait_Then_should_return_value() { Threaded <Session> .CurrentPage <SlowPageWithJQuery>() .TheLinkWithTimeout .Text .VerifyThat(t => t.Should().Be("The Link"));; }
public void When_loading_with_driver_Then_should_return_session_with_correct_driver_with_default_settings() { Threaded <Session> .With(new PhantomJS()) .Verify(x => x.Driver is PhantomJSDriver) .VerifyThat(x => x.Settings.ShouldBeEquivalentTo(new Settings())) .End(); }
public void Then_option_should_be_selected() { Threaded <Session> .CurrentBlock <KendoDropDownListDemoPage>() .VerifyThat(p => p.Sizes .Options.First(x => x.Text == TextForSizeOption) .Selected.Should().BeTrue()); }
public void When_setting_current_value_as_text_Then_enters_text_and_parses_double() { Threaded <Session> .CurrentBlock <KendoNumericTextBoxDemoPage>() .Price.EnterText("45.12") .VerifyThat(p => p.Price.Text.Should().Be("$45.12")) .VerifyThat(p => p.Price.Value.Should().Be(45.12)); }
public void Given_session_has_been_loaded_with_driver_When_ending_THen_should_end_session() { Threaded <Session> .With <PhantomJS>(); Threaded <Session> .End(); }
public void BeforeEach() { Threaded <Session> .End(); Threaded <DerivedSession> .End(); Threaded <DerivedSessionWithWrongArgs> .End(); }
public void When_getting_text_for_options_Then_should_return_text_for_each_option() { Threaded <Session> .CurrentBlock <KendoDropDownListDemoPage>() .VerifyThat(p => p.Sizes .Options .Select(o => o.Text) .Should().ContainInOrder("S - 6 3/4\"", "M - 7 1/4\"", "L - 7 1/8\"", "XL - 7 5/8\"")); }
public void ThenTheTaskWithTitleShouldAppearInMyListOfTasks(string name) { Threaded <Session> .CurrentBlock <MainArea>() .TaskLists.First(list => list.Name == "Standalone Actions") .TaskRows.First(row => row.Name == name) .Verify("that row should exist", row => row != null) .Delete(); }
public void GivenIAmLoggedIn() { Threaded <Session> .With <LocalFirefoxEnvironment>() .NavigateTo <LoggedOutPage>(_settings.BaseUrl) .Username.EnterText(_settings.ValidUserName) .Password.EnterText(_settings.ValidPassword) .Login.Click <LoggedInPage>(); }
public void When_double_clicking_element_with_dynamic_page_Then_should_toggle_result() { Threaded <Session> .CurrentBlock <DoubleClickablePage>() .ParagraphWithDynamicPage.DoubleClick <DoubleClickablePage>() .VerifyThat(p => p.Result.Should().Be("Hello, World!")) .ParagraphWithDynamicPage.DoubleClick <DoubleClickablePage>() .VerifyThat(p => p.Result.Should().BeEmpty()); }
public void given_logged_out_when_at_front_page_then_posts_should_not_contain_selenium() { Threaded <Session> .CurrentBlock <LoggedOutPage>() .VerifyThat(page => page.Posts.Any(post => post.Subreddit.Text.Contains("selenium")) .Should().BeFalse("there should be no selenium subreddit posts on the front page")); }
public void given_logged_out_when_at_front_page_then_posts_should_contain_til() { Threaded <Session> .CurrentBlock <LoggedOutPage>() .VerifyThat(page => page.Posts.Any(post => post.Subreddit.Text.Contains("todayilearned")) .Should().BeTrue("there should be at least one til on the front page")); }
public override void Dispose() { After(); Threaded <Session> .End(); base.Dispose(); }
public void When_grandparent_link_clicked_Then_parent_text_does_not_change() { Threaded <Session> .CurrentBlock <NestedInlineFramesPage>() .ChildFrame .ChildFrame .GrandparentLink.Click() .VerifyThat(page => page.ChildFrame.Text.Should().Be("Not clicked.")); }
public void When_key_is_pressed_correct_key_event_is_fired(Key key) { Threaded <Session> .CurrentBlock <KeysPage>() .KeysText.Press(key) .VerifyThat(x => x.KeyPressed .Should() .Be(key.ToString())); }
public void When_entering_text_Then_text_should_work() { const string expectedText = "This is the text."; Threaded <Session> .CurrentBlock <TextFieldPage>() .Text.EnterText(expectedText) .VerifyThat(x => x.Text.Text.Should().Be(expectedText)); }
public void Given_default_option_selected_Then_only_one_option_should_be_selected() { Threaded <Session> .CurrentBlock <KendoDropDownListDemoPage>() .VerifyThat(p => p.Colors .Options .Where(o => o.Selected) .Should().HaveCount(1)); }
public void When_getting_text_of_textfield_using_wait_Should_wait() { Threaded <Session> .CurrentBlock <SlowBlockPage>() .CustomerInfoWithExplicitWait .FirstName .Text .Should().Be("Todd"); }
public void Given_option_does_not_exist_When_selecting_by_text_Then_should_not_find_any() { Threaded <Session> .CurrentBlock <RadioButtonsPage>() .VerifyThat(p => p.Beverages .Options.WithText("Test") .Any() .Should().BeFalse()); }
public void Given_session_not_loaded_with_navigation_When_getting_current_page_Then_should_throw() { Action action = () => Threaded <Session> .CurrentPage <DefaultPage>(); action.ShouldThrow <NullReferenceException>() .WithMessage("You cannot access the current page without first initializing the Session by calling With<TDriverEnvironment>()."); }
public void Then_other_options_should_not_be_selected() { Threaded <Session> .CurrentBlock <KendoDropDownListDemoPage>() .VerifyThat(p => p.Sizes .Options .Where(x => x.Text != TextForSizeOption).ToList() .ForEach(x => x.Selected.Should().BeFalse())); }
public void given_session_type_with_wrong_constructor_args_when_loading_with_driver_should_throw() { Action action = () => Threaded <DerivedSessionWithWrongArgs> .With <LocalPhantomEnvironment>(); action .ShouldThrow <ArgumentException>() .WithMessage("The result type specified (Bumblebee.IntegrationTests.Sessions.DerivedSessionWithWrongArgs) is not a valid session. It must have a constructor that takes only an IDriverEnvironment."); }