Accessibiliy Tests part 2 (#4325)
* running all the tests * setting up CI * fixed the workflow * workflow on pull request, just to make it appear * removed the test to run var * fix archived tests name * improved the tests, by filtering out some noise * pr suggestions and added an improvement to the filtering * improved the interrupt handler * improved the UI interruption monitor handler * some more refinement to handle the interruptor + false positive for non human readable labels * reverted wrong commit * ready for review, removed the on pull request check * pr suggestions
This commit is contained in:
31
Tools/Sourcery/AccessibilityTests.stencil
Normal file
31
Tools/Sourcery/AccessibilityTests.stencil
Normal file
@@ -0,0 +1,31 @@
|
||||
// swiftlint:disable all
|
||||
// swiftformat:disable all
|
||||
|
||||
{% if argument.mainTarget %}
|
||||
@testable import {{ argument.mainTarget }}
|
||||
{% endif %}
|
||||
{% for import in argument.imports %}
|
||||
{% if import != "last" %}
|
||||
import {{ import }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% for import in argument.testableImports %}
|
||||
{% if import != "last" %}
|
||||
@testable import {{ import }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
extension AccessibilityTests {
|
||||
|
||||
{% for type in types.types where (type.implements.TestablePreview or type.based.TestablePreview or type|annotated:"TestablePreview") and type.name != "TestablePreview" %}
|
||||
func test{{ type.name|replace:"_Previews", "" }}() async throws {
|
||||
try await performAccessibilityAudit(named: "{{ type.name }}")
|
||||
}
|
||||
{%- if not forloop.last %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
// swiftlint:enable all
|
||||
// swiftformat:enable all
|
||||
7
Tools/Sourcery/AccessibilityTests.yml
Normal file
7
Tools/Sourcery/AccessibilityTests.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
sources:
|
||||
include:
|
||||
- ../../ElementX
|
||||
templates:
|
||||
- AccessibilityTests.stencil
|
||||
output:
|
||||
../../AccessibilityTests/Sources/GeneratedAccessibilityTests.swift
|
||||
Reference in New Issue
Block a user