{"action":"created","issue":{"url":"https://api.github.com/repos/meadsteve/white-bread/issues/58","repository_url":"https://api.github.com/repos/meadsteve/white-bread","labels_url":"https://api.github.com/repos/meadsteve/white-bread/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/meadsteve/white-bread/issues/58/comments","events_url":"https://api.github.com/repos/meadsteve/white-bread/issues/58/events","html_url":"https://github.com/meadsteve/white-bread/issues/58","id":163501502,"number":58,"title":"Providing steps definitions basic implementation when running a new feature.","user":{"login":"danielfoxp2","id":2607307,"avatar_url":"https://avatars.githubusercontent.com/u/2607307?v=3","gravatar_id":"","url":"https://api.github.com/users/danielfoxp2","html_url":"https://github.com/danielfoxp2","followers_url":"https://api.github.com/users/danielfoxp2/followers","following_url":"https://api.github.com/users/danielfoxp2/following{/other_user}","gists_url":"https://api.github.com/users/danielfoxp2/gists{/gist_id}","starred_url":"https://api.github.com/users/danielfoxp2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielfoxp2/subscriptions","organizations_url":"https://api.github.com/users/danielfoxp2/orgs","repos_url":"https://api.github.com/users/danielfoxp2/repos","events_url":"https://api.github.com/users/danielfoxp2/events{/privacy}","received_events_url":"https://api.github.com/users/danielfoxp2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-02T04:35:44Z","updated_at":"2016-07-02T14:49:57Z","closed_at":null,"body":"I am trying to learn Elixir. Having some kind of obsessive-compulsive disorder I want to do it in a certain way. This includes cucumber. I look around and found your port of it. Great, made my day and I really appreciate the effort and the work done. So, before anything, thank you.\r\n\r\nBut I am missing some things that I take for granted, like the features and step_definitions directories, the suggestion of implementation of steps when running a feature without steps definitions, and others little things. In this issue, I will ask about one of this things and make a suggestion/request for another one.\r\n\r\nI only have used cucumber.js and SpecFlow, but I already saw original ruby cucumber and all these three work very similar in this regards (i.e. directories names and places and features without step definition implemented).\r\n\r\nI looked in the code but, as a beginner, it was hard for me to understand and have the confidence to change it. But, if you let me, I thought a way that I could help and so I created the things below.\r\n\r\nLet me know if it's valid or if it's out of concern for White-Bread now and future. Thank you again.\r\n\r\n```gherkin\r\nFeature: Steps definitions automatically created\r\n\r\n  As a developer using white_bread to specify behaviors of my app\r\n  I want that the step definitions template to be created automatically\r\n  So that I optimize use of time and minimize work done in unimportant tasks focusing \r\n  in write the specifications and the code needed to comply the acceptance criteria\r\n\r\n  Scenario: Execution of a new feature that hasn't any step definition\r\n    Given I create a feature file with two scenarios\r\n    And each scenario has three steps\r\n    When I execute White-Bread for this feature\r\n    Then I should see it fails because no step definitions exist for this feature\r\n    And I should see a possible initial implementation of these steps definitions\r\n    And I should be asked if I want that White-Bread creates these steps definitions\r\n\r\n  Scenario: Creation of steps definitions initial implementation \r\n    Given I executed a feature that has zero step definition implemented\r\n    And I am asked if I want that White-Bread creates these steps definitions\r\n    When I answer yes\r\n    Then a step definition file is created\r\n    And the initial implementation is inserted in the new step definition file\r\n    And I should be informed that the steps definitions were successfully created\r\n    And I should be informed where the file was created\r\n\r\n  Scenario: Adding new step in a feature that already has steps definitions implemented\r\n    Given I am editing a feature to add a new step\r\n    When I execute the White-Bread for this feature\r\n    Then I should see the status of the previous steps till the new step\r\n    And I should see the feature fails because the new step is non-implemented\r\n    And I should see the suggested implementation of the new step\r\n    And I should not be asked if I want to automatically create the new step\r\n\r\n```\r\nIn SpecFlow, inside Visual Studio, I am able to use the IDE to generate the steps automatically or just copy the steps definitions to clipboard. In cucumber.js, we can see the steps definitions suggestions in the console and we can copy to clipboard too, but manually. With Elixir, I am thinking in use some kind of SpecFlow variation.\r\n\r\nThe actual behavior of White-Bread when it comes to run features that do not have steps definitions implemented is a kind of misinformation since it shows that the feature passes. So my user story described above can address this misinformation issue too, which is a serendipity welcome gain. \r\n\r\nYou have your reasons, of course, but why you choose not to follow the behavior of cucumber for ruby when it comes to names and places of directories (i.e. Having a features directory and inside of it the steps definitions directory - named steps_definitions - where all implementation of each step in a feature is placed)? \r\n\r\nI am really sorry for any mistake that I probably made writing this. English is another language that I am trying to learn.\r\n\r\n=======================\r\nSome sources to exemplify myself, I don't know if it is needed hehe...\r\nhttps://blog.codecentric.de/en/2013/08/cucumber-setup-basics/\r\nhttps://www.custardbelly.com/blog/blog-posts/2014/01/08/bdd-in-js-cucumberjs/\r\n\r\nCheers."},"comment":{"url":"https://api.github.com/repos/meadsteve/white-bread/issues/comments/230105412","html_url":"https://github.com/meadsteve/white-bread/issues/58#issuecomment-230105412","issue_url":"https://api.github.com/repos/meadsteve/white-bread/issues/58","id":230105412,"user":{"login":"meadsteve","id":1663120,"avatar_url":"https://avatars.githubusercontent.com/u/1663120?v=3","gravatar_id":"","url":"https://api.github.com/users/meadsteve","html_url":"https://github.com/meadsteve","followers_url":"https://api.github.com/users/meadsteve/followers","following_url":"https://api.github.com/users/meadsteve/following{/other_user}","gists_url":"https://api.github.com/users/meadsteve/gists{/gist_id}","starred_url":"https://api.github.com/users/meadsteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meadsteve/subscriptions","organizations_url":"https://api.github.com/users/meadsteve/orgs","repos_url":"https://api.github.com/users/meadsteve/repos","events_url":"https://api.github.com/users/meadsteve/events{/privacy}","received_events_url":"https://api.github.com/users/meadsteve/received_events","type":"User","site_admin":false},"created_at":"2016-07-02T14:49:57Z","updated_at":"2016-07-02T14:49:57Z","body":"Hi @danielfoxp2. Firstly thank you for taking the time to raise an issue. I really appreciate it.\r\n\r\nWhite bread already uses a features directory. Is there something I could do to make this clearer? \r\nWould it help if I added a command like?\r\n```bash \r\nmix white_bread.new_feature my_cool_feature \r\n```\r\n\r\nI added your feature above to a file called ```features/test.feature``` then ran ```mix white_bread.run``` and the output was:\r\n```bash\r\nDefault context module not found in features/contexts/default_context.exs.\r\nCreate one [Y/n]?\r\ny\r\n```\r\nthen \r\n```\r\nloading features/contexts/default_context.exs\r\nExecution of a new feature that hasn't any step definition ---> failed\r\nCreation of steps definitions initial implementation ---> failed\r\nAdding new step in a feature that already has steps definitions implemented ---> failed\r\n3 scenario failed for Steps definitions automatically created\r\n  - Execution of a new feature that hasn't any step definition --> undefined step: I create a feature file with two scenarios implement with\r\n\r\ngiven_ ~r/^I create a feature file with two scenarios$/, fn state ->\r\n  {:ok, state}\r\nend\r\n\r\n  - Creation of steps definitions initial implementation --> undefined step: I executed a feature that has zero step definition implemented implement with\r\n\r\ngiven_ ~r/^I executed a feature that has zero step definition implemented$/, fn state ->\r\n  {:ok, state}\r\nend\r\n\r\n  - Adding new step in a feature that already has steps definitions implemented --> undefined step: I am editing a feature to add a new step implement with\r\n\r\ngiven_ ~r/^I am editing a feature to add a new step$/, fn state ->\r\n  {:ok, state}\r\nend\r\n```\r\n\r\nSo it gives the code for the first undefined steps but not all of them. I agree it would be better to create all of them so I've created #59.\r\n\r\nAs for ```step definitions``` I instead used the terminology ```contexts``` which I took from another cucumber implementation behat (http://docs.behat.org/en/v3.0/guides/4.contexts.html). I prefer context as it fits better with how I talk about them:\r\n\r\nI'm testing feature A in the context of my http API.\r\nI'm testing features A & B in the context of my command line tool.\r\n\r\nDo you think there's anything I could do to make the relationship between contexts and step definitions clearer?\r\n\r\nI'm currently working on V3 of this tool so now is a good time for any breaking changes to happen."}}
{"actor":{"display_login":"meadsteve"}}