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

Asynchronous step definitions #156

Open
gbrhaz opened this issue Aug 15, 2019 · 0 comments
Open

Asynchronous step definitions #156

gbrhaz opened this issue Aug 15, 2019 · 0 comments

Comments

@gbrhaz
Copy link

gbrhaz commented Aug 15, 2019

One of the common use-cases in tests is to set up your initial state.

There are a few options available to set up the state:

  1. Use existing state (not viable because test environments get stripped down)
  2. Utilise existing UI steps to set the state up appropriately (very slow; repetitive)
  3. Make the necessary network requests to set up the state

Looking at the XCTContext.runActivity closure implementation and the step function there is no way to manage this right now.

You can work around this by creating some kind of State singleton and then do all the work in the XCTestCase setUp/test utilising expectations.

However, one of the great benefits of step definitions is to use regular expressions to define a single step for a variety of inputs.

So the proposal would be for the Step function to have XCTestCaseExpectation as a parameter that devs can use to fulfill; then either side of the step.function(matches) command you'd have the standard let expectation = ... and waitForExpectations.

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

1 participant