You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Use existing state (not viable because test environments get stripped down)
Utilise existing UI steps to set the state up appropriately (very slow; repetitive)
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.
The text was updated successfully, but these errors were encountered:
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:
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 thestep.function(matches)
command you'd have the standardlet expectation = ...
andwaitForExpectations
.The text was updated successfully, but these errors were encountered: