Last active
October 5, 2015 18:11
-
-
Save unbibium/147278c917b50cd576c3 to your computer and use it in GitHub Desktop.
Demonstration of module failure in Geb 0.12.2
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
import geb.spock.GebReportingSpec | |
import groovy.util.logging.Log4j2 | |
import geb.Module | |
import geb.Page | |
/** | |
* The old 0.10.0 module syntax doesn't work in 0.12.2, failing apparently | |
* because the Geb code still contains a getPage() call. | |
* | |
* @author Nick | |
*/ | |
@Log4j2 | |
class ModulesWithinModules2 extends geb.spock.GebReportingSpec { | |
def setup() { | |
to SamplePage2 | |
} | |
def "can access a nested content item with 0.10.0 module syntax"() { | |
expect: | |
levelOne.oldLevelThree.displayed | |
} | |
def "can access a nested content item with 0.12.2 module syntax"() { | |
expect: | |
levelOne.newLevelThree.displayed | |
} | |
} | |
class SamplePage2 extends Page { | |
static url = "file:///C:/Users/Nick/geb12bug.html" | |
static content = { | |
levelOne { module LevelOne } | |
} | |
} | |
class LevelOne extends Module { | |
static base = { $("div.one") } | |
static content = { | |
newLevelTwo { $("div.two").module LevelTwo } | |
newLevelThree { newLevelTwo.module LevelThree } | |
oldLevelTwo { module LevelTwo, $("div.two") } | |
oldLevelThree { module LevelThree, oldLevelTwo } | |
} | |
} | |
class LevelTwo extends Module { | |
} | |
class LevelThree extends Module { | |
} | |
/* | |
*/ |
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
<html> | |
<div class="one"> | |
<div class="two"> | |
<div class="three"> a third thing </div> | |
</div> | |
</div> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment