Merge pull request #22 from ngergo100/development 0.0.2
Merge pull request #22 from ngergo100/development
0.0.2
Accessible is tool which makes your UITesting experience way better on iOS.
Accessible parses your .storyboard files and generates accessibilityIdentifiers for every IBOutlet connection.
.storyboard
IBOutlet
enum Accessible { struct Storyboard { struct Screen { static let rootView = "Accessible.Storyboard.Screen.rootView" struct UIElementTpye { static let aView = "Accessible.Storyboard.Screen.UIElementTpye.aView" } ... } ... } ... }
UITestableExtensions.swift makes setting the previously generated id-s for every UIElement easy. If you provide UITestableExtensions.swift path then Accessible will also generate a Swift file like below.
protocol UITestable { func setAccessibilityIdentifiers() } extension ScreenViewController: UITestable { func setAccessibilityIdentifiers() { view.accessibilityIdentifier = Accessible.Storyboard.Screen.rootView aView.accessibilityIdentifier = Accessible.Storyboard.Screen.UIElementTpye.aView ... } } ...
You should call setAccessibilityIdentifiers() in the viewDidLoad() method of the UIViewController instance.
setAccessibilityIdentifiers()
viewDidLoad()
UITapMans.swift makes writing XCTestCase files way more fun then previously.
class ScreenUITests: XCTestCase { var tapMan: ScreenTapMan! override func setUp() { super.setUp() continueAfterFailure = false tapMan = OnboardingTapMan().start() } func testCaseA() { tapMan .aView.isHittable() .aView.tap() } }
Download the latest released binary.
Make it executable with chmod +x accessible. (If you have a .dms extension then remove it first)
chmod +x accessible
Copy it to /usr/local/bin/.
/usr/local/bin/
Create a .accessible.yml configuration file in your project’s root directory (next to your project file). ```yaml
.accessible.yml
inputs:
Uncomment enumName if you would like to provide the Accessibiliy Identifiers enum’s name.
enumName
Uncomment testableExtensionsPath if you would like Accessible to generate UITestableExtensions.swift file for you.
testableExtensionsPath
Uncomment tapMansPath if you would like Accessible to generate UITapMans.swift file for you.
tapMansPath
accessible
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Accessible
Accessible is tool which makes your UITesting experience way better on iOS.
Table of Contents
Intro
Accessible parses your
.storyboard
files and generates accessibilityIdentifiers for everyIBOutlet
connection.UITestableExtensions.swift makes setting the previously generated id-s for every UIElement easy. If you provide UITestableExtensions.swift path then Accessible will also generate a Swift file like below.
You should call
setAccessibilityIdentifiers()
in theviewDidLoad()
method of the UIViewController instance.UITapMans.swift makes writing XCTestCase files way more fun then previously.
Usage
Download the latest released binary.
Make it executable with
chmod +x accessible
. (If you have a .dms extension then remove it first)Copy it to
/usr/local/bin/
.Create a
.accessible.yml
configuration file in your project’s root directory (next to your project file). ```yamlenumName: Accessible
inputs:
testableExtensionsPath: Directory/Of/Generated/Files
tapMansPath: Directory/Of/Generated/Files
```Uncomment
enumName
if you would like to provide the Accessibiliy Identifiers enum’s name.Uncomment
testableExtensionsPath
if you would like Accessible to generate UITestableExtensions.swift file for you.Uncomment
tapMansPath
if you would like Accessible to generate UITapMans.swift file for you.accessible
in the root directory of your project or set up a new run script build phase in your Xcode project file.