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

68: Support for dry-run to print undefined steps #70

Merged
merged 10 commits into from
Jul 18, 2017
Merged

68: Support for dry-run to print undefined steps #70

merged 10 commits into from
Jul 18, 2017

Conversation

TitouanVanBelle
Copy link
Contributor

@TitouanVanBelle TitouanVanBelle commented Jun 16, 2017

This pull request allow users to use the dry run feature described in #68 the following way

[Cucumberish instance].dryRun = YES;
[Cucumberish instance].dryRunLanguage = CCILanguageObjectiveC;

The results are printed in the logs the following way

dryRunLanguage = CCILanguageObjectiveC

2017-06-16 16:52:22.892 xctest[39431:10863180] 

Dry Run Results
=====================================================
Found the following undefined steps:

Given(@"^a Given statement$", ^(NSArray<NSString *> *args, NSDictionary *userInfo) {

});

And(@"^an And statement$", ^(NSArray<NSString *> *args, NSDictionary *userInfo) {

});

=====================================================

dryRunLanguage = CCILanguageSwift

2017-06-16 16:52:22.892 xctest[39431:10863180] 

Dry Run Results
=====================================================
Found the following undefined steps:

Given("^a Given statement$") { (args, userInfo) in

}

And("^an And statement$") { (args, userInfo) in

}

=====================================================

When all steps are defined, the following is printed

Dry Run Results
=====================================================

All the steps are defined

=====================================================

@brentleyjones brentleyjones self-requested a review June 16, 2017 14:38
Copy link
Collaborator

@brentleyjones brentleyjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial review looks good. Do you think you could add some tests for this, so we don't regress on the behavior later (since not everyone will use this feature)?

@TitouanVanBelle
Copy link
Contributor Author

Sure. Any idea what kind of tests would fit better for this feature? Do you think it makes sense to add tests to the CucumberishTests target for this?

@brentleyjones
Copy link
Collaborator

Yeah, add tests to CucumberishTests target. After that I'll get to this after the 4th of July. Busy at work and then a small vacation.

@TitouanVanBelle
Copy link
Contributor Author

I added some test to the CucumberishFeatureDefinition target because the step definitions form the CucumberTests target are using @"(.*)" which makes it hard to have undefined steps.

I had to add a log manager to assert that the logs were properly printed. It might a bit overcomplicated for the task but it does the job.

I also had some problem since the steps are not executed when dryRun is enabled so I had to do the assertion in the afterFinish block. The problem with this solution is that it will fail the last scenario executed if the assert fails. So the dryRun scenario should always be executed last and that's why I added numbers to the feature names.


/**
@return a string composed of the keyword and the text of the tep
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: tep

@brentleyjones brentleyjones merged commit 3fa1ee1 into Ahmed-Ali:develop Jul 18, 2017
@brentleyjones
Copy link
Collaborator

Thanks @TitouanVanBelle!

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

Successfully merging this pull request may close these issues.

2 participants