public void When_getting_current_page_as_incorrect_type_Then_should_return_page()
 {
     Threaded <Session>
     .CurrentPage <KeysPage>()
     .VerifyThat(p => p.Should().NotBeNull())
     .VerifyThat(p => p.Should().BeOfType <KeysPage>());
 }
 public void When_nothing_is_selected_Then_SelectedOptions_is_empty()
 {
     Threaded <Session>
     .CurrentPage <SelectPage>()
     .Toppings.SelectedOptions
     .Should().BeEmpty();
 }
 public void Then_IsMultiSelect_is_true()
 {
     Threaded <Session>
     .CurrentPage <SelectPage>()
     .Toppings
     .IsMultiSelect.Should().BeTrue();
 }
 public void When_nothing_is_selected_Then_SelectedOption_is_null()
 {
     Threaded <Session>
     .CurrentPage <SelectPage>()
     .Toppings.SelectedOption
     .Should().Be(null);
 }
Ejemplo n.º 5
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>();
        }
        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>();
        }
Ejemplo n.º 7
0
 public void When_finding_with_wait_Then_should_return_value()
 {
     Threaded <Session>
     .CurrentPage <SlowPageWithJQuery>()
     .TheLinkWithTimeout
     .Text
     .VerifyThat(t => t.Should().Be("The Link"));;
 }
Ejemplo n.º 8
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>().");
        }
Ejemplo n.º 9
0
        public void When_item_is_selected_by_value_Then_item_is_selected()
        {
            var value = "74892";

            Threaded <Session>
            .CurrentPage <HundredThousandItemSelectPage>()
            .SelectBox.SelectByValue(value)
            .Session.ExecuteJavaScript <string>("var element = document.getElementById('HundredThousandItemSelect'), index = element.selectedIndex; return (index === -1) ? null : element.options[index].value;")
            .Should().Be(value);
        }
        public void When_item_is_selected_by_index_Then_item_is_selected()
        {
            var index = 0;

            Threaded <Session>
            .CurrentPage <SelectPage>()
            .Toppings.SelectByIndex(index)
            .Toppings.SelectedOption
            .GetAttribute("value").Should().Be("1");
        }
        public void When_item_is_selected_by_value_Then_item_is_selected()
        {
            var value = "2";

            Threaded <Session>
            .CurrentPage <SelectPage>()
            .Toppings.SelectByValue(value)
            .Toppings.SelectedOption
            .GetAttribute("value").Should().Be(value);
        }
        public void When_item_is_selected_by_text_Then_item_is_selected()
        {
            var text = "onions";

            Threaded <Session>
            .CurrentPage <SelectPage>()
            .Toppings.SelectByText(text)
            .Toppings.SelectedOption
            .Text.Should().Be(text);
        }
Ejemplo n.º 13
0
        public void When_finding_with_no_wait_Then_exception_should_be_thrown()
        {
            Action action = () => Threaded <Session>
                            .CurrentPage <SlowPageWithJQuery>()
                            .TheLinkWithNoTimeout
                            .Text
                            .VerifyThat(t => t.Should().Be("The Link"));

            action.ShouldThrow <NoSuchElementException>();
        }
 public void TestSetUp()
 {
     Threaded <Session>
     .CurrentPage <SelectPage>()
     .Toppings.DeselectAll();
 }