Skip to content

Commit

Permalink
changed back to should become visible async
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg-Mozhey committed Feb 21, 2024
1 parent cb2bf8d commit 0a2fc49
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ public class WebElement : IWebElement
public ElementSelector ElementSelector { get; }
public string? Description { get; set; }

public async Task IsVisibleAsync()
public async Task ShouldBecomeVisibleAsync()
{
// defaultDelay = 300 is just an example of idea that we will have default delay for all elements
// and ability to specify delay in test steps if we have some taking time loading
// (for example, because of data processing)
var defaultDelay = 300;
await IsVisibleAsync(defaultDelay);
await ShouldBecomeVisibleAsync(defaultDelay);
}

public async Task IsVisibleAsync(int delay)
public async Task ShouldBecomeVisibleAsync(int delay)
{
throw new NotImplementedException();
}
Expand Down
4 changes: 2 additions & 2 deletions Behavioral.Automation.Bindings.UI/Abstractions/IWebElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ public interface IWebElement
public WebContext WebContext { get; }
public ElementSelector ElementSelector { get; }
public string? Description { get; set; }
public Task IsVisibleAsync();
public Task IsVisibleAsync(int delay);
public Task ShouldBecomeVisibleAsync();
public Task ShouldBecomeVisibleAsync(int delay);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public async Task ClickOnButton(IButtonElement button)
[Then(@"""(.+?)"" button should become visible")]
public async Task ButtonShouldBecomeVisible(IButtonElement button)
{
await button.IsVisibleAsync();
await button.ShouldBecomeVisibleAsync();
}

[When(@"user uploads ""(.*)"" file after clicking on ""(.*)"" button")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public async Task CheckLabelText(ILabelElement label, string text)
[Then(@"""(.+?)"" label should become visible")]
public async Task CheckLabelVisibility(ILabelElement label)
{
await label.IsVisibleAsync();
await label.ShouldBecomeVisibleAsync();
}
}
4 changes: 2 additions & 2 deletions Behavioral.Automation.Bindings.UI/Bindings/TableBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ public class TableBinding
[Then(@"""(.*)"" table should become visible$")]
public async Task ThenTableShouldBecomeVisible(ITableWrapper table)
{
await table.IsVisibleAsync();
await table.ShouldBecomeVisibleAsync();
}

[Then(@"""(.*)"" table should become visible within ""(.*)"" seconds")]
public async Task ThenTableShouldBecomeVisible(ITableWrapper table, int seconds)
{
await table.IsVisibleAsync(seconds);
await table.ShouldBecomeVisibleAsync(seconds);
}
}

0 comments on commit 0a2fc49

Please sign in to comment.