-
-
Save kellyrob99/51dccff57de5427c71fe to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@Grab('org.seleniumhq.selenium:selenium-firefox-driver:2.42.2') | |
@Grab(group='org.gebish', module='geb-core', version='0.9.3') | |
import com.sonatype.insight.brain.testing.functional.* | |
import geb.Browser | |
import geb.navigator.Navigator | |
//given the following page: | |
/* | |
<html> | |
<head> | |
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script> | |
</head> | |
<body> | |
<h1> | |
It works! | |
</h1> | |
<div style='display:none;'>content</div> | |
</body></html> | |
*/ | |
Browser browser = new Browser(baseUrl: 'http://localhost/') | |
Browser.drive(browser) { | |
go 'index2.html' | |
def div = $('div') | |
assert !div.displayed | |
assert !div.text() | |
browser.js.exec('$("div").css("display","block")') | |
assert div.displayed | |
assert div.text() == 'content' | |
}.quit() | |
browser = null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment