Comments (6)
This is working as intended. The default SwiftUI project doesn't have any accessibility issues, so the tests pass. If you want to verify GTXiLib can catch issues, add
Circle().accessibilityElement()
to your VStack
. This will create a circle and make it an accessibility element. However, without any other accessibility information — such as an accessibility label — GTXiLib will mark it as a failure. If you added that line to your app, ran the app on a physical device, and turned on VoiceOver, you would be able to focus on the circle with VoiceOver, but it would not announce anything — an accessibility issue.
Try testing it with ContentView
like:
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Hello, world!")
Circle().accessibilityElement()
}
.padding()
from gtxilib.
Ah, try renaming override func setUpWithError() throws
to override class func setUp()
. Note the class
keyword. setUpWithError
is an instance method that runs after the test suite has initialized but before each individual test case. Hence, GTXTestSuite
can't install itself, because the original test suite has already been installed. Moving that code to the class version of setUp
, which runs once per test suite before the test suite runs, lets GTXiLib install itself properly.
from gtxilib.
I believe the 5.1.2 release of GTXiLib fixes the issue. It removes the C++ imports from the umbrella header, which broke Swift compatibility. Please try updating your Pods and building again. You may need to run pod cache clean --all
or pod repo update
to refresh the list of versions so CocoaPods uses the 5.1.2 release.
from gtxilib.
thank you @CooperCorona - adding the version worked fine.
one question though - when i try to run this test https://github.com/parikhparth23/gtxilib_a11y/blob/main/a11yTests/a11yTests.swift i dont see any Accessibility error
from gtxilib.
i added the Circle().accessibilityElement()
to the VSTACK
- https://github.com/parikhparth23/gtxilib_a11y/blob/main/a11y/ContentView.swift#L18
when i run on a physical device with the voiceover
ON - it does not announce anything - what you suggested
But when i run the test - https://github.com/parikhparth23/gtxilib_a11y/blob/main/a11yTests/a11yTests.swift - GTXiLib is not marking it as a failure
from gtxilib.
awesome, thank you so much - its working as expected. closing this as resolved.
@CooperCorona do you mind adding more details on how to use it in the Readme.md
- so its easy for others to use this awesome lib/framework? Please feel free to use the sample app/repo which i created.
will wait for your response / will close this issue at EOD today.
from gtxilib.
Related Issues (18)
- Utility or method to get rule list covered in GTXiLib
- Not getting accessibility errors in unit test HOT 11
- GTXiLib does not catch errors on XCUITests HOT 16
- Example App
- How to find reported element when there is no accessibility Id in GTXiLib report? HOT 7
- Must be part of view hierarchy to use this method, see API docs for more info, GTXiLib contrastRatioOfUILabel check! HOT 2
- Earl Grey 2.0 unable to detect the Accessibility Issues
- EarlGrey 2 support HOT 1
- 'google/protobuf/port_def.inc' file not found HOT 3
- Latest Release 4.5.0 is not on Cocoapods yet
- Provide an XCFramework for GTXiLib
- No Longer Compiles With 5.0.0 - 'string' file not found
- Does the Project support XCUI tests?
- H
- Add support for Carthage
- Tappable area check not using Apple's recommendation
- Support configurations of global check constants HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtxilib.