Geb: Waiting/sleeping between tests -


Is there any way to wait for a set amount between trials? I need a solution to compensate for server intervals When creating records, it takes a while before searching for records in my environment.

In the following code example, how do I wait 30 seconds between the first exam and the second exam and there is no waiting time between the second test and the third test?

  class Expands MySpec GebReportingSpec {// First Test Df "Should create a record named My Record" () {given: CreateRecordsPage: name_field = "MyRecord" and: saveButton.click () Then: IndexPage} // Second Test Def "should enter my record name" (given) {given: for searchPage when: search_query = "myRecord" and: searchButton.click () then: // So far this part Not shown, but will appear for "myRecord" on the results page // Third Tess TDRF should "delete my record name from record" () {// delete You probably do not want to wait for a set time - this is your test. Will slow down as soon as the record is added, you would ideally prefer to continue. You can use Geb's  waitFor {}  to vote for the condition. 

  // The second test def should enter "my record name" () {when: search for the search page: waitFor (30) {search_query = "myRecord" searchButton.click () // Verify that the record was found}}  

It will vote for half the second for 30 seconds for the condition to pass as soon as it is and fail If it is still not completed after 30 seconds.

Waiting for you, you have the option to set the waiting time and the interval, you may also want to check on the section of the Jib.

If your second facility method depends on the success of the first, then you should comment with this specification.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -