includedInTestPlan function
Whether a test identified by id, selector, or tags is included in plan.
Implementation
bool includedInTestPlan(
TestPlanV1 plan, {
String? id,
String? fullName,
String? nativeSelector,
Iterable<String>? tags,
}) {
final effectiveId = id ?? _extractAllureIdFromTags(tags);
for (final entry in plan.tests) {
final idMatched = effectiveId != null &&
entry.id != null &&
entry.id.toString() == effectiveId;
final selectorMatched = fullName != null &&
entry.selector != null &&
entry.selector == fullName;
final nativeSelectorMatched = nativeSelector != null &&
entry.selector != null &&
entry.selector == nativeSelector;
if (idMatched || selectorMatched || nativeSelectorMatched) {
return true;
}
}
return false;
}