예제 #1
0
 public void When_reading_default_date_Then_reads_text_and_value()
 {
     Threaded <Session>
     .CurrentBlock <KendoDatePickerDemoPage>()
     .VerifyThat(p => p.DateFrom.Text.Should().Be("2011-10-10"))
     .VerifyThat(p => p.DateFrom.Value.Should().Be(DateTime.Parse("2011-10-10")));
 }
 public void Given_page_should_not_have_jQuery()
 {
     Threaded <Session>
     .CurrentBlock <PageWithJQuery>()
     .Session.HasJQuery()
     .Should().BeFalse();
 }
 public void When_page_loaded_unchecked_checkbox_is_initially_unchecked()
 {
     Threaded <Session>
     .CurrentBlock <CheckboxPage>()
     .UncheckedCheckbox
     .VerifyThat(x => x.Selected.Should().BeFalse());
 }
        public void given_valid_logged_in_user_when_adding_task_should_add_task()
        {
            Threaded <Session>
            .With <Chrome>()
            .NavigateTo <LoggedOutPage>(Url)
            .Username.EnterText(ValidUsername)
            .Password.EnterText(Password)
            .Login.Click <UpgradePromptPage>()
            .NotNow.Click();

            var taskInfo = new { Name = string.Format("Task {0}", Guid.NewGuid()), Note = "This is a note." };

            Threaded <Session>
            .CurrentBlock <LoggedInPage>()
            .ToolBar
            .NewTask.Click()
            .Name.EnterText(taskInfo.Name)
            .Note.EnterText(taskInfo.Note)
            .Save.Click()
            .TaskLists.First(list => list.Name == "Actions")
            .TaskRows.First(row => row.Name == taskInfo.Name)
            .VerifyThat(row => row.Should().NotBeNull())
            .Delete();

            Threaded <Session>
            .End();
        }
예제 #5
0
 public void HasJQuery()
 {
     Threaded <Session>
     .CurrentBlock <PageWithJQuery>()
     .Session.HasJQuery()
     .Should().BeTrue();
 }
 public void When_getting_current_value_Then_parses_double()
 {
     Threaded <Session>
     .CurrentBlock <KendoNumericTextBoxDemoPage>()
     .VerifyThat(p => p.Price.Text.Should().Be("$30.00"))
     .VerifyThat(p => p.Price.Value.Should().Be(30));
 }
예제 #7
0
 public void When_parent_link_is_clicked_Then_parent_text_changes()
 {
     Threaded <Session>
     .CurrentBlock <InlineFramesPage>()
     .Child.TheLink.Click()
     .VerifyThat(page => page.Text.Should().Be("Clicked."));
 }
예제 #8
0
 public void When_writing_date_as_text_Then_writes_and_reads_text_and_value()
 {
     Threaded <Session>
     .CurrentBlock <KendoDatePickerDemoPage>()
     .DateFrom.EnterText(DateTime.Today.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture))
     .VerifyThat(p => p.DateFrom.Text.Should().Be(DateTime.Today.ToString("yyyy-MM-dd")))
     .VerifyThat(p => p.DateFrom.Value.Should().Be(DateTime.Today));
 }
 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 When_getting_text_of_textfield_using_wait_Should_wait()
 {
     Threaded <Session>
     .CurrentBlock <SlowPageWithExplicitWait>()
     .FirstName
     .Text
     .Should().Be("Todd");
 }
예제 #11
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);
 }
예제 #12
0
 public void When_entering_number_Then_text_and_value_work()
 {
     Threaded <Session>
     .CurrentBlock <NumericFieldPage>()
     .Number.EnterNumber(5)
     .VerifyThat(x => x.Number.Value.Should().Be(5))
     .VerifyThat(x => x.Number.Text.Should().Be("5"));
 }
 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"));
 }
예제 #14
0
 public void BeforeAutoLoginScenario()
 {
     Threaded <Session>
     .CurrentBlock <LoggedOutPage>()
     .Username.EnterText(_settings.ValidUserName)
     .Password.EnterText(_settings.ValidPassword)
     .Login.Click <LoggedInPage>();
 }
 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_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_getting_checked_indicator_of_checkbox_using_wait_Should_wait()
 {
     Threaded <Session>
     .CurrentBlock <SlowPageWithExplicitWait>()
     .Checkbox
     .Selected
     .Should().BeTrue();
 }
 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."));
 }
예제 #19
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"));
 }
예제 #20
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));
 }
예제 #21
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();
 }
 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()));
 }
예제 #23
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"));
 }
예제 #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));
        }
예제 #25
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());
 }
 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());
 }
예제 #27
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\""));
 }
예제 #28
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()));
 }
        public void When_finding_textfield_by_selector_with_no_wait_Then_should_throw(Expression <Func <SlowPageWithExplicitWait, ITextField> > selectorWithNoWait)
        {
            Action action = () => Threaded <Session>
                            .CurrentBlock <SlowPageWithExplicitWait>()
                            .Apply(selectorWithNoWait)
                            .Text
                            .VerifyThat(t => t.Should().Be("Todd"));

            action.ShouldThrow <NotFoundException>();
        }
 public void When_unchecked_checkbox_is_checked_Then_it_gets_checked()
 {
     Threaded <Session>
     .CurrentBlock <CheckboxPage>()
     .UncheckedCheckbox
     .VerifyThat(x => x.Selected.Should().BeFalse())
     .Check()
     .UncheckedCheckbox
     .VerifyThat(x => x.Selected.Should().BeTrue());
 }