Open danielgomezrico opened 4 years ago
How can I reuse a check? or it is a try to over-engineer the tests?
Definitely a bug with the idea plugin, thanks for reporting! I guess for now, just re-use the check. Although you can re-use some parts of it:
fun verifyProgressBarShowing(view: View) {
inOrder(view) {
verify(view).setProgressVisibility(true)
verify(view).setProgressVisibility(false)
}
}
Then call verifyProgressBarShowing
in the duplicated it
s.
@raniejade got it, thanks
Moving this to 2.1.0
, as I'm planning a revisit and a big refactor to the IJ plugin.
Hi
My use case was that I have some common behaviour in all of my views in the app, so I wanted to reuse an
it
that checks for the same thing over those.Created a
Suite
extension that creates an it normally, this extension receives a builder function to avoid calling the instance in the wrong memoized context.Use it everywhere.
But when I use it in the test I get a crash from android studio and if I click the green arrow it says "Nothing here", after I clean and build, the green arrows are gone.
Dependencies
2.0.10
"org.spekframework.spek2:spek-dsl-jvm:$spek"
"org.spekframework.spek2:spek-runner-junit5:$spek"
2.0.10-Studio3.6
Extension
My view interface:
The extension:
The test that use it:
Error