@@ -32,8 +32,8 @@ When using [ViewInspector](https://github.com/nalexn/ViewInspector/) to unit tes
3232func test_incrementOnce_withBoilerplate () throws {
3333 var sut = ContentView ()
3434 let expectation = sut.on (\.viewInspectorHook ) { view in
35- try view.find (viewWithId : " increment" ).button ().tap ()
36- let count = try view.find (viewWithId : " count" ).text ().string ()
35+ try view.find (viewWithAccessibilityIdentifier : " increment" ).button ().tap ()
36+ let count = try view.find (viewWithAccessibilityIdentifier : " count" ).text ().string ()
3737 XCTAssertEqual (count, " 1" )
3838 }
3939 ViewHosting.host (view : sut)
@@ -82,8 +82,8 @@ Now our test can call `inspectChangingView(_:action:)` like this:
8282func test_incrementOnce_withTestableView () throws {
8383 var sut = ContentView ()
8484 inspectChangingView (& sut) { view in
85- try view.find (viewWithId : " increment" ).button ().tap ()
86- let count = try view.find (viewWithId : " count" ).text ().string ()
85+ try view.find (viewWithAccessibilityIdentifier : " increment" ).button ().tap ()
86+ let count = try view.find (viewWithAccessibilityIdentifier : " count" ).text ().string ()
8787 XCTAssertEqual (count, " 1" )
8888 }
8989}
@@ -108,8 +108,8 @@ func test_incrementOnce_scannable() throws {
108108 var count: String ?
109109
110110 inspectChangingView (& sut) { view in
111- try view.find (viewWithId : " increment" ).button ().tap ()
112- count = try view.find (viewWithId : " count" ).text ().string ()
111+ try view.find (viewWithAccessibilityIdentifier : " increment" ).button ().tap ()
112+ count = try view.find (viewWithAccessibilityIdentifier : " count" ).text ().string ()
113113 }
114114
115115 XCTAssertEqual (count, " 1" )
0 commit comments