diff --git a/AutoCat2/Components/PlateView/PlateView.swift b/AutoCat2/Components/PlateView/PlateView.swift index 6351f73..c645741 100644 --- a/AutoCat2/Components/PlateView/PlateView.swift +++ b/AutoCat2/Components/PlateView/PlateView.swift @@ -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 { diff --git a/AutoCat2UITests/AutoCat2UITests.swift b/AutoCat2UITests/AutoCat2UITests.swift index 663f669..6a08780 100644 --- a/AutoCat2UITests/AutoCat2UITests.swift +++ b/AutoCat2UITests/AutoCat2UITests.swift @@ -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") } } diff --git a/AutoCatCore/Services/StorageService.swift b/AutoCatCore/Services/StorageService.swift index 1b44328..8dae7df 100644 --- a/AutoCatCore/Services/StorageService.swift +++ b/AutoCatCore/Services/StorageService.swift @@ -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