Exemple #1
0
 protected override void PerformAs(IPerformer actor)
 {
     actor.Perform(OpenTheirBrowserOn.ThePage(SprintList.ForOpenSprints()));
     actor.Perform(Wait.Until(SprintList.SprintListTable).IsVisible());
     actor.Perform(Navigate.ToAnotherPageByClicking(SprintList.TheSprintNamed(sprintTitle)));
     actor.Perform(Wait.Until(SprintDetail.SprintName).IsVisible());
 }
Exemple #2
0
        protected override void PerformAs(IPerformer actor)
        {
            actor.Perform(Wait.ForAtMost(5).Seconds().OrUntil(EditTicket.TicketLabelsInputBox).IsVisible());

            actor.Perform(RemoveAllOfTheLabels.FromTheTicket());
            actor.Perform(EnterTheLabels.Named(newLabels));
        }
Exemple #3
0
        protected override void PerformAs(IPerformer actor)
        {
            if (expectedDetails.Title != null)
            {
                actor.Perform(TheText.Of(SprintDetail.SprintName))
                .Should()
                .Be(expectedDetails.Title, because: "the title should match");
            }

            if (expectedDetails.StartDate != null)
            {
                var dateString = actor.Perform(TheText.Of(SprintDetail.StartDate));
                var date       = DateTime.Parse(dateString);

                date.Should()
                .Be(expectedDetails.StartDate.Value, because: "the start date should match");
            }

            if (expectedDetails.EndDate != null)
            {
                var dateString = actor.Perform(TheText.Of(SprintDetail.EndDate));
                var date       = DateTime.Parse(dateString);

                date.Should()
                .Be(expectedDetails.EndDate.Value, because: "the end date should match");
            }

            if (expectedDetails.Description != null)
            {
                actor.Perform(TheText.Of(SprintDetail.Description))
                .Should()
                .Be(expectedDetails.Description, because: "the description should match");
            }
        }
Exemple #4
0
 protected override void PerformAs(IPerformer actor)
 {
     actor.Perform(Enter.TheText(username).Into(HeaderLoginLogoutWidget.OnAnyPage.UsernameField));
     actor.Perform(Enter.TheText(password).Into(HeaderLoginLogoutWidget.OnAnyPage.PasswordField));
     actor.Perform(Navigate.ToAnotherPageByClicking(HeaderLoginLogoutWidget.OnAnyPage.LoginButton));
     actor.Perform(Wait.Until(LoginPage.Heading).IsVisible());
 }
        protected override void PerformAs(IPerformer actor)
        {
            var loginAbility = actor.GetAbility <LogInWithAUserAccount>();

            actor.Perform <VisitTheHomePage>();
            actor.Perform(LogIntoTheSite.As(loginAbility.Username).WithThePassword(loginAbility.Password));
        }
        protected override void PerformAs(IPerformer actor)
        {
            var boldElements = actor.Perform(Elements.In(SprintDetail.Description).ThatAre(Bold).Called("the bold text"));
            var boldTexts    = actor.Perform(TheText.OfAll(boldElements));

            boldTexts.Should().Contain(expectedBoldText, because: $"The word '{expectedBoldText}' should be bold");
        }
Exemple #7
0
 protected override void PerformAs(IPerformer actor)
 {
     actor.Perform(Clear.TheContentsOf(TicketDetail.AddCommentBody));
     actor.Perform(Enter.TheText(commentText).Into(TicketDetail.AddCommentBody));
     actor.Perform(Navigate.ToAnotherPageByClicking(TicketDetail.AddCommentSubmitButton));
     actor.Perform(Wait.Until(TicketDetail.AddCommentFeedbackMessage).IsVisible());
 }
    protected override void PerformAs(IPerformer actor)
    {
        // You may need to update the URL based on your test hosting
        actor.Perform(OpenTheirBrowserOn.TheUrl("http://localhost/"));
        var thePage = new CssSelector("body", "the page");

        actor.Perform(Wait.Until(thePage).IsVisible());
    }
Exemple #9
0
 protected override void PerformAs(IPerformer actor)
 {
     actor.Perform(OpenTheirBrowserOn.ThePage <ChangePassword>());
     actor.Perform(Enter.TheText(oldPassword).Into(ChangePassword.ExistingPassword));
     actor.Perform(Enter.TheText(newPassword).Into(ChangePassword.NewPassword));
     actor.Perform(Enter.TheText(newPassword).Into(ChangePassword.ConfirmNewPassword));
     actor.Perform(Navigate.ToAnotherPageByClicking(ChangePassword.SubmitChangePasswordButton));
 }
