Skip to content

Added table step for validating field visibility #100

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public static void ThenICanNotEditTheFollowingFields(Table table)
}

/// <summary>
/// Asserts that a field is not visible.
/// Asserts that a field is visible.
/// </summary>
/// <param name="fieldName">The name of the field.</param>
[Then(@"I can see the '(.*)' field")]
Expand All @@ -472,6 +472,28 @@ public static void ThenICanSeeTheField(string fieldName)
XrmApp.Entity.IsFieldVisible(Driver, fieldName).Should().BeTrue(because: "the field should be visible");
}

/// <summary>
/// Assert that fields are visible or not visible.
/// </summary>
/// <param name="canSee">Whether or not the field is visible.</param>
/// <param name="fields">The fields.</param>
[Then(@"I (can|can not) see the following fields")]
public static void ThenICanSeeTheFields(string canSee, Table fields)
{
var fieldList = fields.Rows.Select(x => x[0]);
for (int i = 0; i < fieldList.Count(); i++)
{
if (canSee == "can")
{
ThenICanSeeTheField(fieldList.ElementAt(i));
}
else
{
ThenICanNotSeeTheField(fieldList.ElementAt(i));
}
}
}

/// <summary>
/// Asserts that a field is not visible.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,22 @@ Scenario: Assert option set options
Scenario: Assert field visible
Then I can see the 'sb_name' field

Scenario: Assert fields visible
Then I can see the following fields
| fieldList |
| sb_name |
| sb_yesno |
| sb_choice |
| sb_dateandtime |

Scenario: Assert field not visible
Then I can not see the 'ownerid' field

Scenario: Assert fields not visible
Then I can not see the following fields
| fieldList |
| ownerid |

Scenario: Assert record status
Then the status of the record is active

Expand Down