示例#1
0
        public async Task RetrospectiveLobby_WritingStage_CanAddNote()
        {
            // Given
            await this.SetRetrospective(retro => retro.CurrentStage = RetrospectiveStage.Writing);

            await Task.WhenAll(
                Task.Run(() => this.Join(this.Client1, true)),
                Task.Run(() => this.Join(this.Client2, false))
                );

            this.WaitNavigatedToLobby();

            // When
            NoteLaneComponent noteLane = this.Client2.GetLane(KnownNoteLane.Continue);

            noteLane.AddNoteButton.Click();

            // Then
            this.MultiAssert(client => {
                Assert.That(() => client.GetLane(KnownNoteLane.Continue).NoteElements, Has.Count.EqualTo(1).Retry());
                Assert.That(() => client.GetLane(KnownNoteLane.Start).NoteElements, Has.Count.EqualTo(0).Retry());
                Assert.That(() => client.GetLane(KnownNoteLane.Stop).NoteElements, Has.Count.EqualTo(0).Retry());
            });

            // When
            NoteComponent note     = noteLane.Notes.First();
            string        noteText = "some content which does not really matter to me";

            note.Input.SendKeys(noteText);

            // Then
            Assert.That(() => this.Client1.GetLane(KnownNoteLane.Continue).Notes.First().Content.Text,
                        Has.Length.EqualTo(noteText.Length).And.Not.EqualTo(noteText).Retry(),
                        "Client 1 does not have the the garbled text from client 2");
        }
示例#2
0
        public async Task RetrospectiveLobby_GroupingStage_CanAddNoteGroup()
        {
            // Given
            using (IServiceScope scope = this.App.CreateTestServiceScope()) {
                await scope.TestCaseBuilder(this.RetroId).
                WithParticipant("Boss", true, "scrummaster").
                WithParticipant("Josh", false).
                WithParticipant("Foo", false).
                WithParticipant("Bar", false).
                WithParticipant("Baz", false).
                WithRetrospectiveStage(RetrospectiveStage.Writing).
                WithNote(KnownNoteLane.Start, "Josh").
                WithNote(KnownNoteLane.Continue, "Boss").
                WithNote(KnownNoteLane.Continue, "Bar").
                WithNote(KnownNoteLane.Continue, "Baz").
                WithNote(KnownNoteLane.Stop, "Foo").
                WithNote(KnownNoteLane.Start, "Foo").
                WithNote(KnownNoteLane.Start, "Boss").
                WithRetrospectiveStage(RetrospectiveStage.Grouping).
                WithNoteGroup("Boss", KnownNoteLane.Start, "Some name").
                Build();
            }

            await Task.WhenAll(
                Task.Run(() => this.Join(this.Client1, true, "Boss", alreadyJoined: true)),
                Task.Run(() => this.Join(this.Client2, false, "Josh", true))
                );

            this.WaitNavigatedToLobby();

            // When
            NoteLaneComponent noteLane = this.Client1.GetLane(KnownNoteLane.Continue);

            noteLane.AddNoteGroupButton.Click();

            // Then
            this.MultiAssert(client => {
                Assert.That(() => client.GetLane(KnownNoteLane.Continue).NoteGroupElements, Has.Count.EqualTo(1).Retry());
                Assert.That(() => client.GetLane(KnownNoteLane.Start).NoteGroupElements, Has.Count.EqualTo(1).Retry());
                Assert.That(() => client.GetLane(KnownNoteLane.Stop).NoteGroupElements, Has.Count.EqualTo(0).Retry());
            });

            // When
            int lastAddedNoteGroupId    = this.App.GetLastAddedId <NoteGroup>();
            NoteGroupComponent note     = noteLane.NoteGroups.First(x => x.Id == lastAddedNoteGroupId);
            string             noteText = "title of new notegroup";

            note.Input.SendKeys(noteText);
            this.Client1.Unfocus(); // Unfocus to propagate change

            // Then
            Assert.That(() => this.Client2.GetLane(KnownNoteLane.Continue).NoteGroups.First(x => x.Id == lastAddedNoteGroupId).Title.Text,
                        Has.Length.EqualTo(noteText.Length).And.EqualTo(noteText).Retry(),
                        "Client 1 does not have the the title text from client 2");
        }
示例#3
0
        public async Task RetrospectiveLobby_WritingStage_CanDeleteNote_Shortcut()
        {
            // Given
            int noteId = 0;

            using (IServiceScope scope = this.App.CreateTestServiceScope()) {
                await scope.TestCaseBuilder(this.RetroId).
                WithParticipant("Boss", true, "scrummaster").
                WithParticipant("Josh", false).
                WithRetrospectiveStage(RetrospectiveStage.Writing).
                WithNote(KnownNoteLane.Start, "Josh").
                WithNote(KnownNoteLane.Continue, "Josh").
                WithNote(KnownNoteLane.Continue, "Boss").
                OutputId(id => noteId = id).
                WithNote(KnownNoteLane.Continue, "Boss").
                Build();
            }

            await Task.WhenAll(
                Task.Run(() => this.Join(this.Client1, true, "Boss", alreadyJoined: true)),
                Task.Run(() => this.Join(this.Client2, false, "Josh", true))
                );

            this.WaitNavigatedToLobby();

            this.MultiAssert(client => {
                Assert.That(() => client.GetLane(KnownNoteLane.Continue).NoteElements, Has.Count.EqualTo(3).Retry());
                Assert.That(() => client.GetLane(KnownNoteLane.Start).NoteElements, Has.Count.EqualTo(1).Retry());
                Assert.That(() => client.GetLane(KnownNoteLane.Stop).NoteElements, Has.Count.EqualTo(0).Retry());
            });

            // When
            NoteLaneComponent noteLane = this.Client1.GetLane(KnownNoteLane.Continue);
            NoteComponent     note     = noteLane.Notes.First(x => x.Id == noteId);

            new Actions(this.Client1.WebDriver)
            .KeyDown(note.Input, Keys.Control)
            .SendKeys(Keys.Delete)
            .KeyUp(Keys.Control)
            .Perform();

            // Then
            this.MultiAssert(client => {
                NoteLaneComponent clientNoteLane = client.GetLane(KnownNoteLane.Continue);

                Assert.That(() => clientNoteLane.NoteElements, Has.Count.EqualTo(2).Retry());
                Assert.That(() => clientNoteLane.Notes.Select(x => x.Id).ToArray(), Does.Not.Contain(noteId).Retry());
            });
        }
示例#4
0
        public async Task RetrospectiveLobby_WritingStage_CanAddNote_Shortcut()
        {
            // Given
            await this.SetRetrospective(retro => retro.CurrentStage = RetrospectiveStage.Writing);

            await Task.WhenAll(
                Task.Run(() => this.Join(this.Client1, true)),
                Task.Run(() => this.Join(this.Client2, false))
                );

            this.WaitNavigatedToLobby();

            // When
            int laneNumber = (int)KnownNoteLane.Continue;

            new Actions(this.Client2.WebDriver)
            .KeyDown(Keys.Control)
            .SendKeys(laneNumber.ToString(Culture.Invariant))
            .KeyUp(Keys.Control)
            .Perform();

            // Then
            this.MultiAssert(client => {
                Assert.That(() => client.GetLane(KnownNoteLane.Continue).NoteElements, Has.Count.EqualTo(1).Retry());
                Assert.That(() => client.GetLane(KnownNoteLane.Start).NoteElements, Has.Count.EqualTo(0).Retry());
                Assert.That(() => client.GetLane(KnownNoteLane.Stop).NoteElements, Has.Count.EqualTo(0).Retry());
            });

            // When
            NoteLaneComponent noteLane = this.Client2.GetLane(KnownNoteLane.Continue);
            NoteComponent     note     = noteLane.Notes.First();
            string            noteText = "some content which does not really matter to me";

            note.Input.SendKeys(noteText);

            // Then
            Assert.That(() => this.Client1.GetLane(KnownNoteLane.Continue).Notes.First().Content.Text,
                        Has.Length.EqualTo(noteText.Length).And.Not.EqualTo(noteText).Retry(),
                        "Client 1 does not have the the garbled text from client 2");
        }
示例#5
0
        public async Task Screenshot_Writing()
        {
            this.EnsureRetrospectiveInStage(RetrospectiveStage.NotStarted);

            // Given
            using (IServiceScope scope = this.App.CreateTestServiceScope()) {
                await scope.SetRetrospective(this.RetroId, r => r.HashedPassphrase = null);
            }

            this.Join(this.Client1, true, "Roger", colorName: "Driver", submitCallback: () => CreateDocScreenshot(this.Client1.WebDriver, "join-retro"));
            this.Join(this.Client2, false, "Hong", colorName: "green");

            this.WaitNavigatedToLobby();

            this.Client1.TimeInMinutesInput.Clear();
            this.Client1.TimeInMinutesInput.SendKeys("5");
            this.Client1.TimeInMinutesInput.SendKeys(Keys.Tab);
            Thread.Sleep(10000);
            this.Client1.InvokeContinueWorkflow();

            // When
            TestContext.WriteLine("Attempting to find Note Lane button after state transition");
            Thread.Sleep(10000);
            this.Client2.WebDriver.Retry(_ => this.Client2.GetLane(KnownNoteLane.Continue).AddNoteButton.Displayed);

            var writtenNoteIds = new HashSet <int>();

            void WriteNote(RetrospectiveLobby client, KnownNoteLane laneId, string text)
            {
                NoteLaneComponent lane = client.GetLane(laneId);

                lane.AddNoteButton.Click();

                NoteComponent addedNote = client.WebDriver.Retry(_ => {
                    NoteComponent firstNote = lane.Notes.FirstOrDefault();
                    if (firstNote?.Input != null && writtenNoteIds.Add(firstNote.Id))
                    {
                        return(firstNote);
                    }

                    return(null);
                });

                addedNote.Input.SendKeys(text);
            }

            WriteNote(this.Client2, KnownNoteLane.Continue, "Using this framework, it works very productive");

            using (IServiceScope scope = this.App.CreateTestServiceScope()) {
                await scope.TestCaseBuilder(this.RetroId).
                HasExistingParticipant("Roger").
                HasExistingParticipant("Hong").
                WithParticipant("Aaron", false).
                WithParticipant("Ashley", false).
                WithParticipant("Josh", false).
                WithParticipant("Patrick", false).
                WithParticipant("Sarah", false).
                WithNote(KnownNoteLane.Continue, "Sarah", text: "Framework with good productivity").
                OutputId(id => this._continueFrameworkNoteId = id).
                WithNote(KnownNoteLane.Continue, "Josh", text: "Daily standup").
                OutputId(id => this._continueDailiesNoteIds.Add(id)).
                WithNote(KnownNoteLane.Continue, "Patrick", text: "Daily standups").
                OutputId(id => this._continueDailiesNoteIds.Add(id)).
                WithNote(KnownNoteLane.Continue, "Ashley", text: "Dailies").
                OutputId(id => this._continueDailiesNoteIds.Add(id)).
                WithNote(KnownNoteLane.Stop, "Patrick", text: "Changing the backlog in the sprint").
                OutputId(id => this._stopBacklogUnstableNoteIds.Add(id)).
                WithNote(KnownNoteLane.Stop, "Aaron", text: "Backlog story changes in sprint").
                OutputId(id => this._stopBacklogUnstableNoteIds.Add(id)).
                WithNote(KnownNoteLane.Stop, "Ashley", text: "Story backlog changes while sprint in progress").
                OutputId(id => this._stopBacklogUnstableNoteIds.Add(id)).
                WithNote(KnownNoteLane.Stop, "Ashley", text: "Adding more stories while sprint is in progress").
                OutputId(id => this._stopSprintScopeIncreasedNoteIds.Add(id)).
                WithNote(KnownNoteLane.Stop, "Josh", text: "Stop adding stories when sprint is underway").
                OutputId(id => this._stopSprintScopeIncreasedNoteIds.Add(id)).
                WithNote(KnownNoteLane.Stop, "Josh", text: "Long kick-off, distractions in sprint").
                OutputId(id => this._stopKickOffLongNoteIds.Add(id)).
                WithNote(KnownNoteLane.Stop, "Sarah", text: "Kick-off was very long").
                OutputId(id => this._stopKickOffLongNoteIds.Add(id)).
                WithNote(KnownNoteLane.Start, "Josh", text: "Start writing automated tests").
                OutputId(id => this._startAutomationGroupNoteIds.Add(id)).
                WithNote(KnownNoteLane.Start, "Patrick", text: "Use a proper definition of done").
                OutputId(id => this._startNoteDefinitionOfDoneId = id).
                WithNote(KnownNoteLane.Start, "Sarah", text: "Daily build should include basic tests").
                OutputId(id => this._startAutomationGroupNoteIds.Add(id)).
                Build();
            }

            WriteNote(this.Client1, KnownNoteLane.Start, "Daily builds should include automated smoke tests");
            this.AddLatestNoteIdToCollection(this._startAutomationGroupNoteIds);

            WriteNote(this.Client1, KnownNoteLane.Start, "Client should be present in retrospective");
            this._startClientRetroPresenceNoteId = this.GetLatestNoteId();

            WriteNote(this.Client2, KnownNoteLane.Continue, "Regular publish to acceptance environment");
            this._continueDailyBuildNoteId = this.GetLatestNoteId();

            CreateDocScreenshot(this.Client2.WebDriver, "writing");

            // Then
            this.Client1.InvokeContinueWorkflow();
        }
        public async Task RetrospectiveLobby_ShowsUpdatesVotes_OnVoting()
        {
            // Given
            int bossId        = 0;
            int participantId = 0;

            using (IServiceScope scope = this.App.CreateTestServiceScope()) {
                await scope.TestCaseBuilder(this.RetroId).
                WithParticipant("Boss", true, "scrummaster").
                OutputId(id => bossId = id).
                WithParticipant("Josh", false).
                OutputId(id => participantId = id).
                WithRetrospectiveStage(RetrospectiveStage.Writing).
                WithNote(KnownNoteLane.Start, "Josh").
                WithNote(KnownNoteLane.Continue, "Josh").
                WithNote(KnownNoteLane.Continue, "Boss").
                WithNote(KnownNoteLane.Continue, "Boss").
                WithNote(KnownNoteLane.Stop, "Boss").
                WithRetrospectiveStage(RetrospectiveStage.Grouping).
                Build();
            }

            await Task.WhenAll(
                Task.Run(() => this.Join(this.Client1, true, "Boss", alreadyJoined: true)),
                Task.Run(() => this.Join(this.Client2, false, "Josh", true))
                );

            this.WaitNavigatedToLobby();

            // When
            this.Client1.VoteCountInput.SendKeys("2");
            this.Client1.TimeInMinutesInput.SendKeys("10");
            this.Client1.WorkflowContinueButton.Click();

            var allLanes = new[] { KnownNoteLane.Start, KnownNoteLane.Stop, KnownNoteLane.Continue };

            foreach (KnownNoteLane noteLaneId in allLanes)
            {
                NoteLaneComponent noteLane = this.Client2.GetLane(noteLaneId);

                foreach (VoteListComponent voteListComponent in noteLane.VoteLists)
                {
                    for (int cnt = 0; cnt < 2; cnt++)
                    {
                        voteListComponent.ClickVoteButton();
                    }

                    break;
                }
            }

            // Then
            this.MultiAssert(client => {
                const int expectedVoteCount = 2 * 3 /* Number of lanes */;

                void AssertVoteCount(int pid, int count, Func <VoteStatusForParticipant, IEnumerable> voteListSelector)
                {
                    Assert.That(() => {
                        VoteStatusPanelComponent voteStatusPanel = client.VoteStatus;
                        VoteStatusForParticipant bossVoteStatus  =
                            voteStatusPanel.VoteStatusPerParticipant.First(x => x.ParticipantId == pid);
                        return(voteListSelector(bossVoteStatus));
                    },
                                Has.Count.EqualTo(count).Retry(),
                                $"Either unable to find vote panel, unable to find vote status for participant #{pid}, or the vote count is incorrect (not {count})");
                }

                AssertVoteCount(participantId, expectedVoteCount, v => v.CastVotes);
                AssertVoteCount(bossId, expectedVoteCount, v => v.UncastVotes);
                AssertVoteCount(bossId, 0, v => v.CastVotes);
                AssertVoteCount(participantId, 0, v => v.UncastVotes);

                foreach (KnownNoteLane noteLaneId in allLanes)
                {
                    NoteLaneComponent noteLane = client.GetLane(noteLaneId);

                    foreach (VoteListComponent voteListComponent in noteLane.VoteLists)
                    {
                        Assert.That(() => voteListComponent.Votes, Has.Count.EqualTo(2),
                                    "Expected to find 2 votes in each lane");

                        if (client == this.Client2)
                        {
                            Assert.That(() => voteListComponent.IsVoteButtonEnabled, Is.False, "Vote button should be disabled");
                        }
                        else
                        {
                            Assert.That(() => voteListComponent.IsVoteButtonEnabled, Is.True, "Vote button should be enabled");
                        }

                        break;
                    }
                }
            });
        }
示例#7
0
        public async Task RetrospectiveLobby_GroupingStage_CanMoveNote()
        {
            // Given
            int note1Id = 0, note2Id = 0, noteGroupId = 0, bossId = 0;

            using (IServiceScope scope = this.App.CreateTestServiceScope()) {
                await scope.TestCaseBuilder(this.RetroId).
                WithParticipant("Boss", true, "scrummaster").
                OutputId(id => bossId = id).
                WithParticipant("Josh", false).
                WithParticipant("Foo", false).
                WithParticipant("Bar", false).
                WithParticipant("Baz", false).
                WithRetrospectiveStage(RetrospectiveStage.Writing).
                WithNote(KnownNoteLane.Start, "Josh").
                OutputId(id => note1Id = id).
                WithNote(KnownNoteLane.Continue, "Boss").
                WithNote(KnownNoteLane.Continue, "Bar").
                WithNote(KnownNoteLane.Continue, "Baz").
                WithNote(KnownNoteLane.Stop, "Foo").
                WithNote(KnownNoteLane.Start, "Foo").
                OutputId(id => note2Id = id).
                WithNote(KnownNoteLane.Start, "Boss").
                WithRetrospectiveStage(RetrospectiveStage.Grouping).
                WithNoteGroup("Boss", KnownNoteLane.Continue, "Cont name").
                WithNoteGroup("Boss", KnownNoteLane.Start, "Some name").
                OutputId(id => noteGroupId = id).
                Build();
            }

            await Task.WhenAll(
                Task.Run(() => this.Join(this.Client1, true, "Boss", alreadyJoined: true)),
                Task.Run(() => this.Join(this.Client2, false, "Josh", true))
                );

            this.WaitNavigatedToLobby();

            // When

            /*{
             *  NoteLaneComponent noteLane = this.Client1.GetLane(KnownNoteLane.Start);
             *  NoteComponent note1 = noteLane.Notes.First(x => x.Id == note1Id);
             *  NoteComponent note2 = noteLane.Notes.First(x => x.Id == note2Id);
             *  NoteGroupComponent noteGroup = noteLane.NoteGroups.First(x => x.Id == noteGroupId);
             *
             *  this.Client1.WebDriver.ExecuteDragAndDrop(note1.WebElement, noteGroup.WebElement);
             *  this.Client1.WebDriver.ExecuteDragAndDrop(note2.WebElement, noteGroup.WebElement);
             * }*/// Disable while: https://bugs.chromium.org/p/chromedriver/issues/detail?id=2695

            using (IServiceScope scope = this.App.CreateTestServiceScope()) {
                scope.SetAuthenticationInfo(new CurrentParticipantModel(bossId, "Boss", true));
                await scope.Send(new MoveNoteCommand(note1Id, noteGroupId));

                await scope.Send(new MoveNoteCommand(note2Id, noteGroupId));
            }

            // Then
            this.MultiAssert(client => {
                NoteLaneComponent noteLane   = client.GetLane(KnownNoteLane.Start);
                NoteGroupComponent noteGroup = noteLane.NoteGroups.First(x => x.Id == noteGroupId);

                Assert.That(() => noteGroup.Notes.Select(x => x.Id).ToArray(), Contains.Item(note1Id).And.Contain(note2Id).Retry());
            });
        }