Exemplo n.º 1
0
 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();
 }
Exemplo n.º 4
0
 public void BeforeAutoLoginScenario()
 {
     Threaded <Session>
     .CurrentBlock <LoggedOutPage>()
     .Username.EnterText(_settings.ValidUserName)
     .Password.EnterText(_settings.ValidPassword)
     .Login.Click <LoggedInPage>();
 }
Exemplo n.º 5
0
 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>();
        }
Exemplo n.º 7
0
 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");
 }
Exemplo n.º 8
0
        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>();
        }
Exemplo n.º 9
0
 public void When_finding_with_wait_Then_should_return_value()
 {
     Threaded <Session>
     .CurrentPage <SlowPageWithJQuery>()
     .TheLinkWithTimeout
     .Text
     .VerifyThat(t => t.Should().Be("The Link"));;
 }
Exemplo n.º 10
0
 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();
 }
Exemplo n.º 11
0
 public void Then_option_should_be_selected()
 {
     Threaded <Session>
     .CurrentBlock <KendoDropDownListDemoPage>()
     .VerifyThat(p => p.Sizes
                 .Options.First(x => x.Text == TextForSizeOption)
                 .Selected.Should().BeTrue());
 }
Exemplo n.º 12
0
 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));
 }
Exemplo n.º 13
0
        public void Given_session_has_been_loaded_with_driver_When_ending_THen_should_end_session()
        {
            Threaded <Session>
            .With <PhantomJS>();

            Threaded <Session>
            .End();
        }
Exemplo n.º 14
0
        public void BeforeEach()
        {
            Threaded <Session> .End();

            Threaded <DerivedSession> .End();

            Threaded <DerivedSessionWithWrongArgs> .End();
        }
Exemplo n.º 15
0
 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\""));
 }
Exemplo n.º 16
0
 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();
 }
Exemplo n.º 17
0
 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());
 }
Exemplo n.º 19
0
 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"));
 }
Exemplo n.º 20
0
 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."));
 }
Exemplo n.º 23
0
 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()));
 }
Exemplo n.º 24
0
        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));
        }
Exemplo n.º 25
0
 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));
 }
Exemplo n.º 26
0
 public void When_getting_text_of_textfield_using_wait_Should_wait()
 {
     Threaded <Session>
     .CurrentBlock <SlowBlockPage>()
     .CustomerInfoWithExplicitWait
     .FirstName
     .Text
     .Should().Be("Todd");
 }
Exemplo n.º 27
0
 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());
 }
Exemplo n.º 28
0
        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()));
 }
Exemplo n.º 30
0
        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.");
        }