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); } }
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 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 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 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]); }