Fix iPhone UI tests

This commit is contained in:
Balazs Perlaki-Horvath 2025-06-08 12:30:01 +02:00
parent 6f560ad302
commit b561aee17f
2 changed files with 25 additions and 10 deletions

View File

@ -25,14 +25,14 @@ final class LoadingUI_iPhone_Test: XCTestCase {
let app = XCUIApplication() let app = XCUIApplication()
app.activate() app.activate()
Wait.inApp(app, forElement: app.buttons["Categories"]) let categoriesButton = app.buttons["Categories"]
Wait.inApp(app, forElement: categoriesButton)
XCTAssertTrue(app.buttons["Categories"].isSelected) XCTAssertTrue(categoriesButton.isSelected)
app.buttons["New"].tap() app.buttons["New"].tap()
app.buttons["Downloads"].tap() app.buttons["Downloads"].tap()
app.buttons["Opened"].tap() app.buttons["Opened"].tap()
app.buttons["Categories"].tap() categoriesButton.tap()
app.buttons["Done"].tap() app.buttons["Done"].tap()
XCTAssertFalse(app.buttons["Go Back"].isEnabled) XCTAssertFalse(app.buttons["Go Back"].isEnabled)

View File

@ -119,7 +119,7 @@ targets:
type: bundle.unit-test type: bundle.unit-test
supportedDestinations: [iOS, macOS] supportedDestinations: [iOS, macOS]
settings: settings:
PRODUCT_BUNDLE_IDENTIFIER: org.kiwix.Tests PRODUCT_BUNDLE_IDENTIFIER: self.kiwix.Tests
TEST_HOST: $(BUILT_PRODUCTS_DIR)/Kiwix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Kiwix TEST_HOST: $(BUILT_PRODUCTS_DIR)/Kiwix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Kiwix
BUNDLE_LOADER: $(TEST_HOST) BUNDLE_LOADER: $(TEST_HOST)
entitlements: entitlements:
@ -138,7 +138,7 @@ targets:
type: bundle.ui-testing type: bundle.ui-testing
supportedDestinations: [macOS] supportedDestinations: [macOS]
settings: settings:
PRODUCT_BUNDLE_IDENTIFIER: org.kiwix.UITests PRODUCT_BUNDLE_IDENTIFIER: self.Kiwix.UITests.macOS
# TEST_HOST: $(BUILT_PRODUCTS_DIR)/Kiwix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Kiwix # TEST_HOST: $(BUILT_PRODUCTS_DIR)/Kiwix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Kiwix
BUNDLE_LOADER: $(TEST_HOST) BUNDLE_LOADER: $(TEST_HOST)
entitlements: entitlements:
@ -157,8 +157,11 @@ targets:
type: bundle.ui-testing type: bundle.ui-testing
supportedDestinations: [iOS] supportedDestinations: [iOS]
settings: settings:
PRODUCT_BUNDLE_IDENTIFIER: org.kiwix.UITests # https://developer.apple.com/documentation/xcode/build-settings-reference#Targeted-Device-Families
# TEST_HOST: $(BUILT_PRODUCTS_DIR)/Kiwix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Kiwix TARGETED_DEVICE_FAMILY: 1
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD: NO
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD: NO
PRODUCT_BUNDLE_IDENTIFIER: self.Kiwix.UITests.iPhone
BUNDLE_LOADER: $(TEST_HOST) BUNDLE_LOADER: $(TEST_HOST)
entitlements: entitlements:
path: Support/Kiwix-unitTest.entitlements path: Support/Kiwix-unitTest.entitlements
@ -172,8 +175,11 @@ targets:
type: bundle.ui-testing type: bundle.ui-testing
supportedDestinations: [iOS] supportedDestinations: [iOS]
settings: settings:
PRODUCT_BUNDLE_IDENTIFIER: org.kiwix.UITests SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD: NO
# TEST_HOST: $(BUILT_PRODUCTS_DIR)/Kiwix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Kiwix SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD: NO
# https://developer.apple.com/documentation/xcode/build-settings-reference#Targeted-Device-Families
TARGETED_DEVICE_FAMILY: 2
PRODUCT_BUNDLE_IDENTIFIER: self.Kiwix.UITests.iPad
BUNDLE_LOADER: $(TEST_HOST) BUNDLE_LOADER: $(TEST_HOST)
entitlements: entitlements:
path: Support/Kiwix-unitTest.entitlements path: Support/Kiwix-unitTest.entitlements
@ -196,6 +202,9 @@ schemes:
gatherCoverageData: true gatherCoverageData: true
coverageTargets: coverageTargets:
- Kiwix - Kiwix
preActions:
- script: xcrun simctl uninstall booted self.Kiwix
settingsTarget: Kiwix
UITests_macOS: UITests_macOS:
build: build:
targets: targets:
@ -214,6 +223,9 @@ schemes:
- UITests_iPhone - UITests_iPhone
commandLineArguments: commandLineArguments:
testing: true testing: true
preActions:
- script: xcrun simctl uninstall booted self.Kiwix
settingsTarget: Kiwix
UITests_iPad: UITests_iPad:
build: build:
targets: targets:
@ -223,3 +235,6 @@ schemes:
- UITests_iPad - UITests_iPad
commandLineArguments: commandLineArguments:
testing: true testing: true
preActions:
- script: xcrun simctl uninstall booted self.Kiwix
settingsTarget: Kiwix