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()
app.activate()
Wait.inApp(app, forElement: app.buttons["Categories"])
XCTAssertTrue(app.buttons["Categories"].isSelected)
let categoriesButton = app.buttons["Categories"]
Wait.inApp(app, forElement: categoriesButton)
XCTAssertTrue(categoriesButton.isSelected)
app.buttons["New"].tap()
app.buttons["Downloads"].tap()
app.buttons["Opened"].tap()
app.buttons["Categories"].tap()
categoriesButton.tap()
app.buttons["Done"].tap()
XCTAssertFalse(app.buttons["Go Back"].isEnabled)

View File

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