Exemplo n.º 1
0
 protected Task SetRetrospective(Action <Retrospective> action)
 {
     using IServiceScope scope = this.App.CreateTestServiceScope();
     return(scope.SetRetrospective(this.RetroId, action));
 }
Exemplo n.º 2
0
 private Task SetRetrospective(string retroId, Action <Retrospective> action)
 {
     using IServiceScope scope = this.App.CreateTestServiceScope();
     return(scope.SetRetrospective(retroId, action));
 }
Exemplo n.º 3
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();
        }