@@ -17,7 +17,12 @@ import com.amplifyframework.core.Action
17
17
import com.amplifyframework.core.Amplify
18
18
import com.amplifyframework.core.Consumer
19
19
import com.amplifyframework.predictions.aws.AWSPredictionsPlugin
20
+ import com.amplifyframework.predictions.aws.models.ColorChallenge
21
+ import com.amplifyframework.predictions.aws.models.ColorChallengeType
22
+ import com.amplifyframework.predictions.aws.models.ColorDisplayInformation
20
23
import com.amplifyframework.predictions.aws.models.FaceTargetChallenge
24
+ import com.amplifyframework.predictions.aws.models.FaceTargetMatchingParameters
25
+ import com.amplifyframework.predictions.aws.models.RgbColor
21
26
import com.amplifyframework.predictions.models.FaceLivenessSession
22
27
import com.amplifyframework.predictions.models.FaceLivenessSessionInformation
23
28
import com.amplifyframework.predictions.options.FaceLivenessSessionOptions
@@ -291,8 +296,43 @@ class LivenessFlowInstrumentationTest {
291
296
}
292
297
293
298
@OptIn(InternalAmplifyApi ::class )
294
- val faceTargetChallenge = FaceTargetChallenge ()
295
- onSessionStarted.captured.accept(FaceLivenessSession (listOf (FaceTargetChallenge , ColorChallenge )))
299
+ val faceTargetChallenge = FaceTargetChallenge (
300
+ 422f , 683f , 230f , 292f ,
301
+ FaceTargetMatchingParameters (
302
+ 0.7f ,
303
+ 0.25f ,
304
+ 0.25f ,
305
+ 0.15f ,
306
+ 0.15f
307
+ )
308
+ )
309
+ val colorChallenge = ColorChallenge (
310
+ " id" ,
311
+ ColorChallengeType .SEQUENTIAL ,
312
+ listOf (
313
+ ColorDisplayInformation (RgbColor (0 ,0 ,0 ), 75f , false ),
314
+ ColorDisplayInformation (RgbColor (0 ,255 ,255 ), 475f , false ),
315
+ ColorDisplayInformation (RgbColor (255 ,0 ,0 ), 475f , false ),
316
+ ColorDisplayInformation (RgbColor (0 ,255 ,0 ), 475f , false ),
317
+ ColorDisplayInformation (RgbColor (0 ,0 ,255 ), 475f , false ),
318
+ ColorDisplayInformation (RgbColor (255 ,255 ,0 ), 475f , false ),
319
+ ColorDisplayInformation (RgbColor (0 ,255 ,0 ), 475f , false ),
320
+ ColorDisplayInformation (RgbColor (255 ,0 ,0 ), 475f , false ),
321
+ )
322
+ )
323
+ onSessionStarted.captured.accept(
324
+ FaceLivenessSession (
325
+ listOf (faceTargetChallenge, colorChallenge),
326
+ {}, // onVideoEvent
327
+ {}, // onChallengeResponseEvent
328
+ {} // stopLivenessSession
329
+ )
330
+ )
331
+
332
+ composeTestRule.waitUntil(5000 ) {
333
+ composeTestRule.onAllNodesWithText(" asdlkfjasdf" )
334
+ .fetchSemanticsNodes().size == 1
335
+ }
296
336
297
337
composeTestRule.waitForIdle()
298
338
0 commit comments