Exemple #10
0
        protected override void PerformAs(IPerformer actor)
        {
            var removeButtons = actor.Perform(Elements.InThePageBody().ThatAre(EditTicket.RemoveLabelButtons).Called("The remove buttons"));

            foreach (var button in removeButtons.Elements)
            {
                actor.Perform(Click.On(button));
            }
        }
Exemple #11
0
 public static void PreOrderTravers(Node root)
 {
     if (root != null)
     {
         Performer.Perform(root.Key);
         PreOrderTravers(root.Left);
         PreOrderTravers(root.Right);
     }
 }
        protected override void PerformAs(IPerformer actor)
        {
            var links = actor.Perform(Elements.InThePageBody()
                                      .ThatAre(TicketDetail.Comments.EditCommentLink)
                                      .Called("the edit comment links"));

            actor.Perform(Navigate.ToAnotherPageByClicking(links.Elements.First()));
            actor.Perform(Wait.Until(EditComment.EditCommentForm).IsVisible());
        }
Exemple #13
0
        protected override void PerformAs(IPerformer actor)
        {
            var links = actor.Perform(Elements.InThePageBody()
                                      .ThatAre(TicketDetail.Comments.DeleteCommentButton)
                                      .Called("the delete comment buttons"));

            actor.Perform(Navigate.ToAnotherPageByClicking(links.Elements.First()));
            actor.Perform(Wait.Until(DeleteComment.ConfirmButton).IsVisible());
        }
Exemple #14
0
        protected override void PerformAs(IPerformer actor)
        {
            var tickets = actor.Perform(FindTickets.WithTheTitle(title));

            tickets.Elements.Should().NotBeEmpty("At least one ticket must exist");

            actor.Perform(TheVisibility.Of(tickets))
            .Should()
            .BeTrue("The ticket must visible.");
        }
    protected override void PerformAs(IPerformer actor)
    {
        var newItemTextbox = new CssSelector("#newItemText", "the new-item text box");

        actor.Perform(Enter.TheText(item).Into(newItemTextbox));

        var theAddButton = new CssSelector("#newItemButton", "the add-item button");

        actor.Perform(Click.On(theAddButton));
    }
 protected override void PerformAs(IPerformer actor)
 {
     actor.Perform(Invoke
                   .TheJsonWebService <OverrideVersionNumberService>()
                   .WithTheData(new { version })
                   .AndVerifyItSucceeds());
 }
Exemple #17
0
        protected override void PerformAs(IPerformer actor)
        {
            if (String.IsNullOrWhiteSpace(labels))
            {
                return;
            }

            actor.Perform(Wait.ForAtMost(5).Seconds().OrUntil(EditTicket.TicketLabelsInputBox).IsVisible());

            var labelNames = labels.Split(',');

            foreach (var name in labelNames)
            {
                actor.Perform(EnterALabel.Named(name));
            }
        }
    protected override string PerformAs(IPerformer actor)
    {
        var topItem = new CssSelector("#toDoList :first-child", "the top to-do item");
        var text    = actor.Perform(TheText.Of(topItem));

        return(text);
    }
        protected override void PerformAs(IPerformer actor)
        {
            actor.Perform(OpenTheirBrowserOn.ThePage <TicketList>());

            var ticket = actor.Perform(FindTickets.WithTheTitle(title))
                         .Elements
                         .FirstOrDefault();

            ticket.Should().NotBeNull("The ticket must exist");

            var ticketLink = actor.Perform(Elements.In(ticket).ThatAre(TicketList.TicketLink)
                                           .Called($"the hyperlink for ticket '{title}'"));

            actor.Perform(Navigate.ToAnotherPageByClicking(ticketLink));
            actor.Perform(Wait.Until(TicketDetail.TitleContent).IsVisible());
        }
Exemple #20
0
        protected override void PerformAs(IPerformer actor)
        {
            if (spec.Title != null)
            {
                actor.Perform(Clear.TheContentsOf(EditSprint.SprintName));
                actor.Perform(Enter.TheText(spec.Title).Into(EditSprint.SprintName));
            }

            if (spec.Description != null)
            {
                actor.Perform(Clear.TheContentsOf(EditSprint.Description));
                actor.Perform(Enter.TheText(spec.Description).Into(EditSprint.Description));
            }

            if (spec.StartDate.HasValue)
            {
                actor.Perform(Enter.TheDate(spec.StartDate.Value).Into(EditSprint.StartDate));
            }

            if (spec.EndDate.HasValue)
            {
                actor.Perform(Enter.TheDate(spec.EndDate.Value).Into(EditSprint.EndDate));
            }

            actor.Perform(Navigate.ToAnotherPageByClicking(EditSprint.SubmitButton));
        }
Exemple #21
0
        protected override void PerformAs(IPerformer actor)
        {
            actor.Perform(OpenTheirBrowserOn.ThePage <CreateNewTicket>());

            if (!String.IsNullOrEmpty(details.Title))
            {
                actor.Perform(Enter.TheText(details.Title).Into(CreateNewTicket.TicketTitle));
            }

            if (!String.IsNullOrEmpty(details.Description))
            {
                actor.Perform(Enter.TheText(details.Description).Into(CreateNewTicket.TicketDescription));
            }

            if (!String.IsNullOrEmpty(details.Labels))
            {
                actor.Perform(EnterTheLabels.Named(details.Labels));
            }

            if (!String.IsNullOrEmpty(details.Sprint))
            {
                actor.Perform(Select.Item(details.Sprint).From(CreateNewTicket.TicketSprint));
            }

            if (!String.IsNullOrEmpty(details.Type))
            {
                actor.Perform(Select.Item(details.Type).From(CreateNewTicket.TicketType));
            }

            actor.Perform(Navigate.ToAnotherPageByClicking(CreateNewTicket.CreateButton));
        }
        ElementCollection GetHyperlink(IPerformer actor)
        {
            var haveTheSpecifiedText = Matcher.Create(new TextQuery(), x => x == linkText);
            var theLink = actor.Perform(Elements.In(TicketDetail.DescriptionContent)
                                        .ThatAre(Hyperlinks)
                                        .That(haveTheSpecifiedText)
                                        .Called("the chosen hyperlink"));

            return(theLink);
        }
Exemple #23
0
        protected override void PerformAs(IPerformer actor)
        {
            actor.Perform(Clear.TheContentsOf(CreateSprint.Name));

            if (details.Title != null)
            {
                actor.Perform(Enter.TheText(details.Title).Into(CreateSprint.Name));
            }

            if (details.StartDate.HasValue)
            {
                actor.Perform(Enter.TheDate(details.StartDate.Value).Into(CreateSprint.StartDate));
            }

            if (details.EndDate.HasValue)
            {
                actor.Perform(Enter.TheDate(details.EndDate.Value).Into(CreateSprint.EndDate));
            }

            actor.Perform(Navigate.ToAnotherPageByClicking(CreateSprint.SubmitButton));
        }
Exemple #24
0
        IWebElementAdapter GetMatchingElement(IPerformer actor)
        {
            var elements = actor.Perform(Elements.In(container)
                                         .That(Matcher.Create(new TextQuery(), txt => txt == expectedText))
                                         .Called("the matching text"));

            elements.Elements
            .Should()
            .HaveCount(x => x >= 1, because: "there should be at least one piece of matching text");

            return(elements.Elements.First());
        }
Exemple #25
0
        public void Start(int vertex)
        {
            _visited[vertex] = true;
            _performer.Perform(vertex);

            for (var i = 0; i < _graph.Edges.Count; i++)
            {
                if (_graph.Edges[i].U == vertex && !_visited[_graph.Edges[i].V])
                {
                    Start(_graph.Edges[i].V);
                }
            }
        }
Exemple #26
0
        IWebElementAdapter GetTheLabelElement(IPerformer actor)
        {
            var desiredLabelElement = actor.Perform(Elements
                                                    .In(LabelList.TheLabelList)
                                                    .ThatAre(LabelList.LabelItems)
                                                    .That(IsTheCorrectLabel())
                                                    .Called($"the '{labelName}' label"));

            if (desiredLabelElement.Elements.Count != 1)
            {
                throw new MissingLabelException($"The label '{labelName}' was not found in the list");
            }

            return(desiredLabelElement.Elements.First());
        }
Exemple #27
0
 protected override void PerformAs(IPerformer actor)
 {
     actor.Perform <OpenTheHomePage>();
 }
Exemple #28
0
        int GetCountOfClosedTickets(IPerformer actor, IWebElementAdapter labelElement)
        {
            var theCount = actor.Perform(Elements.In(labelElement).ThatAre(LabelList.ClosedTicketCount).Called("the count of closed tickets"));

            return(actor.Perform(TheText.From(theCount).As <int>()));
        }
Exemple #29
0
 protected override void PerformAs(IPerformer actor)
 {
     actor.Perform(ViewTheSprintDetail.ForSprint(sprintTitle));
     actor.Perform(Navigate.ToAnotherPageByClicking(SprintDetail.EditLink));
     actor.Perform(Wait.Until(EditSprint.SprintName).IsVisible());
 }
Exemple #30
0
 protected override void PerformAs(IPerformer actor)
 {
     actor.Perform(Navigate.ToAnotherPageByClicking(HeaderLoginLogoutWidget.OnAnyPage.LogoutButton));
 }