@@ -338,6 +338,46 @@ def tags(class_name)
338
338
end
339
339
end
340
340
341
+ # Returns all visible elements matching class_names and value
342
+ # This method calls find_element/s and element.value/text many times.
343
+ # So, if you set many class_names, this method's performance become worse.
344
+ #
345
+ # @param class_names [Array[String]] the class_names to search for
346
+ # @param value [String] the value to search for
347
+ # @return [Array[Element]]
348
+ def tags_include ( class_names :, value : nil )
349
+ return unless class_names . is_a? Array
350
+
351
+ class_names . flat_map do |class_name |
352
+ if automation_name_is_xcuitest?
353
+ visible_elements = tags ( class_name )
354
+ value ? elements_include ( visible_elements , value ) : visible_elements
355
+ else
356
+ value ? eles_by_json_visible_contains ( class_name , value ) : tags ( class_name )
357
+ end
358
+ end
359
+ end
360
+
361
+ # Returns all visible elements matching class_names and value.
362
+ # This method calls find_element/s and element.value/text many times.
363
+ # So, if you set many class_names, this method's performance become worse.
364
+ #
365
+ # @param class_names [Array[String]] the class_names to search for
366
+ # @param value [String] the value to search for
367
+ # @return [Array[Element]]
368
+ def tags_exact ( class_names :, value : nil )
369
+ return unless class_names . is_a? Array
370
+
371
+ class_names . flat_map do |class_name |
372
+ if automation_name_is_xcuitest?
373
+ visible_elements = tags ( class_name )
374
+ value ? elements_exact ( visible_elements , value ) : visible_elements
375
+ else
376
+ value ? eles_by_json_visible_exact ( class_name , value ) : tags ( class_name )
377
+ end
378
+ end
379
+ end
380
+
341
381
# @private
342
382
# Returns an object that matches the first element that contains value
343
383
#
0 commit comments