-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Improve accessibility for UI testing
- Loading branch information
Showing
9 changed files
with
92 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
PyeonHaeng-iOS/Sources/Extensions/View+accessibilityIdentifier.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// View+accessibilityIdentifier.swift | ||
// PyeonHaeng-iOS | ||
// | ||
// Created by 홍승현 on 6/21/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public extension View { | ||
/// Uses the AccessibilityIdentifier you specify to identify the view. | ||
/// | ||
/// Use this value for testing. It isn't visible to the user. | ||
func accessibilityIdentifier(_ identifier: AccessibilityIdentifier) -> ModifiedContent<Self, AccessibilityAttachmentModifier> { | ||
accessibilityIdentifier(identifier.stringValue) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
PyeonHaeng-iOSUITests/Utils/Subscript+AccessibilityIdentifier.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// Subscript+AccessibilityIdentifier.swift | ||
// PyeonHaeng-iOSUITests | ||
// | ||
// Created by 홍승현 on 6/21/24. | ||
// | ||
|
||
import XCTest | ||
|
||
extension XCUIElementQuery { | ||
subscript(_ identifier: AccessibilityIdentifier) -> XCUIElement { | ||
self[identifier.stringValue] | ||
} | ||
} |