sreedharkesarla / spock

Automatically exported from code.google.com/p/spock
0 stars 0 forks source link

FunctionalSpec base class #204

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Describe the new feature you have in mind.

A base class facilitating building and sending HTTP requests and checking 
response content in user-friendly way.

Which particular problem would this feature solve for you?

Often a grails application needs to be tested as a webservice (i.e. using HTTP 
language). FunctionalSpec would provide a convenient way to test methods 
returning XML or JSON. It would also be useful as a workaround solution for 
testing HTML pages in cases where Geb/Selenium doesn't work (it's common to get 
technical errors on pages with javascript-heavy UI) There used to be a 
FunctionalSpec base class in the earlier versions of the Spock plugin which we 
found very useful. 

Currently the documentation refers to Geb for functional testing, however Geb 
is not a replacement for the FunctionalSpec, it is complementary (testing in 
HTTP terms vs. testing in user interface terms).   

Please provide any additional information below. You can also assign
labels.

I imagine FunctionalSpec would:
1. provide DSL for issuing HTTP requests
2. shortcuts for parsing responses as JSON, XML, perhaps also dirty HTML (not 
valid XML)

Original issue reported on code.google.com by robok...@gmail.com on 27 Sep 2011 at 9:00

GoogleCodeExporter commented 8 years ago
This issue belongs to the Grails module (not core as listed now) but I don't 
see how I can change this.

Original comment by robok...@gmail.com on 27 Sep 2011 at 9:01

GoogleCodeExporter commented 8 years ago
Perhaps 'HttpSpec' would be a more precise name that would distinguish the 
functionality from other functional testing libraries (geb, functional-test 
plugin, ...).

Original comment by robok...@gmail.com on 27 Sep 2011 at 9:13

GoogleCodeExporter commented 8 years ago
Luke, do you think this belongs into spock-grails?

Original comment by pnied...@gmail.com on 12 May 2012 at 6:34

GoogleCodeExporter commented 8 years ago
No, this doesn't belong in spock-grails. This would be a separate library that 
builds on spock-grails.

Original comment by lda...@gmail.com on 14 May 2012 at 7:34