Skip to content

Commit

Permalink
Add UI test to make sure web view stays accessible.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZevEisenberg committed Feb 2, 2021
1 parent 288b5e0 commit 00253f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
8 changes: 4 additions & 4 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@
CD34409725C1BF6700F85A95 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CD34409525C1BF6700F85A95 /* Main.storyboard */; };
CD34409925C1BF6900F85A95 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CD34409825C1BF6900F85A95 /* Assets.xcassets */; };
CD34409C25C1BF6900F85A95 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CD34409A25C1BF6900F85A95 /* LaunchScreen.storyboard */; };
CD3440A925C1BF9C00F85A95 /* AsyncDisplayKitUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD3440A825C1BF9C00F85A95 /* AsyncDisplayKitUITests.swift */; };
CD3440A925C1BF9C00F85A95 /* WebViewAccessibilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD3440A825C1BF9C00F85A95 /* WebViewAccessibilityTests.swift */; };
CD3440B325C1C01C00F85A95 /* AsyncDisplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B35061DA1B010EDF0018CF92 /* AsyncDisplayKit.framework */; };
CD3440B425C1C01C00F85A95 /* AsyncDisplayKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B35061DA1B010EDF0018CF92 /* AsyncDisplayKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
D933F041224AD17F00FF495E /* ASTransactionTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = D933F040224AD17F00FF495E /* ASTransactionTests.mm */; };
Expand Down Expand Up @@ -1049,7 +1049,7 @@
CD34409B25C1BF6900F85A95 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
CD34409D25C1BF6900F85A95 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CD3440A625C1BF9B00F85A95 /* AsyncDisplayKitUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AsyncDisplayKitUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
CD3440A825C1BF9C00F85A95 /* AsyncDisplayKitUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncDisplayKitUITests.swift; sourceTree = "<group>"; };
CD3440A825C1BF9C00F85A95 /* WebViewAccessibilityTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewAccessibilityTests.swift; sourceTree = "<group>"; };
CD3440AA25C1BF9C00F85A95 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D3779BCFF841AD3EB56537ED /* Pods-AsyncDisplayKitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsyncDisplayKitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests.release.xcconfig"; sourceTree = "<group>"; };
D785F6601A74327E00291744 /* ASScrollNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASScrollNode.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1919,7 +1919,7 @@
CD3440A725C1BF9C00F85A95 /* UITests */ = {
isa = PBXGroup;
children = (
CD3440A825C1BF9C00F85A95 /* AsyncDisplayKitUITests.swift */,
CD3440A825C1BF9C00F85A95 /* WebViewAccessibilityTests.swift */,
CD3440AA25C1BF9C00F85A95 /* Info.plist */,
CD34408E25C1BF6700F85A95 /* UITestsHost */,
);
Expand Down Expand Up @@ -2763,7 +2763,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CD3440A925C1BF9C00F85A95 /* AsyncDisplayKitUITests.swift in Sources */,
CD3440A925C1BF9C00F85A95 /* WebViewAccessibilityTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,12 @@ class AsyncDisplayKitUITests: XCTestCase {
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
func testWebViewAccessibility() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()

// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}

func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) {
XCUIApplication().launch()
}
}
}
XCTAssert(app.staticTexts["Texture is Awesome!"].exists)
XCTAssert(app.staticTexts["Especially when web views inside nodes are accessible."].exists)
}
}

0 comments on commit 00253f4

Please sign in to comment.