Cucumber looking ahead to following stepdefinitions

20 views Asked by At

I got a lot of Cucumber tests like this and I want to speed it up.

  Scenario testFoo
    Given Frame Foo exists
    When  I send a Invoice 
    Then  I get the results                 (<- this step retrieves the pdf file)
    And   I check the results               (<- this step does a lot of checks)
    And   I check the pdf for invalid text  (<- optional step, it converts the pdf to txt and checks it)

The last step and especially converting the pdf to text takes some time. My idea is, to start the converting of the pdf earlier in the background so it would already be ready for the test when the "I check the pdf for invalid text" is processed.

If the step "I get the results" would already know that one of following steps is "I check the pdf for invalid text" it might already start to convert the pdf.

Is there a way to see the following teststeps?

Sure, I could write it like this:

Then  I get the results          
 And  I convert the pdf   (<-new, but bad solution)
And   I check the results  
And   I check the pdf for invalid text

BUT (!) that would be just a technical advise for the software and not really a Gherkin/Cucumber test step.

0

There are 0 answers