File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed
AmplifyPlugins/Predictions/AWSPredictionsPluginIntegrationTests Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,33 @@ class IdentifyBasicIntegrationTests: AWSPredictionsPluginTestBase {
239
239
XCTFail ( " Unable to find image " )
240
240
return
241
241
}
242
+ // These are all the words that should be recognized on the image.
243
+ let expectedWords = [
244
+ " Personal " ,
245
+ " information " ,
246
+ " First " ,
247
+ " name " ,
248
+ " AWS " ,
249
+ " Middle " ,
250
+ " Last " ,
251
+ " Amazon " ,
252
+ " Address " ,
253
+ " 410 " ,
254
+ " Terry " ,
255
+ " Ave " ,
256
+ " N " ,
257
+ " City " ,
258
+ " or " ,
259
+ " Town " ,
260
+ " Seattle " ,
261
+ " State " ,
262
+ " Choose " ,
263
+ " a " ,
264
+ " State " ,
265
+ " Zip " ,
266
+ " code " ,
267
+ " 98109 "
268
+ ]
242
269
let completeInvoked = expectation ( description: " Completed is invoked " )
243
270
244
271
let operation = Amplify . Predictions. identify ( type: . detectText( . form) ,
@@ -252,7 +279,9 @@ class IdentifyBasicIntegrationTests: AWSPredictionsPluginTestBase {
252
279
}
253
280
XCTAssertFalse ( data. fullText. isEmpty)
254
281
XCTAssertFalse ( data. words. isEmpty)
255
- XCTAssertEqual ( data. words. count, 33 )
282
+ for word in expectedWords {
283
+ XCTAssertTrue ( data. words. contains ( where: { $0. text. contains ( word) } ) )
284
+ }
256
285
XCTAssertFalse ( data. rawLineText. isEmpty)
257
286
XCTAssertEqual ( data. rawLineText. count, 17 )
258
287
XCTAssertFalse ( data. identifiedLines. isEmpty)
You can’t perform that action at this time.
0 commit comments