public void ThenTheVideoHearingsOfficerUserShouldSeeAnAlert(string notification, string alertType) { _browsers[_c.CurrentUser].Refresh(); _browsers[_c.CurrentUser].Driver.WaitForAngular(); Scrolling.ScrollToTheHearing(_browsers[_c.CurrentUser], _c.Test.Conference.Id); _browsers[_c.CurrentUser].TextOf(VhoHearingListPage.StatusBadge(_c.Test.Conference.Id)).Should().Be(notification.Equals("Suspended") ? notification : "Not Started"); _browsers[_c.CurrentUser].Click(VhoHearingListPage.SelectHearingButton(_c.Test.Conference.Id)); Scrolling.ScrollToTheTopOfThePage(_browsers[_c.CurrentUser]); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(AdminPanelPage.ParticipantStatusTable, 60).Displayed.Should().BeTrue(); _browsers[_c.CurrentUser].TextOf(AdminPanelPage.TaskDetails(_c.Test.TaskId)).Should().Be(alertType); var timeOfAlert = _c.TimeZone.Adjust(_c.Test.AlertTime).ToString(DateFormats.AlertMessageTimestamp); var timeOfAlertMinusAMinute = _c.TimeZone.Adjust(_c.Test.AlertTime).AddMinutes(-1).ToString(DateFormats.AlertMessageTimestamp); var timeOfAlertPlusAMinute = _c.TimeZone.Adjust(_c.Test.AlertTime).AddMinutes(1).ToString(DateFormats.AlertMessageTimestamp); _browsers[_c.CurrentUser].Driver.WaitUntilElementExists(AdminPanelPage.TaskCheckbox(_c.Test.TaskId)).Selected.Should().BeFalse(); _browsers[_c.CurrentUser].Driver.WaitUntilElementExists(AdminPanelPage.TaskCheckbox(_c.Test.TaskId)).Enabled.Should().BeTrue(); var timestamp = _browsers[_c.CurrentUser].TextOf(AdminPanelPage.TaskCreatedDate(_c.Test.TaskId)); timestamp.Should().BeOneOf(timeOfAlert, timeOfAlertMinusAMinute, timeOfAlertPlusAMinute); if (alertType.ToLower().Contains("failed self-test") || alertType.ToLower().Equals("disconnected")) { _browsers[_c.CurrentUser].TextOf(AdminPanelPage.TaskFromUser(_c.Test.TaskId)).Should().Be(_c.Test.Participant.Name); } }
private void SelectTheUser(string text) { var user = Users.GetUserFromText(text, _c.Test.Users); var participant = _c.Test.Conference.Participants.First(x => x.Username.ToLower().Equals(user.Username.ToLower())); _browsers[_c.CurrentUser].Click(VhoHearingListPage.SelectParticipantToMessage(participant.Id)); }
private void TheToolTipDetailsAreDisplayed(ParticipantDetailsResponse participant, ParticipantResponse hearingParticipant) { var participantEmailAndRole = $"{participant.Name}"; _browsers[_c.CurrentUser].TextOf(VhoHearingListPage.ParticipantContactName(participant.Id)).Should().Be(participantEmailAndRole); _browsers[_c.CurrentUser].TextOf(VhoHearingListPage.ParticipantContactEmail(participant.Id)).Should().Be(hearingParticipant.ContactEmail); _browsers[_c.CurrentUser].TextOf(VhoHearingListPage.ParticipantContactPhone(participant.Id)).Should().Be(hearingParticipant.TelephoneNumber); }
public void ThenTheHearingsAreFiltered() { var hearingThatShouldNotBeVisible = _c.Test.Conferences.First(); var hearingThatShouldBeVisible = _c.Test.Conferences.Last(); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.CaseName(hearingThatShouldBeVisible.Id)).Displayed.Should().BeTrue(); _browsers[_c.CurrentUser].Driver.WaitUntilElementNotVisible(VhoHearingListPage.CaseName(hearingThatShouldNotBeVisible.Id)).Should().BeTrue(); }
private void TheToolTipDetailsAreDisplayed(ParticipantDetailsResponse participant, ParticipantResponse hearingParticipant) { var participantEmailAndRole = $"{participant.Name} ({participant.Case_type_group})"; _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.ParticipantContactName(participant.Id)).Text.Trim().Should().Be(participantEmailAndRole); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.ParticipantContactEmail(participant.Id)).Text.Trim().Should().Be(hearingParticipant.Contact_email); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.ParticipantContactPhone(participant.Id)).Text.Trim().Should().Be(hearingParticipant.Telephone_number); }
public void ThenBothHearingsAreVisible() { var firstHearingThatShouldBeVisible = _c.Test.Conferences.First(); var secondHearingThatShouldBeVisible = _c.Test.Conferences.Last(); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.CaseName(firstHearingThatShouldBeVisible.Id)).Displayed.Should().BeTrue(); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.CaseName(secondHearingThatShouldBeVisible.Id)).Displayed.Should().BeTrue(); }
public void ProgressToNextPage() { Scrolling.ScrollToTheHearing(_browsers[_c.CurrentUser], _c.Test.Conference.Id); _browsers[_c.CurrentUser].Click(VhoHearingListPage.SelectHearingButton(_c.Test.Conference.Id)); Scrolling.ScrollToTheTopOfThePage(_browsers[_c.CurrentUser]); _browsers[_c.CurrentUser].Click(VhoHearingListPage.HearingsTabButton); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(AdminPanelPage.ParticipantStatusTable, 60).Displayed.Should().BeTrue(); }
public void ThenTheVideoHearingsOfficerUserShouldNotSeeAnAlert() { _browsers[_c.CurrentUser].Refresh(); Scrolling.ScrollToTheHearing(_browsers[_c.CurrentUser], _c.Test.Conference.Id); _browsers[_c.CurrentUser].Click(VhoHearingListPage.SelectHearingButton(_c.Test.Conference.Id)); Scrolling.ScrollToTheTopOfThePage(_browsers[_c.CurrentUser]); Tasks.TasksListShouldBeEmpty(_c); }
public void ThenTheParticipantsStatusesAre(string text, string participantStatus) { Scrolling.ScrollToTheHearing(_browsers[_c.CurrentUser], _c.Test.Conference.Id); _browsers[_c.CurrentUser].Click(VhoHearingListPage.SelectHearingButton(_c.Test.Conference.Id)); Scrolling.ScrollToTheTopOfThePage(_browsers[_c.CurrentUser]); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(AdminPanelPage.ParticipantStatusTable, 60).Displayed.Should().BeTrue(); var participants = text.Equals("participants") ? _c.Test.ConferenceParticipants.Where(x => x.UserRole != UserRole.Judge) : ParticipantsManager.GetParticipantsFromRole(_c.Test.ConferenceParticipants, text); CheckParticipantStatus(participantStatus, participants); }
public void WhenTheVideoHearingsOfficerStartsACallWithIndividual(string text) { Scrolling.ScrollToTheHearing(_browsers[_c.CurrentUser], _c.Test.Conference.Id); _browsers[_c.CurrentUser].Click(VhoHearingListPage.SelectHearingButton(_c.Test.Conference.Id)); Scrolling.ScrollToTheTopOfThePage(_browsers[_c.CurrentUser]); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(AdminPanelPage.ParticipantStatusTable, 60).Displayed.Should().BeTrue(); _browsers[_c.CurrentUser].Driver.SwitchTo().Frame(AdminPanelPage.AdminIframeId); Thread.Sleep(TimeSpan.FromSeconds(SecondsDelayBeforeCallingTheParticipant)); _browsers[_c.CurrentUser].Click(AdminPanelPage.ParticipantInIframe(GetParticipantDisplayName(text))); Thread.Sleep(TimeSpan.FromSeconds(SecondsDelayBeforeCallingTheParticipant)); _browsers[_c.CurrentUser].Click(AdminPanelPage.VhoPrivateConsultationLink); _browsers[_c.CurrentUser].LastWindowName = _browsers[_c.CurrentUser].SwitchTab("Private Consultation"); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(AdminPanelPage.CloseButton).Displayed.Should().BeTrue(); }
public void ThenTheVideoHearingsOfficerShouldOnlySeeHearingsForToday() { foreach (var conference in _c.Test.Conferences) { if (_c.TimeZone.Adjust(conference.ScheduledDateTime).Day.Equals(_c.TimeZone.Adjust(DateTime.Now).Day)) { _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.CaseName(conference.Id)).Displayed.Should().BeTrue(); } else { _browsers[_c.CurrentUser].Driver.WaitUntilElementNotVisible(VhoHearingListPage.CaseName(conference.Id)).Should().BeTrue(); } } }
public void ThenTheOptionToCallIsNotVisible(string text) { Scrolling.ScrollToTheHearing(_browsers[_c.CurrentUser], _c.Test.Conference.Id); _browsers[_c.CurrentUser].Click(VhoHearingListPage.SelectHearingButton(_c.Test.Conference.Id)); Scrolling.ScrollToTheTopOfThePage(_browsers[_c.CurrentUser]); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(AdminPanelPage.ParticipantStatusTable, 60).Displayed.Should().BeTrue(); _browsers[_c.CurrentUser].Driver.SwitchTo().Frame(AdminPanelPage.AdminIframeId); var user = Users.GetUserFromText(text, _c.Test.Users); var participant = _c.Test.ConferenceParticipants.Find(x => x.Username.ToLower().Contains(user.Username.ToLower())); Thread.Sleep(TimeSpan.FromSeconds(SecondsDelayBeforeCallingTheParticipant)); _browsers[_c.CurrentUser].Click(AdminPanelPage.ParticipantInIframe(participant.DisplayName)); Thread.Sleep(TimeSpan.FromSeconds(SecondsDelayBeforeCallingTheParticipant)); _browsers[_c.CurrentUser].Driver.WaitUntilElementNotVisible(AdminPanelPage.VhoPrivateConsultationLink).Should().BeTrue(); }
public void ThenTheVhoCanSeeAListOfHearingsIncludingTheNewHearing() { Scrolling.ScrollToTheHearing(_browsers[_c.CurrentUser], _c.Test.Conference.Id); var hearingThatShouldBeVisible = _c.Test.Conferences.First(); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.CaseName(hearingThatShouldBeVisible.Id)).Displayed.Should().BeTrue(); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.CaseNumber(hearingThatShouldBeVisible.Id)).Displayed.Should().BeTrue(); var timespan = TimeSpan.FromMinutes(hearingThatShouldBeVisible.ScheduledDuration); var listedFor = DateTimeToString.GetListedForTimeAsString(timespan); _browsers[_c.CurrentUser].TextOf(VhoHearingListPage.HearingTime(hearingThatShouldBeVisible.Id)) .Should().Be($"{_c.TimeZone.Adjust(hearingThatShouldBeVisible.ScheduledDateTime):HH:mm}"); _browsers[_c.CurrentUser].TextOf(VhoHearingListPage.ListedFor(hearingThatShouldBeVisible.Id)) .Should().Be($"{listedFor}"); Scrolling.ScrollToTheTopOfThePage(_browsers[_c.CurrentUser]); }
public void ThenTheVideoHearingsOfficerUserShouldSeeANotification(string notification) { _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.StatusBadge(_c.Test.Conference.Id)).Text.Trim().Should().Be(notification); }
private void SelectTheHearing() { _browsers[_c.CurrentUser].Click(VhoHearingListPage.SelectHearingButton(_c.Test.Conference.Id)); }
public void WhenTheUserClicksOnConsultationRoomLink() { var closeTime = _c.TimeZone.Adjust(_c.Test.HearingClosedTime.AddMinutes(30)).ToString(DateFormats.WaitingRoomPageTime); _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.ConsultationRoomLink(closeTime)).Click(); }
public void ThenTheVhoShouldSeeTheParticipantContactDetails() { Scrolling.ScrollToTheTopOfThePage(_browsers[_c.CurrentUser]); var hearingParticipants = _c.Test.HearingParticipants.FindAll(x => x.UserRoleName.Equals("Individual") || x.UserRoleName.Equals("Representative")); var hearingParticipant = hearingParticipants.First(); var conferenceParticipant = _c.Test.ConferenceParticipants.Find(x => x.Name.Contains(hearingParticipant.LastName)); var firstParticipantLink = _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.ParticipantContactLink(conferenceParticipant.Id)); firstParticipantLink.Displayed.Should().BeTrue(); var action = new Actions(_browsers[_c.CurrentUser].Driver.WrappedDriver); action.MoveToElement(firstParticipantLink).Perform(); if (_c.VideoWebConfig.TestConfig.TargetBrowser == TargetBrowser.Safari) { return; // Latest version of Safari Driver will not hover over the correct element } TheToolTipDetailsAreDisplayed(conferenceParticipant, hearingParticipant); }
public static void ScrollToTheHearing(UserBrowser browser, Guid conferenceId) { browser.Driver.WaitUntilElementExists(VhoHearingListPage.CaseName(conferenceId)); browser.ScrollTo(VhoHearingListPage.CaseName(conferenceId)); }