-
Notifications
You must be signed in to change notification settings - Fork 64
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
Feature request - Implement custom versions of 'test000, test001, etc.' #181
Comments
Thanks @tomleightonstars raising this. It will be a great help if we can do the above. |
Hey. Couple of question to see if I've understood your requirements :)
|
Thank you for all your hard work with this repo 😄❤️ |
Or, would it even possible to remove 'test' as well? |
IIRC we added the numbers to make sure that tests were run sequentially as defined, because the order wasn't guaranteed when the tests were dynamic...? |
I would be against the idea of running tests in some order as each test should be independent. The test name should be unique and should not contain static prefixes. |
Personally, so would I. However, a guiding principle I've been following is "do what cucumber would do" and (I believe) it will run the tests in the order they are specified in the feature file. That being said, if people want to opt out of that behaviour then that's fine by me :) My current plan for this is for a user to be able to pass in a block which will return the test selector name - where the default would be this (backwards compatibility is important): NativeScenario.selectorFactory = { (name: String, index: Int) -> String in
"\(self.leftPad(index))\(self.name.camelCaseify)"
} This isn't final - there's probably some tweaking here. |
FYI @tomleightonstars The prefix |
That sounds like a great plan! I had a go at trying to add something in but I couldn't get it working 🤦♂️
fair enough! I thought that might be the case |
Hi, me again! I hope you're well!
I'm just wondering if there's a way to implement a custom version of the SelectorString value in NativeScenario.swift? I'm aware I can change the value in there but then it won't be iterated through git to others.
I know similar is done when parsing the location of the Features folder, so maybe something similar could be done?
I can see 'test' is required in the returned name for the tests to actually run, it would be great to then be able to have something custom after that, if anything, e.g.:
testAScenarioName
test_AScenarioName
test-AScenarioName
❤️
The text was updated successfully, but these errors were encountered: