Closed ReubenTurner-esusu closed 3 months ago
Follow-up: doing the following:
void main() {
// late PatrolOrchestrator patrolOrchestrator;
// setUp(() {
// patrolOrchestrator = PatrolOrchestrator();
// });
group('login', () {
final patrolOrchestrator = PatrolOrchestrator();
patrolTest(
'Verify login works',
variant: patrolOrchestrator.userVariants,
($) async {
// Test content here
},
);
});
}
allows the tests to run, and I can see the tests succeeding. However, the following error is produced for each time the test is run:
: Starting 2 tests on SM-N986U1 - 13
:
: com.esusu.consumerapp.MainActivityTest > runDartTest[login.login_test login Verify login works (variant: Instance of 'User')][SM-N986U1 - 13] FAILED
: java.lang.RuntimeException: pl.leancode.patrol.contracts.PatrolAppServiceClientException: Invalid response 500, Internal Server Error
: at pl.leancode.patrol.PatrolJUnitRunner.runDartTest(PatrolJUnitRunner.java:140)
:
: com.esusu.consumerapp.MainActivityTest > runDartTest[login.login_test login Verify login works (variant: Instance of 'User')][SM-N986U1 - 13] FAILED
: java.lang.RuntimeException: pl.leancode.patrol.contracts.PatrolAppServiceClientException: Invalid response 500, Internal Server Error
: at pl.leancode.patrol.PatrolJUnitRunner.runDartTest(PatrolJUnitRunner.java:140)
: Tests on SM-N986U1 - 13 failed: There was 2 failure(s).
:
: > Task :app:connectedDevelopmentDebugAndroidTest FAILED
So in this version the test actually fails despite the eye-test showing it succeeding
Closing this as setUp
only runs before the test body
Hi, yes, setUp
runs once before each test in group starts. But also, it's better to usepatrolSetUp
instead of setUp
. It's supported with native automation.
Hi, yes,
setUp
runs once before each test in group starts. But also, it's better to usepatrolSetUp
instead ofsetUp
. It's supported with native automation.
Interesting, I was not aware of patrolSetUp
. I assume that also only runs before the test body?
This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.
Using variants like so works:
However, taking the variants from a
late
value initialized duringsetUp
does not work:The error given for why this doesn't work is:
This is quite odd because
patrolOrchestrator
works just fine in all of our test bodies; it is only when referencing it like in the second example above that there's a problem. UsingsetUpAll
or putting thesetUp
and test inside agroup
doesn't help.I have also tested this problem against very simple values like Strings.
late ValueVariant
s initialized insetUp
cause tests to be skipped.What is the correct way to accomplish this?