You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i have to proposal for this guideline i would like to discuss about it so we can see if i should make a pull request.
Sugar-Step
Adding a sugar-step allows you to handle Synchronous and Asynchronous steps execution under the hood. I made a cucumber-protractor-template (read the Easy Asynchornous/Synchornous Steps section) in which i implemented the JS version of sugar-step and explain what it does, I think it would be a good addition to the guideline although it should be provided with protractor.
Test Tags
Cucumber support the tags around the Scenarios definitions I don't know if Jasmine supports it, i couldn't find any documentation about it.
[Rule-20: Don't mock unless you need to]
This rule can take a different approach than "mock all" vs "real environment". The issue is that Mock your back-end services is necessary not for a matter of "should be encapsulated or integrated" the real question should be matter of can i test my entire application workflow?
Most of the time you can't instance:
Scenario: Authentication success Given I am on the main page And I click the login button And I enter "myUserName" user and "password" password When I press OK btn Then I should see "myUserName" as current user
Scenario: Authentication error displayed when server is down Given I am on the main page And I click the login button And I enter "myUserName" user and "password" password When I press OK btn Then I should see an error message with "404" status code
Both scenarios can't be tested in the same execution without using mocks.
However we can use the tags of cucumber to add for instance @IntegrationTest and @DevTest to our Scenarios so the success and fail scenario can be tested in a full Mock execution, and the success scenario can be run in a full integration execution free of mocks.
The text was updated successfully, but these errors were encountered:
@thematho thank you for bringing this up! Let me read into it and see if it makes sense to add it to the styleguide, and if so, what's the best way to do it :). You'll hear from me soon
Hi, i have to proposal for this guideline i would like to discuss about it so we can see if i should make a pull request.
Sugar-Step
Adding a sugar-step allows you to handle Synchronous and Asynchronous steps execution under the hood. I made a cucumber-protractor-template (read the Easy Asynchornous/Synchornous Steps section) in which i implemented the JS version of sugar-step and explain what it does, I think it would be a good addition to the guideline although it should be provided with protractor.
Test Tags
Cucumber support the
tags
around the Scenarios definitions I don't know if Jasmine supports it, i couldn't find any documentation about it.This rule can take a different approach than "mock all" vs "real environment". The issue is that Mock your back-end services is necessary not for a matter of "should be encapsulated or integrated" the real question should be matter of can i test my entire application workflow?
Most of the time you can't instance:
Scenario: Authentication success
Given I am on the main page
And I click the login button
And I enter "myUserName" user and "password" password
When I press OK btn
Then I should see "myUserName" as current user
Scenario: Authentication error displayed when server is down
Given I am on the main page
And I click the login button
And I enter "myUserName" user and "password" password
When I press OK btn
Then I should see an error message with "404" status code
Both scenarios can't be tested in the same execution without using mocks.
However we can use the tags of cucumber to add for instance
@IntegrationTest
and@DevTest
to our Scenarios so the success and fail scenario can be tested in a full Mock execution, and the success scenario can be run in a full integration execution free of mocks.The text was updated successfully, but these errors were encountered: