Different questions lead to different answers, i.e. a decision tree. One such question/answer test has a large decision tree and as such, the cucumber feature file for this section is large (including comments, of which there are many, 1500 lines).
I don't have many java methods (i.e., there are only a handful of different gherkin lines). The feature files read like this:
When I read "some text here"
Then I answer "Yes"
When I read "this new text"
Then I answer "No"
And so on. I realize, because of the limited number of answers, I can replace
Then I answer "Yes" with
Then I answer Yes or Then I answer No
And at the end of these question/answer, the tool responds with a wall of text, many of which repeat (and some "fragments" are repeated in almost every scenario). So I can hard code the text fragments into page objects.
What I'm getting to, though: how do I improve upon this design? Even with the improvements (storing common phrases in methods), I have a feature file that is 1500 lines long (all the scenarios are related to one tool / "view"). The decision tree will have been extracted to yaml files, and I'm wondering if it would make sense to have minimal java methods and create scenarios from parsing the yaml? Or When each page object is created, read a yaml file with specific text that it should contain? As it is, I think my tests are brittle (i.e., have to be changed if the language of a question or answer is changed); but I have to test for specific language.