@@ -17,7 +17,12 @@ import com.amplifyframework.core.Action
1717import com.amplifyframework.core.Amplify
1818import com.amplifyframework.core.Consumer
1919import 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
2023import com.amplifyframework.predictions.aws.models.FaceTargetChallenge
24+ import com.amplifyframework.predictions.aws.models.FaceTargetMatchingParameters
25+ import com.amplifyframework.predictions.aws.models.RgbColor
2126import com.amplifyframework.predictions.models.FaceLivenessSession
2227import com.amplifyframework.predictions.models.FaceLivenessSessionInformation
2328import com.amplifyframework.predictions.options.FaceLivenessSessionOptions
@@ -291,8 +296,43 @@ class LivenessFlowInstrumentationTest {
291296 }
292297
293298 @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+ }
296336
297337 composeTestRule.waitForIdle()
298338
0 commit comments