Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7853163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:36:12+00:00 2026-06-02T19:36:12+00:00

I have some problems regarding functional testing in Grails using GEB+Spock. If i run

  • 0

I have some problems regarding functional testing in Grails using GEB+Spock. If i run “test-app” it always fails, but if i run “test-app -integration” before “test-app” it works!

The following test-sequence illustrates my problem:

Run #1

grails> clean
grails> test-app -functional
...
Tests PASSED

Run #2

grails> clean
grails> test-app
...
Tests FAILED

Run #3

grails> clean
grails> test-app -functional
...
Test PASSED
grails> test-app
...
Test PASSED

The tests that are failing are throwing “geb.waiting.WaitTimeoutException: condition did not pass in 10.0 seconds”. It is worth noting that the test cases that are failing are waiting for results from a database query.

So my question is what exactly is the difference then the functional tests are run through “test-app -integration” versus “test-app”?

The only difference from what i thought was that “test-app” is running all test phases (unit, integration, functional).

And the weird thing is that it do works somehow, but only if i run “test-app -integration” first :/

Im using the following setup:

  • grails 2.0.1
  • geb 0.7.0
  • spock 0.6
  • htmlunit-driver 2.0rc3 (ive tried with 2.20.0 but gave me even more problems)

Really hoping that someone can help me on this. Geb+spock seems like a nice solution, when it works…

Regards
Tobbe

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:36:12+00:00Added an answer on June 2, 2026 at 7:36 pm

    I managed to solve this problem and writing the solution here for others if interested. THe solution was found by using geb report function (great tool!)

    The Problem was that im using grails ZKUI alot in the application that the functional tests are working against and zkui generated different html-code in the different test scenarios (yep this is really odd).

    For example a zk button i the composer:

    <z:button id="simpleSearchButton" class="simpleSearchButton"/>
    

    When running “test-app -integration” it generated the following:

    <span id="cECQ4" class="simpleSearchButton z-button"><table id="cECQ4-box" style=""     cellpadding="0" cellspacing="0" border="0"><tbody><tr><td class="z-button-tl"/><td class="z-button-tm"/><td class="z-button-tr"/></tr><tr><td class="z-button-cl"><button type="button" id="cECQ4-btn" class="z-button"/></td><td class="z-button-cm"><img src="/certservice-admin/images/search.png;jsessionid=2ADDD6FA5F1D011A96E447435514BDA2" align="absmiddle"/></td><td class="z-button-cr"><div></div></td></tr><tr><td class="z-button-bl"/>td class="z-button-bm"/><td class="z-button-br"/></tr></tbody></table></span>
    

    But when running “test-app” it generated the following:

    <button type="button" id="l9AP4" class="simpleSearchButton z-button-os"><img src="/certservice-admin/images/search.png;jsessionid=835A2B8A3FE0C54341BB4F109A0CCC62" align="absmiddle"/></button>
    

    In my Page object i defined the button as:

    simpleSearchButton(required: false) { $("span.simpleSearchButton") }
    

    Which failed with “test-app” but not with “test-app -integration”. The simple solution to the hard/wierd problem was:

    simpleSearchButton(required: false) { $(".simpleSearchButton") }
    

    🙂

    Cheers
    /Tobbe

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to functional programming, so some problems seems harder to solve using functional
I have a problem with some source code regarding OpenSSL and Cpp. For some
I have some problems with refreshing on a lazy loaded dataTable of Primesfaces. I'm
i have some problems in exporting crystal reports to pdf. My program crashes at
I have some problems calling a constructor with a hash. I get the error:
I have some problems with my DAO implementation. My scenario: I insert one entity
I have some problems with Miktex installed on Windows Vista Business SP1/32 bit. I
I have some problems on a site with the concurrent access to a list.
I had some good insight to an earlier post regarding this, but I have
I'm having some problems regarding a jQuery modal window. I'm a dba and SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.