-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathLabelStepDefinitions.cs
More file actions
35 lines (32 loc) · 1.15 KB
/
Copy pathLabelStepDefinitions.cs
File metadata and controls
35 lines (32 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using Behavioral.Automation.AsyncAbstractions.UI.Interfaces;
using TechTalk.SpecFlow;
namespace Behavioral.Automation.AsyncAbstractions.UI.StepDefinitions;
[Binding]
public class LabelStepDefinitions
{
/// <summary>
/// Check that element's text is equal to the expected one
/// </summary>
/// <param name="label">Tested label object</param>
/// <param name="type">Assertion behavior</param>
/// <param name="value">Expected value</param>
/// <example>Then "Test" element text should be "expected text"</example>
[Given("the \"(.*?)\" label text (is|is not) \"(.*)\"")]
[Then("the \"(.*?)\" label text should (become|become not) \"(.*)\"")]
public async Task CheckSelectedText(ILabelElement label, string type, string value)
{
if (type.Equals("is") || type.Equals("become"))
{
await label.ShouldHaveTextAsync(value);
}
else
{
await label.ShouldNotHaveTextAsync(value);
}
}
[Then(@"the ""(.*)"" label should become visible")]
public async Task CheckLabelVisibility(ILabelElement label)
{
await label.ShouldBecomeVisibleAsync();
}
}