Fixed UI test problems introduced after the accessibility identifier … (#586)

* Fixed UI test problems introduced after the accessibility identifier changes
* Disable parallel UITests, they don't seem to work properly
* Fix UITests `elementFallbackLanguage`
This commit is contained in:
Stefan Ceriu
2023-02-16 12:42:50 +02:00
committed by GitHub
parent e91e0513b6
commit f44075e67e
6 changed files with 20 additions and 8 deletions
+3
View File
@@ -24,7 +24,10 @@ struct Application {
"IS_RUNNING_UI_TESTS": "1",
"UI_TESTS_SCREEN": identifier.rawValue
]
// Use the same fallback language as the real app so translation comparison works
Bundle.elementFallbackLanguage = "en"
app.launch()
return app
}
@@ -21,14 +21,16 @@ class RoomDetailsScreenUITests: XCTestCase {
func testInitialStateComponents() {
let app = Application.launch(.roomDetailsScreen)
XCTAssert(app.staticTexts[A11yIdentifiers.roomScreen.avatar].exists)
XCTAssert(app.staticTexts[A11yIdentifiers.roomDetailsScreen.avatar].exists)
XCTAssert(app.buttons[A11yIdentifiers.roomDetailsScreen.people].waitForExistence(timeout: 1))
app.assertScreenshot(.roomDetailsScreen)
}
func testInitialStateComponentsWithRoomAvatar() {
let app = Application.launch(.roomDetailsScreenWithRoomAvatar)
XCTAssert(app.images[A11yIdentifiers.roomScreen.avatar].waitForExistence(timeout: 1))
XCTAssert(app.images[A11yIdentifiers.roomDetailsScreen.avatar].waitForExistence(timeout: 1))
XCTAssert(app.buttons[A11yIdentifiers.roomDetailsScreen.people].waitForExistence(timeout: 1))
app.assertScreenshot(.roomDetailsScreenWithRoomAvatar)
}
}