Fix for UI test

This commit is contained in:
Selim Mustafaev 2022-04-07 01:18:42 +03:00
parent a0b7c0f052
commit 1b952af498
3 changed files with 7 additions and 4 deletions

View File

@ -73,6 +73,8 @@ class PlateView: UIView {
self.flagLayer.contentsScale = UIScreen.main.scale
self.layer.addSublayer(self.flagLayer)
self.isAccessibilityElement = true
}
private func pathForFlag(in rect: CGRect) -> CGPath {

View File

@ -31,10 +31,11 @@ class AutoCat2UITests: XCTestCase {
app.auth(login: testLogin, password: testPassword)
app.enterPlateNumber("Н282СН61")
XCTAssert(app.tables["historyTable"].waitForExistence(timeout: 3), "History tableView not found")
let tableViewExists = app.tables["historyTable"].waitForExistence(timeout: 3)
XCTAssert(tableViewExists, "History tableView not found")
let firstCell = app.cells.firstMatch
let plateView = firstCell.otherElements["plateView"].firstMatch
print(plateView)
let plateView = firstCell.descendants(matching: .other)["plateView"]
XCTAssert(plateView.label == "Н282СН61", "Plate number don't mach")
}
}

View File

@ -18,7 +18,7 @@ public class StorageService: StorageServiceProtocol {
if let instance = StorageService.instance {
return instance
} else {
let service = StorageService()
let service = StorageService(inMemory: Testing.isUITesting)
try await service.loadPersistentStores()
StorageService.instance = service
return service