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

Add support for tags #3

Open
nap-sam-dean opened this issue Nov 12, 2015 · 14 comments
Open

Add support for tags #3

nap-sam-dean opened this issue Nov 12, 2015 · 14 comments

Comments

@nap-sam-dean
Copy link
Member

Both Feature tags and Scenario tags

@nap-sam-dean nap-sam-dean self-assigned this Nov 12, 2015
@shalinbshah
Copy link

Any update/timeline on this?

@nap-sam-dean
Copy link
Member Author

Honestly, it's not looking good. Without the ability to pass in tags somehow on the command line I can't see how this would work.

A change to xcodebuild to allow an environment variable (i.e. TAGS=@smoke,@api xcodebuild ...) to be set was my initial thought, but I can't see a way to pass that into the app's process.

I've not given up yet, but I'm not far off.

@kerrmarin
Copy link
Member

Worth adding a help-wanted label?

@nap-sam-dean
Copy link
Member Author

Added. Didn't know that was a Thing™.

@merrygobyebye
Copy link

Have you considered using the Objective-C Gherkin parser/compiler?
https://github.com/cucumber/gherkin

@dhoskins
Copy link

I assume the difficulty here is in the use of tags to run only a subset of tests at a time.

Tags can also be used in conjunction with hooks to define @Before and @After blocks for scenarios. I assume that this would be an easier task.

Is this correct, and would it be worth splitting this issue in to these two scenarios?

@smaljaar
Copy link
Contributor

smaljaar commented Nov 23, 2016

@dhoskins we are currently looking into integrating support for the @after blocks so we can do cleanup after executing a test case, so hopefully a pull request will follow soon. If any ideas let me know!
Update: I got @before and @after tags working as they do for Cucumber, see https://github.com/smaljaar/XCTest-Gherkin/tree/feature/support-before-and-after-tags I hope to shape this into a pull request next week.

UPDATE: priority for this in our team was dropped, so no progress here for now. Maybe in future.

@nap-sam-dean nap-sam-dean removed their assignment Mar 28, 2017
@bartzet
Copy link

bartzet commented Oct 16, 2017

Hey Guys,
There is a Cucumberish library: https://github.com/Ahmed-Ali/Cucumberish / https://github.com/Shashikant86/XCFit that supports tags maybe worth looking at it and apply solutions to XCTest-Gherkin?

@depoon
Copy link

depoon commented Oct 17, 2017

Was a huge fan of XCTest-Gherkin when i first saw it... but i've migrated over to Cucumberish

@bartzet
Copy link

bartzet commented Oct 17, 2017

@depoon what was the main reason you have chosen Cucumberish over XCTest-Gherkin?

@kerrmarin
Copy link
Member

Thanks for the pointers @bartzet -- we'd be happy to look at a pull request that implements tags as this seems like a widely requested feature.

@depoon I'd also be super keen to learn why you migrated over :)

@jcavar
Copy link
Contributor

jcavar commented Sep 17, 2019

It is possible to pass flag from xcodebuild using User-Defined Build settings.
This answer explains how it can be accessed at runtime:
https://stackoverflow.com/questions/3968919/how-can-i-access-a-user-defined-xcode-build-setting

I think, app needs to be rebuild for this value to be reflected, which then means that test-without-building might not work. But this is probably not an issue for majority of use cases.

@PersianDevelopers
Copy link

I made a PR for scenario tags. It will help others to bypass some scenarios in a feature file.
with having tags for scenario even if there are no tags for the feature it could help a lot.
#165

@tomleightonstars
Copy link

Tag running implemented in PR #185

tomleightonstars referenced this issue in Flutter-International-Sports-Platforms/XCTest-Gherkin Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests