Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync testing/toss. #223

Closed
dnascimento opened this issue Apr 17, 2015 · 10 comments
Closed

Sync testing/toss. #223

dnascimento opened this issue Apr 17, 2015 · 10 comments

Comments

@dnascimento
Copy link

It should support synchronous toss calls. Currently, you need to create a huge chain of callbacks if you want to run a sequence of steps within the same test.

@cpanato
Copy link

cpanato commented Jun 24, 2015

+1

@TheoBrigitte
Copy link

Agreed, synchronous toss calls would make the tests much more readable and plus the --junitreport produce unstructured report files. Since each frisby.create() produce a different file, in case of callbacks chain you end up with one file per callback instead of one file for the whole chain.

This is probably due to the fact that frisby.toss() wrap test execution in a describe() and it().
describe() seems to be executed in parallel whereas it() are sequential.

If we could somehow move the describe() outside of frisby, every toss() call would be sequential and people could decide how to structure their spec suite which define reports files structure.

@italomaia
Copy link

+1 got into this problem in my first 10 minutes of frisby

@ganmor
Copy link

ganmor commented Jul 8, 2015

I have to say it bite me too. ( Did not even think it was async )

Any test sequence including consecutive tests will be nightmare to write.
Arrow functions might help but....

@igordeoliveirasa
Copy link

+1

@ghost
Copy link

ghost commented Apr 6, 2016

Yes. Callbacks are uncalled for a and very ugly in this context.

@dakk
Copy link

dakk commented Apr 8, 2016

Could be useful to have a system like expressjs middlewares where each middleware perform a specific action.
My idea is to achieve something like that:

frisby.create ('user session')
   .middleware (signup)
   .middleware (login)
   .middleware (profile)
.toss ()

Where "signup" and other middlewares receive an object (where previously called middleware can set session data). Like this:

var signup = function (sessiondata, next) {
   return frisby.create (...)...
     .after (err, res, body) {
           sessiondata.username = username;
           sessiondata.password = '123';
           next (sessiondata);
     })

@dakk
Copy link

dakk commented Apr 9, 2016

I wrote a function to help avoiding callback hell: https://gist.github.com/dakk/c701743a6df931210af1571efe5ade35

@Pablodotnet
Copy link

I got into this problem in my first 10 minutes with Frisby, I'll continue using Newman as long as they fix or work in a method to decide running sequence of our tests.

@vlucas
Copy link
Owner

vlucas commented Jul 26, 2017

This is less of an issue in v2 using promise-style then chains, but live HTTP calls and these tests were never meant to be run sync. If one test depends on another, they need to be nested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants