Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix_add_participant_to_hearing #267

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion UI.AutomationTests/CommonUiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected IVhDriver CreateDriver(string username, string videoFileName = null)
}
else
{
driver = new RemoteChromeVhDriver(username: username);
driver = new RemoteChromeVhDriver(username: username, videoFileName:videoFileName);
}

driver.GetDriver().StoreUsername(username);
Expand Down
12 changes: 11 additions & 1 deletion UI.AutomationTests/Drivers/RemoteChromeVhDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class RemoteChromeVhDriver : IVhDriver
private RemoteWebDriver _driver;

public RemoteChromeVhDriver(string platform = "Windows 11", string browserVersion = "latest",
string username = null)
string username = null, string videoFileName = null)
{
var envConfigSettings = ConfigRootBuilder.EnvConfigInstance();
var chromeOptions = new ChromeOptions
Expand All @@ -23,6 +23,16 @@ public RemoteChromeVhDriver(string platform = "Windows 11", string browserVersio
chromeOptions.AddArguments("--use-fake-ui-for-media-stream");
chromeOptions.AddArguments("--use-fake-device-for-media-stream");

if (videoFileName != null)
{
var videoFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "MockVideos", videoFileName);
if (!File.Exists(videoFilePath))
{
throw new FileNotFoundException($"Video file not found: {videoFilePath}");
}
chromeOptions.AddArgument($"--use-file-for-fake-video-capture={videoFilePath}");
}

// this is the name for a build in SauceLabs
var buildName = Environment.GetEnvironmentVariable("TF_BUILD") == null
? BuildName.GetBuildNameForLocal().Trim()
Expand Down
8 changes: 4 additions & 4 deletions UI.AutomationTests/Video/QuickLinkUserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ await TestContext.Out.WriteLineAsync(
var quickLinkName1 = $"QL Auto Join 1 {Guid.NewGuid():N}";
var quickLinkName2 = $"QL Auto Join 2 {Guid.NewGuid():N}";

var qlWaitingRoomPage1 = LoginInAsQlAndNavigateToWaitingRoom(quickLinkName1, conference.Id.ToString());
var qlWaitingRoomPage2 = LoginInAsQlAndNavigateToWaitingRoom(quickLinkName2, conference.Id.ToString());
var qlWaitingRoomPage1 = LoginInAsQlAndNavigateToWaitingRoom(quickLinkName1, conference.Id.ToString(), HearingTestData.Individual01FileName);
var qlWaitingRoomPage2 = LoginInAsQlAndNavigateToWaitingRoom(quickLinkName2, conference.Id.ToString(), HearingTestData.Individual02FileName);

var particiantsFromConference = await VideoApiClient.GetParticipantsByConferenceIdAsync(conference.Id);
var quicklink1 = particiantsFromConference.First(x => x.DisplayName == quickLinkName1);
Expand Down Expand Up @@ -109,9 +109,9 @@ private async Task GetQuicklinkJoinUri(HearingDetailsResponseV2 hearing)
await TestContext.Out.WriteLineAsync(_quickLinkJoinUrl);
}

private ParticipantWaitingRoomPage LoginInAsQlAndNavigateToWaitingRoom(string qlName, string conferenceId)
private ParticipantWaitingRoomPage LoginInAsQlAndNavigateToWaitingRoom(string qlName, string conferenceId, string videoFileName = null)
{
var quickLinkJoinHearingPage = LoginAsQuickLinkUser(_quickLinkJoinUrl, qlName);
var quickLinkJoinHearingPage = LoginAsQuickLinkUser(_quickLinkJoinUrl, qlName, videoFileName);
quickLinkJoinHearingPage.EnterQuickLinkUserDetails(qlName, true);
var quickLinkHearingListPage = quickLinkJoinHearingPage.Continue();
var page = quickLinkHearingListPage.SelectHearing(conferenceId).GoToEquipmentCheck()
Expand Down
4 changes: 2 additions & 2 deletions UI.AutomationTests/Video/VideoWebUiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ protected ParticipantHearingListPage LoginAsParticipant(string username, string
: loginPage.LogInAsParticipant(username, password);
}

protected QuickLinkJoinYourHearingPage LoginAsQuickLinkUser(string quickLinkJoinUrl, string displayName)
protected QuickLinkJoinYourHearingPage LoginAsQuickLinkUser(string quickLinkJoinUrl, string displayName, string videoFileName = null)
{
var participant = InitVideoWebParticipant(displayName, JourneyType.QuickLinkParticipant, null);
var participant = InitVideoWebParticipant(displayName, JourneyType.QuickLinkParticipant, videoFileName);
var driver = participant.Driver.GetDriver();
driver.Navigate().GoToUrl(quickLinkJoinUrl);
return new QuickLinkJoinYourHearingPage(driver, EnvConfigSettings.DefaultElementWait);
Expand Down
2 changes: 1 addition & 1 deletion UI.PageModels/Pages/Admin/Booking/BookingDetailsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public BookingConfirmationPage AddParticipantsToBooking(List<BookingParticipantD
var videoAccessPointsPage = participantsPage.GoToVideoAccessPointsPage();
// use existing booking flow (i.e. next on vap goes screening (if enabled) and then to summary page)
var summaryPage = FeatureToggle.Instance().SpecialMeasuresEnabled() ?
videoAccessPointsPage.GoToSpecialMeasuresPage().GoToSummaryPage()
videoAccessPointsPage.GoToSpecialMeasuresPage().GoToOtherInformationPage().GoToSummaryPage()
: videoAccessPointsPage.GoToSummaryPage();
return summaryPage.ClickBookButton();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public bool IsParticipantConnected(string displayName)
return true;
} catch (Exception)
{
Driver.TakeScreenshotAndSave(GetType().Name, "Participant not connected to consultation room when expected");
return false;
}
}
Expand Down
Loading