Running Gherkin Tests in Eggplant Functional
After you create Gherkin tests, which are described as Features, you can run them in the Eggplant Functional (EPF) Suite window. It's also possible to trigger a Gherkin Feature from a SenseTalk script or from the command line. Each of these methods for running your Gherkin tests is described below. Results for Gherkin tests can be found in the Results pane of the Suite window.
For information about developing Gherkin tests, see Creating Tests with Gherkin.
Running Gherkin Tests in the Suite Window
Running a Gherkin test in the Eggplant Functional Suite window is similar to running scripts. With the test you want to run selected in the editor, you can:
-
Click the Run Script button.
or
-
Select lines in the Feature, then click Run Selection to run only the selected lines.
As you would expect, the test proceeds through the Scenarios in the order listed, and each step within each Scenario in order. When a step completes, it changes color to show the status:
- Green: The step completed successfully (however, see the note below about Passed Steps).
- Red: The step returned an error. This status might mean that the handler ran but logged an error, or it could mean that the associated handler was prevented from running (for instance, if you don't have a remote connection). Check the Results pane for the Feature to determine the specific cause of failure.
- Orange: This status indicates that no SenseTalk handler for the step was found. Either you have not generated the handler, or the text of the Gherkin step and the name of the handler no longer match. See Generating Handlers from Gherkin Steps for information about how handlers are generated and named.
Passed Steps
When you run a Feature test, the step status succeeds and turns green if the Gherkin step is able to connect to a SenseTalk handler and the handler runs without throwing an exception or logging an error. Note that this doesn't guarantee that the step tests what you intend it to. Be sure to test your SenseTalk handler code to ensure that it has the expected results on your systems under test (SUTs).