Skip to content

Commit

Permalink
fix: asserting sub-grid count when there are 0 actual rows (#139)
Browse files Browse the repository at this point in the history
* Bug: Fixed issue in EntitySubGridSteps.cs by bypassing GetSubGridItemsCount as it fails for zero items (line 116)

* Bug: Fixed, Added missing test that was only present in the corresponding Gherkin test file to the LookupSteps.cs file (line 127 onwards)

* Updated Selenium to latest version

* Reverted the code in LookupSteps.cs as it was before

* Added an EasyRepro link related to code that was not working.

Commented out some code from EasyRepro and included the relevant link on GitHub relating to the issue.

Co-authored-by: Tom Ashworth <tom.ashworth@capgemini.com>
  • Loading branch information
AhmedD43 and tdashworth authored Sep 16, 2022
1 parent 4ce4d28 commit c88f2a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ public static void ThenICanNotSeeInTheSubgrid(string alias, string subGridName)
[Then(@"I can see (exactly|more than|less than) (\d+) records in the '(.*)' subgrid")]
public static void ThenICanSeeRecordsInTheSubgrid(string compare, int count, string subGridName)
{
var actualCount = XrmApp.Entity.SubGrid.GetSubGridItemsCount(subGridName);
//var actualCount = XrmApp.Entity.SubGrid.GetSubGridItemsCount(subGridName);
// Temporary until XrmApp.Entity.SubGrid.GetSubGridItemsCount(subGridName) works for a count of 0
// https://github.com/microsoft/EasyRepro/issues/1318
var actualCount = (long)Driver.ExecuteScript(
$"return Xrm.Page.getControl(\"{subGridName}\").getGrid().getTotalRecordCount();");


switch (compare)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<PackageReference Include="Microsoft.CrmSdk.XrmTooling.CoreAssembly" Version="9.1.0.64" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="103.0.5060.5300" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="105.0.5195.5200" />
<PackageReference Include="SpecFlow" Version="3.5.14" />
<PackageReference Include="SpecFlow.MsTest" Version="3.5.14" />
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.5.14" />
Expand Down

0 comments on commit c88f2a2

Please sign in to comment.