# HG changeset patch # User Dennis Concepción Martín # Date 1628012912 -3600 # Node ID 1d661f15adabc04e89a6117b3dba545e67eaa7d2 # Parent 187d04e01cba3b8cb517833cd2e3cde4ad6a480c Fixes UI Testing bugs on iPad diff -r 187d04e01cba -r 1d661f15adab Simoleon.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate Binary file Simoleon.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed diff -r 187d04e01cba -r 1d661f15adab Simoleon/Helpers/Sidebar.swift --- a/Simoleon/Helpers/Sidebar.swift Tue Aug 03 18:48:16 2021 +0100 +++ b/Simoleon/Helpers/Sidebar.swift Tue Aug 03 18:48:32 2021 +0100 @@ -20,6 +20,7 @@ NavigationLink(destination: Favorites()) { Label("Favorites", systemImage: "star") } + .accessibility(identifier: "Favorites") NavigationLink(destination: Settings()) { Label("Settings", systemImage: "gear") diff -r 187d04e01cba -r 1d661f15adab SimoleonUITests/SimoleonUITests.swift --- a/SimoleonUITests/SimoleonUITests.swift Tue Aug 03 18:48:16 2021 +0100 +++ b/SimoleonUITests/SimoleonUITests.swift Tue Aug 03 18:48:32 2021 +0100 @@ -11,7 +11,10 @@ override func setUpWithError() throws { // Put setup code here. This method is called before the invocation of each test method in the class. - +// if UIDevice.current.userInterfaceIdiom == .pad { +// XCUIDevice.shared.orientation = .landscapeRight +// sleep(2) +// } // In UI tests it is usually best to stop immediately when a failure occurs. continueAfterFailure = false @@ -68,7 +71,13 @@ app.launch() // Go to favorites - app.tabBars.buttons.element(boundBy: 1).tap() + if UIDevice.current.userInterfaceIdiom == .pad { + app.navigationBars.buttons.element(boundBy: 0).tap() + app.buttons["Favorites"].tap() + } else { + app.tabBars.buttons.element(boundBy: 1).tap() + } + snapshot("4-Favorites") }