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
In the current implementation of ViewControllerTestCase, the VM of the view must be set in the configure(vc:testCase:) method.
The method is called only after the isViewReady(view:identifier:) returns true, and after that the snapshot is immediately taken.
Problem
In case a UITest needs it, there is no way for the test to wait for some condition after that the configure method is called.
Possible Solution
Call the configure(vc:testCase:) method at the beginning of the test case, and then wait for isViewReady(view:identifier:) to return true to actually take the snapshot.
This requires some refactoring of the ViewControllerTestCase:
at the moment all the test cases are run together as asynchronous tasks on the main thread
each task checks if the view is ready:
if it is ready, it invokes the configure method and takes the screenshot in stack
if not, it reschedules itself on the main thread
In case we want to configure the test case and then wait for it, we cannot schedule all the test cases together, otherwise they will conflict with each other trying to configure the view.
Instead we should execute the test case sequentially so that only one test case is in progress at any single moment and it can leave the main thread and wait until the view is ready to take the snapshot
The text was updated successfully, but these errors were encountered:
hey! it would really help me if you can describe an example of which kind of condition you want to test or in general the use case you want to unlock with this. thanks! :raisedhands:
Current Implementation
In the current implementation of
ViewControllerTestCase
, the VM of the view must be set in theconfigure(vc:testCase:)
method.The method is called only after the
isViewReady(view:identifier:)
returnstrue
, and after that the snapshot is immediately taken.Problem
In case a UITest needs it, there is no way for the test to wait for some condition after that the configure method is called.
Possible Solution
Call the
configure(vc:testCase:)
method at the beginning of the test case, and then wait forisViewReady(view:identifier:)
to returntrue
to actually take the snapshot.This requires some refactoring of the
ViewControllerTestCase
:In case we want to configure the test case and then wait for it, we cannot schedule all the test cases together, otherwise they will conflict with each other trying to configure the view.
Instead we should execute the test case sequentially so that only one test case is in progress at any single moment and it can leave the main thread and wait until the view is ready to take the snapshot
The text was updated successfully, but these errors were encountered: