mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-22 11:03:21 -04:00
Add UITests target
This commit is contained in:
parent
4028ea1269
commit
43ed5d7841
47
UITests/LoadingUITest.swift
Normal file
47
UITests/LoadingUITest.swift
Normal file
@ -0,0 +1,47 @@
|
||||
// This file is part of Kiwix for iOS & macOS.
|
||||
//
|
||||
// Kiwix is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 3 of the License, or
|
||||
// any later version.
|
||||
//
|
||||
// Kiwix is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Kiwix; If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
import XCTest
|
||||
|
||||
final class LoadingUITest: XCTestCase {
|
||||
|
||||
override func setUpWithError() throws {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
|
||||
// In UI tests it is usually best to stop immediately when a failure occurs.
|
||||
continueAfterFailure = false
|
||||
|
||||
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
|
||||
}
|
||||
|
||||
override func tearDownWithError() throws {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
func testExample() throws {
|
||||
// UI tests must launch the application that they test.
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
}
|
||||
|
||||
func testLaunchPerformance() throws {
|
||||
// This measures how long it takes to launch your application.
|
||||
measure(metrics: [XCTApplicationLaunchMetric()]) {
|
||||
XCUIApplication().launch()
|
||||
}
|
||||
}
|
||||
}
|
4
UITests/UITests-Bridging-Header.h
Normal file
4
UITests/UITests-Bridging-Header.h
Normal file
@ -0,0 +1,4 @@
|
||||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
35
project.yml
35
project.yml
@ -2,8 +2,8 @@ name: Kiwix
|
||||
options:
|
||||
xcodeVersion: 16.1
|
||||
deploymentTarget: # the three latest major versions should be supported
|
||||
iOS: 16.6
|
||||
macOS: 13.0
|
||||
iOS: 16.6
|
||||
macOS: 13.0
|
||||
generateEmptyDirectories: true
|
||||
useTabs: false
|
||||
groupSortPosition: top
|
||||
@ -137,6 +137,25 @@ targets:
|
||||
dependencies:
|
||||
- target: Kiwix
|
||||
|
||||
UITests:
|
||||
type: bundle.ui-testing
|
||||
supportedDestinations: [iOS, macOS]
|
||||
settings:
|
||||
PRODUCT_BUNDLE_IDENTIFIER: org.kiwix.UITests
|
||||
# TEST_HOST: $(BUILT_PRODUCTS_DIR)/Kiwix.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Kiwix
|
||||
BUNDLE_LOADER: $(TEST_HOST)
|
||||
entitlements:
|
||||
path: Support/Kiwix-unitTest.entitlements
|
||||
properties:
|
||||
com.apple.security.app-sandbox: false
|
||||
# from macOS 14, sandbox and unit test are not working together on CI
|
||||
# a pop up appears that needs user acceptance
|
||||
# see: https://developer.apple.com/documentation/security/accessing-files-from-the-macos-app-sandbox
|
||||
sources:
|
||||
- path: UITests
|
||||
dependencies:
|
||||
- target: Kiwix
|
||||
|
||||
schemes:
|
||||
Kiwix:
|
||||
build:
|
||||
@ -146,8 +165,16 @@ schemes:
|
||||
targets:
|
||||
- UnitTests
|
||||
commandLineArguments:
|
||||
testing: true
|
||||
testing: true
|
||||
gatherCoverageData: true
|
||||
coverageTargets:
|
||||
- Kiwix
|
||||
|
||||
UITests:
|
||||
build:
|
||||
targets:
|
||||
Kiwix: all
|
||||
test:
|
||||
targets:
|
||||
- UITests
|
||||
commandLineArguments:
|
||||
testing: true
|
||||
|
Loading…
x
Reference in New Issue
Block a user