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

Feature request: run scenarios separately with Native #97

Open
martin-tomes opened this issue Feb 10, 2018 · 5 comments
Open

Feature request: run scenarios separately with Native #97

martin-tomes opened this issue Feb 10, 2018 · 5 comments

Comments

@martin-tomes
Copy link

Hello, its me again :)

One of main advantages I can see for using the Core is an option to run each scenario (implemented as a function) separately. But using Core needs manual writing which kinda sucks.

Native allows automation. Tests runs automatically but debugging optionsare limited here (as written in the README).

Is it possible to enhnace Native implementation with an option to run scenarios separately? Eg with help of NativeFeature Parser generate scenarios as functions into a separate .swift file as XCtest functions so that a tester could run scenarios the same way as with Core.

@kerrmarin
Copy link
Member

Hey @tomesm. This is something I've run into as well. Because we create the tests at runtime they are classified as 'runtime tests' and Xcode only lists them in the test inspector after the first time you've run them. We've toyed with the idea of generating tests from feature files before e.g.:
Given the following feature file:

Feature: Basic tests
    Scenario: Basic steps
        Given A situation that I want to start at
        Then This value should be 100

run a command that will output BasicTests.swift with:

import XCTest
import XCTest_Gherkin

final class BasicTests: XCTestCase {
    func testBasicSteps() {
        Given("A situation that I want to start at")
        Then("This value should be 100")
    }
}

Is this what you mean? I think this would be a great feature to have as a command-line option that we run on demand/as part of a pre-build step. We'd be happy to look at a PR that implements this if you would like to take the initiative on it 👍

@deanWombourne
Copy link
Contributor

We've also tried a few other things with very little success (i.e. tags - #3). It would be really nice to be able to support (somehow) passing in a tag (or even scenario name), ideally on the command line so CIs can run subsets of tests as well as just while debugging. However, I just can't work out a good way to do it!

@deanWombourne
Copy link
Contributor

This has also been raised before here - #55 - are these the same issue?

@martin-tomes
Copy link
Author

@deanWombourne yes this looks like pretty much the same request.

@tomleightonstars
Copy link

tomleightonstars commented Apr 21, 2021

hey @tomesm! I know it's quite a while since you opened this but I've recently submitted a PR to add in tags as was being described above :). #185

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

4 participants