Actually I've finished this - as I sorely need it in work for inventory
that's being fought for by multiple concurrent Jenkins jobs, with dozens of
browser flickering, courtesy of SauceLabs.

Build/install latest 'core', navigate to the etsy-pico example (change poms
to use snapshot), apply this diff by hand, and run the story to see a single
restart.

--- a/etsy-stories-groovy-pico/src/main/groovy/pages/SearchResults.groovy
+++ b/etsy-stories-groovy-pico/src/main/groovy/pages/SearchResults.groovy
@@ -5,12 +5,18 @@ import org.openqa.selenium.By

 class SearchResults extends BasePage{

+  private int ctr = 0
+
   def SearchResults(WebDriverProvider webDriverProvider) {
     super(webDriverProvider)
   }


   def buyFirst(String thing) {
+    if(ctr == 0) {
+        ctr++
+        throw new org.jbehave.core.RestartScenario("foo")
+    }
     List elems = getElems()
     for (int i = 0; i < elems.size(); i++) {

Reply via email to