Pergunta

I am writing tests using selenium webdriver with cucumber. The web page is very much ajax-based. What I want to do is, whenever cucumber calls a method, it should call someother method ALWAYS.

So say in my feature file I have:

When I say hello

which calls method

sayHello()

after this I want

waitForAjax()

to be called.

How can I do this?

Foi útil?

Solução

If you want to invoke that method after each Cucumber step, you can use AfterStep hook:

AfterStep do |scenario|
  # Do something after each step.
end
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top