FAQ Database Discussion Community


How to declare Module in Page to use IDE autocompletion In GEB?

autocomplete,dsl,geb,strong-typing,pageobjects
According to http://www.gebish.org/manual/current/modules.html#modules Modules should be defined like this: class ExamplePage extends Page { static content = { theModule { module ExampleModule } } } From Geb's Documentation: 16.2.2 Strong typing In order to gain improved authoring support, you must include types in your tests and page objects. Additionally, you...

Geb/Spock login each def

spock,geb
Is there a easy way in Geb/Spock to ensure a login happens before all functional tests? For instance my login test looks like def "login"() { when: to Login and: login(username,password) then: at Dashboard where: username | password "X" | "X" } This is quite alot of code to put...

Geb WaitFor Element's class to refresh issue

spock,geb
I have a JSF/ADF page which has a "button" which starts of as <a id="pt1:r1:0:proBut" class="xfe p_AFDisabled" style="text-decoration:none;"> <span id="pt1:r1:0:pgl13" class="x26j x1a">Proceed</span> </a> Another button is then pressed which changes this button to enabled. <a id="pt1:r1:0:proBut" class="xfe" href="#" onclick="return false;" style="text-decoration:none;"> <span id="pt1:r1:0:pgl13" class="x26j x1a">Proceed</span> </a> You can see there...

Grails remote control plugin - Spring Security Configuration

grails,spring-security,geb,remote-control
Whenever I try to use the Grails Remote Control plugin, I get the following Exception. groovyx.remote.RemoteControlException: Error sending command chain to 'http://localhost:8080/******/grails-remote-control' [test] at groovyx.remote.transport.http.HttpTransport.send(HttpTransport.groovy:65) [test] at groovyx.remote.client.RemoteControl.sendCommandChain(RemoteControl.groovy:114) [test] at groovyx.remote.client.RemoteControl.exec(RemoteControl.groovy:73) [test] at...

spockframework: check expected result after every feature

groovy,automated-tests,spock,geb
I am using spockframework and geb for test automation. I would like to execute after every feature a simple check to be sure that no error dialogs are shown, I have added the following cleanup() method: def cleanup() { expect: $('.myErrrorDialogClass').isEmpty() } The code is executed after every feature but...

Geb/Selenium - Other element would receive the click

jquery,html,selenium,geb
I'm using a mixture of Geb and Selenium to do front end testing for our web portal. Our former developers implemented an overlay div to block any access to page when waiting for content. Thus, I often have to wait for this div to not being visible any longer before...

Gradle GebConfig.groovy parameterized

gradle,geb
I want to paramaterize GebConfig.groovy such that I can specify a RemoteWebDriver url. I am using Gradle as my build tool. My GebConfig.groovy looks like import org.openqa.selenium.remote.DesiredCapabilities import org.openqa.selenium.remote.RemoteWebDriver driver = { DesiredCapabilities capabilities = DesiredCapabilities.firefox() new RemoteWebDriver( new URL("http://xx:4444/wd/hub"), capabilities ) } What I want to do is to...

Grails functional test - DB setup/teardown, running as JUnit in Eclipse

testing,groovy,geb
I am running Geb functional tests in my Grails app through Eclipse "Run As JUnit..." This normally works great and allows me to keep my test server running with grails run-app, and I get fast test execution times. However, it doesn't allow me to use GORM domain objects in my...

Gradle/Spock/Geb org.openqa.selenium.firefox.NotConnectedException on Linux but works on Windows

selenium,gradle,spock,geb
I have a gradle script which sets the geb.build.baseUrl to be a project property. This also does not work with a static url. This works fine on Windows, but on Linux I'm having the following issue: org.openqa.selenium.WebDriverException at LoginTest.groovy:9 Caused by: org.openqa.selenium.firefox.NotConnectedException at LoginTest.groovy:9 org.openqa.selenium.WebDriverException Caused by: org.openqa.selenium.firefox.NotConnectedException When run...

making assertions in Geb JUnit4 tests

grails,geb
I'm using Geb to do some functional testing of a Grails app. I'm using Geb's integration with JUnit4, i.e. my test classes extend geb.junit4.GebReportingTest. Should I make assertions using Java's keyword, e.g. assert 2 == 1 + 1 or JUnit's assert* methods, e.g. Assert.assertTrue 2 == 1 + 1 ...

Use dynamic port from Spring Boot in Geb configuration

java,spring,groovy,spring-boot,geb
Spring Boot's test framework has an option to select a random port for a test run with 'server.port:0'. The documentation suggests grabbing the port as a Spring @Value, but I'm wanting to use it to set the baseUrl in my GebConfig.groovy. Is there a way to access the dynamic port...

Why does my Geb test return “failed to create driver from callback” even after updating my Selenium dependency in Grails?

java,grails,selenium,groovy,geb
I am referencing this previous thread (geb.driver.DriverCreationException: failed to create driver from callback) - but am still having problems. I am trying to run Geb functional tests under Grails 2.4.3 and I have my Selenium support dependency set to version 2.42.2. I've also tried it with 2.43.1 and 2.45.0. Geb...

Geb testing: How to click the link of a controller action?

jquery,grails,controller,geb
I am working through a segment of a Geb test for a Grails app, and can't find this in the docs (though I might be overlooking something). How do you select and click on the link of a controller action? Here's the form element with that has a controller action...

geb filtering link by its content

groovy,automation,geb
I have a page with bunch of hyperlinks. I want geb browser automation suite to filter a specific link by its display value. I could do as below and it works. def links = $("a") def a =[] links.each { if (it.text() == "blah blah blah....") { a.add(it) } }...

Testing Angular ng-if with Geb

javascript,angularjs,geb
I am trying to test if an Angular ng-if element is visible or not using Geb. So far I've attempted to test if the displayed property is true or false as follows. Angular: <article ng-if="!condition" class="bar foo ng-scope">Text to Display</article> Geb UI Module: unselectedErrorText { $(class: "bar foo ng-scope") }...

Geb. Access head element contents (script/stylesheet/title…)

testing,webdriver,geb
I'm trying to get contents of head section of my page. I use selector which returns correct tree node and I can traverse it and get tagNames/attributes, but all texts seems empty. For the html: <head> <script>alert("MSG")</script> </head> $("head").children()*.text() // all empty assert $('head script').text() == "" // assert true,...