Adam,

When I wish to add, edit and delete an item I would either:
- do it all in a single test
- split it into 3 tests and would write code that allows me to setup the
application before each of them and check the state of the application
after each of them in a way completely independent of the UI - for example
by going directly to the DB or using something like Groovy Remote Control (
https://github.com/alkemist/remote-control, unfortunately undocumented)

I would never split it into three tests and setup them to run in a
particular order.

On Thu, Jan 26, 2017 at 3:44 PM, Adam Sherman <[email protected]> wrote:

> Marcin,
>
> Thanks for that description, it makes perfect sense why you would want to
> do this but I'm not sure it can always be done.  For instance you wish to
> add, edit and delete the same thing in an application.  Or, you are adding
> something (say, a bookmark) and you need to test that clicking it takes you
> to the desired page (you can't click on any bookmark because you need to
> know where it is going)?  What is your suggestion for these cases?
>
> On Friday, November 11, 2016 at 3:25:26 AM UTC-6, Marcin Erdmann wrote:
>>
>> Hi Romz,
>>
>> To be honest it's more a Spock question than a Geb question. You could in
>> theory create a JUnit test suite of specifications(https://groups.
>> google.com/forum/#!topic/spockframework/u4iwcAP8kng) which
>> would influence the order of test class execution but I would strongly
>> advise not to do it.
>>
>> Ideally you want your tests to be completely independent so that you can
>> run them in any order or even more importantly on it's own. This will save
>> you a lot of time and head scratching when a test fails because a new test
>> has been added which runs before and modifies the state on which your tests
>> depends - this is sometimes referred to as test bleed. Also consider a
>> situation where you have a fixed order of all of your tests and a test
>> which is last in that order fails - you will need to run the whole suite
>> every single time you want to run that test otherwise you have no guarantee
>> that it will run with the expected state.
>>
>> Marcin
>>
>> On Wed, Nov 9, 2016 at 8:05 AM, <[email protected]> wrote:
>>
>>> H Geb User
>>>
>>>
>>> I would like to ask if we can modify the sequence of test execution
>>> between test classes, i just observed that it was executed alphabetically
>>>
>>>
>>>  i.e
>>> when i run the test.
>>> order is
>>> 1. AGebSpec.groovy, ->  2. BGebSpec.groovy. ->  3. CGebSpec.groovy.
>>>
>>> Thanks and regards,
>>> Romz
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Geb User Mailing List" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/geb-user/e9305e57-ff0b-4684-8b82-033913ed4fea%40googlegroups.com
>>> <https://groups.google.com/d/msgid/geb-user/e9305e57-ff0b-4684-8b82-033913ed4fea%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Geb User Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/geb-user/dafc1138-801c-4371-af30-f2f796063b7a%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/dafc1138-801c-4371-af30-f2f796063b7a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/CA%2B52dQSbDD8uux_RAgNC2J-f9MuLwcPO5_DPjsmamdpm3bD2Vw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to