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

Sugar Step for E2E Testing and Test Tags for Mocked E2E #18

Open
thematho opened this issue Oct 27, 2015 · 1 comment
Open

Sugar Step for E2E Testing and Test Tags for Mocked E2E #18

thematho opened this issue Oct 27, 2015 · 1 comment

Comments

@thematho
Copy link

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.

@CarmenPopoviciu
Copy link
Owner

@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

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

No branches or pull requests

2 participants