public void ThenTheFirstParticipantStatusIsDisplayedAsNotSignedIn(string name, string status) { var user = Users.GetUserFromText(name, _c.Test.Users); var participant = _c.Test.ConferenceParticipants.First(x => x.Username.ToLower().Equals(user.Username.ToLower())); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.ParticipantStatus(participant.Id)).Text.ToUpper().Trim().Should().Be(status.ToUpper()); }
public void ThenTheJudgeCanSeeAListOfParticipantsAndTheirRepresentatives() { var panelMembers = _c.Test.ConferenceParticipants.FindAll(x => x.Last_name.ToLower().Contains("panelmember")); var individuals = _c.Test.ConferenceParticipants.FindAll(x => x.Last_name.ToLower().Contains("individual")); var representatives = _c.Test.ConferenceParticipants.FindAll(x => x.Last_name.ToLower().Contains("representative")); var observers = _c.Test.ConferenceParticipants.FindAll(x => x.Last_name.ToLower().Contains("observer")); (panelMembers.Count + individuals.Count + representatives.Count + observers.Count).Should().BeGreaterThan(0); foreach (var panelMember in panelMembers) { _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.PanelMemberName(panelMember.Id)).Text.Trim().Should().Be(panelMember.Name); } foreach (var individual in individuals) { _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.ParticipantName(individual.Id)).Text.Trim().Should().Be(individual.Name); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.ParticipantHearingRole(individual.Id)).Text.Trim().Should().Be(individual.Hearing_role); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.ParticipantCaseType(individual.Id)).Text.Trim().Should().Be(individual.Case_type_group); } foreach (var representative in representatives) { _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.ParticipantName(representative.Id)).Text.Trim().Should().Be(representative.Name); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.ParticipantCaseType(representative.Id)).Text.Trim().Should().Be(representative.Case_type_group); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.RepresentativeRepresentee(representative.Id)).Text.Trim().Should().Be($"Representative for {representative.Representee}"); } foreach (var observer in observers) { _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.ObserverName(observer.Id)).Text.Trim().Should().Be(observer.Name); } }
public void ThenTheParticipantStatusOfUserIsDisplayed(string name, string status) { var user = Users.GetUserFromText(name, _c.Test.Users); var participant = _c.Test.ConferenceParticipants.Single(x => x.Username.ToLower().Equals(user.Username.ToLower())); _browsers[_c.CurrentUser].TextOf(JudgeParticipantPanel.ParticipantStatus(participant.Id)).ToUpper().Should().Be(status.ToUpper()); }
public void ThenTheUserCanSeeOtherParticipantsStatus() { var participants = _c.Test.ConferenceParticipants.Where(participant => participant.UserRole == UserRole.Individual || participant.UserRole == UserRole.Representative); foreach (var participant in participants) { _browsers[_c.CurrentUser].TextOf(JudgeParticipantPanel.ParticipantStatus(participant.Id)).ToUpperInvariant().Should() .BeEquivalentTo("Not signed in".ToUpperInvariant()); } }
private void CheckParticipantsAreStillConnected() { var loggedInParticipants = LoggedInParticipants(_browsers.Keys, _c.Test.ConferenceParticipants); foreach (var user in loggedInParticipants) { if ((user.User_role == UserRole.Judge)) { continue; } _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.ParticipantStatus(user.Id)); _browsers[_c.CurrentUser].ScrollTo(JudgeParticipantPanel.ParticipantStatus(user.Id)); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.ParticipantStatus(user.Id)).Text.ToUpper().Trim() .Should().Be("CONNECTED"); } }
private void CheckParticipantsAreStillConnected() { var loggedInParticipants = LoggedInParticipants(_browsers.Keys, _c.Test.ConferenceParticipants); var participantDetailsResponses = loggedInParticipants as ParticipantDetailsResponse[] ?? loggedInParticipants.ToArray(); foreach (var user in participantDetailsResponses) { if ((user.UserRole == UserRole.Judge)) { continue; } _browsers[_c.CurrentUser].Driver.WaitUntilVisible(JudgeParticipantPanel.ParticipantStatus(user.Id)); _browsers[_c.CurrentUser].ScrollTo(JudgeParticipantPanel.ParticipantStatus(user.Id)); _browsers[_c.CurrentUser].TextOf(JudgeParticipantPanel.ParticipantStatus(user.Id)).ToUpper() .Should().BeOneOf("CONNECTED", "IN CONSULTATION"); if (user.HearingRole.ToLower() != "interpreter") { continue; } var interpretee = participantDetailsResponses.Single(p => p.Id == user.LinkedParticipants.Single().LinkedId); ShouldInterpretOrRepresentFor("Participant", user, interpretee.Name); } }
private static By GetObserverName(string user, Guid id) { return(user == "Participant" ? ParticipantListPanel.ObserverName(id) : JudgeParticipantPanel.ObserverName(id)); }
private static By GetParticipantCaseType(string user, Guid id) { return(user == "Participant" ? ParticipantListPanel.ParticipantCaseTypeGroup(id) : JudgeParticipantPanel.ParticipantCaseType(id)); }
private static By GetParticipantHearingRole(string user, Guid id) { return(user == "Participant" ? ParticipantListPanel.ParticipantHearingRole(id) : JudgeParticipantPanel.ParticipantHearingRole(id)); }
private static By GetParticipantWithInterpreter(string user, Guid interpreteeId) { return(user == "Participant" ? ParticipantListPanel.ParticipantWithInterpreter(interpreteeId) : JudgeParticipantPanel.ParticipantWithInterpreter(interpreteeId)); }