mercredi 16 mai 2018

Execute action every 'when' step Spock

I want to do action takeScreen() every 'when' step (Spock). How can I do that without calling this function every 'when' step.

 def "doSomeAction"() {
    when:
    doSmth()
    takeScreen()
    then:
    at SomePage
    when:
    doAction()
    takeScreen()
    then:
    at SomePage
}

def takeScreen(){
    //code there
}

Aucun commentaire:

Enregistrer un commentaire