Skip to content

Commit

Permalink
Merge pull request #228 from hmcts/testfix/Update_Nswag
Browse files Browse the repository at this point in the history
Updated NSwag config for video api and upgraded NuGet
  • Loading branch information
npoxon committed Feb 18, 2020
2 parents 1f298cc + af0685b commit b205ef3
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
<PackageReference Include="Selenium.Firefox.WebDriver" Version="0.26.0" />
<PackageReference Include="Selenium.Support" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="80.0.3987.1600" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="80.0.3987.10600" />
<PackageReference Include="Selenium.WebDriver.IEDriver" Version="3.150.1" />
<PackageReference Include="Selenium.WebDriver.MicrosoftDriver" Version="17.17134.0" />
<PackageReference Include="SpecFlow" Version="3.1.82" />
<PackageReference Include="SpecFlow.NUnit" Version="3.1.82" />
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.1.82" />
<PackageReference Include="VH.AcceptanceTests.Common" Version="1.0.66" />
<PackageReference Include="VH.AcceptanceTests.Common" Version="1.0.67" />
</ItemGroup>

<ItemGroup>
Expand Down
26 changes: 2 additions & 24 deletions AdminWebsite/AdminWebsite.AcceptanceTests/Data/DateFormats.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
using AcceptanceTests.Common.Driver.Support;
using System.Globalization;

namespace AdminWebsite.AcceptanceTests.Data
{
public static class DateFormats
{
private static string _chromeHearingDateFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
private const string FirefoxHearingDateFormat = "yyyy-MM-dd";
public static string LocalDateFormat = CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern;
public static string HearingSummaryDate = "dddd dd MMMM yyyy, h:mmtt";

public static string FormatDateToLocalDateFormat(TargetBrowser browser)
{
if (browser != TargetBrowser.Chrome)
return browser == TargetBrowser.Firefox ? FirefoxHearingDateFormat : _chromeHearingDateFormat;
AddZerosToShortDateFormat();
return _chromeHearingDateFormat;
}

private static void AddZerosToShortDateFormat()
{
var splitDate = _chromeHearingDateFormat.Split("/");
foreach (var portion in splitDate)
{
if (portion.Equals("d"))
_chromeHearingDateFormat = _chromeHearingDateFormat.Replace("d", "dd");

if (portion.Equals("M"))
_chromeHearingDateFormat = _chromeHearingDateFormat.Replace("M", "MM");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void ProgressToNextPage()

public void AddHearingDate()
{
var date = _c.Test.HearingSchedule.ScheduledDate.Date.ToString(DateFormats.FormatDateToLocalDateFormat(_c.AdminWebConfig.TestConfig.TargetBrowser));
var date = _c.Test.HearingSchedule.ScheduledDate.Date.ToString(DateFormats.LocalDateFormat);
_browsers[_c.CurrentUser.Key].Clear(HearingSchedulePage.HearingDateTextfield);
_browsers[_c.CurrentUser.Key].Driver.WaitUntilVisible(HearingSchedulePage.HearingDateTextfield).SendKeys(date);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"defaultVariables": null,
"documentGenerator": {
"fromDocument": {
"url": "https://vh-video-api-dev.hearings.reform.hmcts.net/swagger/v1/swagger.json",
"url": "https://vh-video-api-dev.azurewebsites.net/swagger/v1/swagger.json",
"output": null
}
},
Expand Down
17 changes: 9 additions & 8 deletions AdminWebsite/AdminWebsite/ClientApp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b205ef3

Please sign in to comment.