-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1494 from riganti/fix-ci-warnings
Fix warnings in the test project
- Loading branch information
Showing
9 changed files
with
74 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using OpenQA.Selenium; | ||
using Riganti.Selenium.Core; | ||
|
||
namespace DotVVM.Samples.Tests; | ||
public static class UITestUtils | ||
{ | ||
|
||
public static T StaleElementRetry<T>(Func<T> action, int attempts = 5) | ||
{ | ||
if (attempts <= 0) | ||
return action(); | ||
|
||
try | ||
{ | ||
return action(); | ||
} | ||
catch (StaleElementReferenceException) | ||
{ | ||
return StaleElementRetry<T>(action, attempts - 1); | ||
} | ||
} | ||
public static void StaleElementRetry(Action action, int attempts = 5) => | ||
StaleElementRetry(() => { action(); return 0; }, attempts); | ||
|
||
|
||
public static void WaitForIgnoringStaleElements(Action action, WaitForOptions options = null) | ||
{ | ||
WaitForExecutor.WaitFor(() => StaleElementRetry(action), options); | ||
} | ||
} |