GithubHelp home page GithubHelp logo

Comments (4)

aslakhellesoy avatar aslakhellesoy commented on July 19, 2024

I would expect the execution order to be the order of instantiation of the classes they live in. I would also expect the order of execution of several Before hooks within the same class to be the order of declaration in that class.

I haven't verified if this is the case. It just might be working that way by chance. If not we have an interesting problem to solve. I hope we don't have to come up with numbered arguments.

BTW, After hooks should always run in the opposite order of Before hooks.

from cuke4duke.

olemartin avatar olemartin commented on July 19, 2024

The order seems kind of random right now. I have two @before hooks declared in the same class, and the last method is ran before the first one.
I am testing cuke4duke with webdriver and I have one hook that bring up the browser, and another one that login the user. The order of these are obviously important :)

You may add an optional order-argument to the annotation that is used if the order is important for the end-user.

from cuke4duke.

aslakhellesoy avatar aslakhellesoy commented on July 19, 2024

Is it so that you only want to log in in certain scenario? If not, a workaround until this is fixed could be to do it all in one @before block.

We could add an order number, but it would be nicer if cuke4duke followed the rules I outlined above, don't you think?

from cuke4duke.

aslakhellesoy avatar aslakhellesoy commented on July 19, 2024

I ended up adding a new @order annotation: http://wiki.github.com/aslakhellesoy/cuke4duke/hooks

from cuke4duke.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.