Skip to content

Commit c88f2a2

Browse files
AhmedD43tdashworth
andauthored
fix: asserting sub-grid count when there are 0 actual rows (#139)
* 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>
1 parent 4ce4d28 commit c88f2a2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/EntitySubGridSteps.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ public static void ThenICanNotSeeInTheSubgrid(string alias, string subGridName)
111111
[Then(@"I can see (exactly|more than|less than) (\d+) records in the '(.*)' subgrid")]
112112
public static void ThenICanSeeRecordsInTheSubgrid(string compare, int count, string subGridName)
113113
{
114-
var actualCount = XrmApp.Entity.SubGrid.GetSubGridItemsCount(subGridName);
114+
//var actualCount = XrmApp.Entity.SubGrid.GetSubGridItemsCount(subGridName);
115+
// Temporary until XrmApp.Entity.SubGrid.GetSubGridItemsCount(subGridName) works for a count of 0
116+
// https://github.com/microsoft/EasyRepro/issues/1318
117+
var actualCount = (long)Driver.ExecuteScript(
118+
$"return Xrm.Page.getControl(\"{subGridName}\").getGrid().getTotalRecordCount();");
119+
115120

116121
switch (compare)
117122
{

bindings/tests/Capgemini.PowerApps.SpecFlowBindings.UiTests/Capgemini.PowerApps.SpecFlowBindings.UiTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<PackageReference Include="Microsoft.CrmSdk.XrmTooling.CoreAssembly" Version="9.1.0.64" />
3939
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
4040
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
41-
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="103.0.5060.5300" />
41+
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="105.0.5195.5200" />
4242
<PackageReference Include="SpecFlow" Version="3.5.14" />
4343
<PackageReference Include="SpecFlow.MsTest" Version="3.5.14" />
4444
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.5.14" />

0 commit comments

Comments
 (0)