I'd like to know how you connect frontend BDD (i.e. Jasmine) with backend BDD (rspec, cucumber). How these two relate and form one cohesive BDD cycle? What would be the correct steps of this cycle?
相关问题
- How to check block is called using rspec
- I receive the error: cannot find module 'cucum
- How to delete quotation marks in an array in Ruby
- Port of the Rails app when running Cucumber tests
- How to test my jQuery plugin with Gulp, Jasmine an
相关文章
- How do you run cucumber with Scala 2.11 and sbt 0.
- “No explicit conversion of Symbol into String” for
- Rspec controller error expecting <“index”> but
- Unit test Angular 2 service subject
- How to use synchronize in Capybara exactly?
- How to run a single test file with Karma/Jasmine?
- Selecting a radio button with Rspec
- spyOn could not find an object to spy upon for sta
To create a cohesive BDD cycle you would use the "outside-in" development technique, and then take the approach of "faking it until you make it" i.e. using mock objects until you write concrete implementations.
Lets say you have the following cucumber scenario:
This would be the outermost test you have. Obviously when you'd run this each step would fail as nothing has been implemented.
Now you would revert to creating the front-end BDD using Jasmine to implement the home screen. Once your Jasmine tests succeed, this in turn would cause the "Given" step to pass.
Next you would write more front-end tests to implement the log-in functionality, but at this stage you may mock the call to the server to actually validate the user (hence taking the "fake it to make it" approach). Again, by mocking the log-in process you'll be able to rapidly develop the log-in screen and satisfy the cucumber test.
Once you have written the cucumber test and you Jasmine tests passing, you would then go on to implement the back-end BDD development off the user validation code (i.e. write the concrete code which will authenticate users logging into the site).
Hence you can see that this "Outside in" development approach allows you to use BDD at both the back-end and front-end layers.
Some other useful articles on this development approach are here: