Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7373

Interact Closures withing Groovy Trait methods are not recognized by the implementing class

    XMLWordPrintableJSON

Details

    Description

      Since moving to grails 2.5.0 (groovy 2.4.x) our functional tests (geb/spock) are failing when we try to run interact closures inside of a trait. I'm not entirely sure who owns this one as there are three or four players groovy, grails, geb/spock, but groovy seemed like the most logical culprit.

      Example Usage
      trait DoStuff {
         def clickItemOnPage() {
            interact {
               moveToElement($('.myDiv'))
               click()
            }
         }
      }
      class MySpec extends GebReportingSpec  implements DoStuff {
         def clickItemOnPage2() {
            interact {
               moveToElement($('.myDiv'))
               click()
            }
         }
         def 'Test some stuff' { 
            clickItemOnPage2() //Passes
            clickItemOnPage() //Fails
         }
      }
      

      Error: groovy.lang.MissingMethodException: No signature of method: geb.navigator.NonEmptyNavigator.moveToElement()
      It really doesn't matter what you have in the interact closure anything fails...

      Attachments

        Activity

          People

            emilles Eric Milles
            ldavis Lee Davis
            Votes:
            9 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: