Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion - how to generate feature file #258

Open
AnthonyTonda opened this issue Dec 15, 2023 · 1 comment
Open

Discussion - how to generate feature file #258

AnthonyTonda opened this issue Dec 15, 2023 · 1 comment
Labels

Comments

@AnthonyTonda
Copy link

Given I have this tests
`import spock.lang.Specification

class HelloSpockSpec extends Specification {
def "length of Spock's and his friends' names"() {
expect:
name.size() == length

where:
name     | length
"Spock"  | 5
"Kirk"   | 4
"Scotty" | 6

}
} `

When I run the test
Then Spock-reports ; HelloSpockSpec.HelloSpockSpec.html, is generated
And how to generate the feature file: HelloSpockSpec.feature such as

Feature: HelloSpockSpec

Scenario: length of Spock's and his friends' names
Given I have these data
| Spock | 5 |
| Kirk | 4 |
| Scotty | 6 |
Then name.side() == length

Thanks

@renatoathaydes
Copy link
Owner

Spock reports can only generate a summary file containing all specifications in the project, and a separate file for each Specification.
The easiest way to generate files for each feature would be to implement that via report templates, as templates are Groovy code which allows you to implement anything in a real programming language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants