Skip to content

Commit e439590

Browse files
committed
Add exceptions for retries
1 parent 8df27e8 commit e439590

26 files changed

Lines changed: 58 additions & 59 deletions

Tests/CSF.Screenplay.Selenium.Tests/Actions/ClearCookiesTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
using CSF.Screenplay.Selenium.Elements;
32
using static CSF.Screenplay.PerformanceStarter;
43
using static CSF.Screenplay.Selenium.PerformableBuilder;
@@ -14,7 +13,7 @@ static readonly ITarget
1413

1514
static readonly NamedUri testPage = new NamedUri("ClearCookiesTests.html", "the test page");
1615

17-
[Test, Screenplay, Retry(3)]
16+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
1817
public async Task ClearCookiesShouldClearCookies(IStage stage)
1918
{
2019
var webster = stage.Spotlight<Webster>();

Tests/CSF.Screenplay.Selenium.Tests/Actions/ClearLocalStorageTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static readonly ITarget
2020

2121
static readonly NamedUri testPage = new NamedUri("ClearLocalStorageTests.html", "the test page");
2222

23-
[Test, Screenplay, Retry(3)]
23+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
2424
public async Task ClearLocalStorageShouldClearItems(IStage stage)
2525
{
2626
var webster = stage.Spotlight<Webster>();

Tests/CSF.Screenplay.Selenium.Tests/Actions/ClearTheContentsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static readonly ITarget
1414

1515
static readonly NamedUri testPage = new NamedUri("ClearTheContentsTests.html", "the test page");
1616

17-
[Test, Screenplay, Retry(3)]
17+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
1818
public async Task ClearATextareaShouldEmptyIt(IStage stage)
1919
{
2020
var webster = stage.Spotlight<Webster>();
@@ -26,7 +26,7 @@ public async Task ClearATextareaShouldEmptyIt(IStage stage)
2626
Assert.That(contents, Is.Empty);
2727
}
2828

29-
[Test, Screenplay, Retry(3)]
29+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
3030
public async Task ClearATextInputShouldEmptyIt(IStage stage)
3131
{
3232
var webster = stage.Spotlight<Webster>();

Tests/CSF.Screenplay.Selenium.Tests/Actions/ClickTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static readonly ITarget
1616

1717
static readonly NamedUri testPage = new NamedUri("ClickTests.html", "the test page");
1818

19-
[Test, Screenplay, Retry(3)]
19+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
2020
public async Task ClickingAButtonShouldTriggerAnEvent(IStage stage)
2121
{
2222
var webster = stage.Spotlight<Webster>();
@@ -28,7 +28,7 @@ public async Task ClickingAButtonShouldTriggerAnEvent(IStage stage)
2828
Assert.That(contents, Is.EqualTo("Clicked!"));
2929
}
3030

31-
[Test, Screenplay, Retry(3)]
31+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
3232
public async Task ClickingAnElementWhichDoesNotExistShouldThrow(IStage stage)
3333
{
3434
var webster = stage.Spotlight<Webster>();
@@ -38,7 +38,7 @@ public async Task ClickingAnElementWhichDoesNotExistShouldThrow(IStage stage)
3838
Throws.InstanceOf<PerformableException>().And.InnerException.InstanceOf<TargetNotFoundException>());
3939
}
4040

41-
[Test, Screenplay, Retry(3)]
41+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
4242
public async Task ClickingAnElementWhichDoesNotExistShouldIncludeTheCorrectTargetInTheException(IStage stage)
4343
{
4444
var webster = stage.Spotlight<Webster>();

Tests/CSF.Screenplay.Selenium.Tests/Actions/DeleteTheCookieTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static readonly ITarget
1414

1515
static readonly NamedUri testPage = new NamedUri("DeleteTheCookieTests.html", "the test page");
1616

17-
[Test, Screenplay, Retry(3)]
17+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
1818
public async Task DeleteTheCookieNamedShouldLeaveOneCookie(IStage stage)
1919
{
2020
var webster = stage.Spotlight<Webster>();

Tests/CSF.Screenplay.Selenium.Tests/Actions/DeselectAllTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static readonly ITarget
1414

1515
static readonly NamedUri testPage = new NamedUri("DeselectionTests.html", "the test page");
1616

17-
[Test, Screenplay, Retry(3)]
17+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
1818
public async Task DeselectEverythingFromShouldClearTheSelection(IStage stage)
1919
{
2020
var webster = stage.Spotlight<Webster>();

Tests/CSF.Screenplay.Selenium.Tests/Actions/DeselectByIndexTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static readonly ITarget
1414

1515
static readonly NamedUri testPage = new NamedUri("DeselectionTests.html", "the test page");
1616

17-
[Test, Screenplay, Retry(3)]
17+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
1818
public async Task DeselectTheOptionFromShouldLeaveOneSelectedItem(IStage stage)
1919
{
2020
var webster = stage.Spotlight<Webster>();

Tests/CSF.Screenplay.Selenium.Tests/Actions/DeselectByTextTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static readonly ITarget
1414

1515
static readonly NamedUri testPage = new NamedUri("DeselectionTests.html", "the test page");
1616

17-
[Test, Screenplay, Retry(3)]
17+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
1818
public async Task DeselectTheOptionFromShouldLeaveOneSelectedItem(IStage stage)
1919
{
2020
var webster = stage.Spotlight<Webster>();

Tests/CSF.Screenplay.Selenium.Tests/Actions/DeselectByValueTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static readonly ITarget
1414

1515
static readonly NamedUri testPage = new NamedUri("DeselectionTests.html", "the test page");
1616

17-
[Test, Screenplay, Retry(3)]
17+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
1818
public async Task DeselectTheOptionWithValueFromShouldLeaveOneSelectedItem(IStage stage)
1919
{
2020
var webster = stage.Spotlight<Webster>();

Tests/CSF.Screenplay.Selenium.Tests/Actions/ExecuteJavaScriptTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class ExecuteJavaScriptTests
1616

1717
static readonly ITarget textContent = new ElementId("textContent");
1818

19-
[Test, Screenplay, Retry(3)]
19+
[Test, Screenplay, Retry(3, RetryExceptions = [typeof(System.InvalidOperationException)])]
2020
public async Task ExecuteJavaScriptShouldBeAbleToExecuteAScriptWithParameters(IStage stage)
2121
{
2222
var webster = stage.Spotlight<Webster>();

0 commit comments

Comments
 (0)