Every developer hates writing UITests. Me too. We wanted to make writing UI tests more fun. That's why we create Test Kit.
With Test Kit you can test all your UI Elements by using helper functions.
Requirements : All test elements must be identified by an accessibility identifier
dependencies: [
.package(url: "https://github.com/pocketal/TestKit.git")
]
import XCTest
tester: LBCUIElementProvider = LBCUITester(context: self.app)
Exemple :
import XCTest
import TestKit
class UITestClass: XCTestCase {
public private(set) var tester: LBCUIElementProvider!
public private(set) var app: XCUIApplication!
override func setUp() {
self.app = XCUIApplication()
self.app.launch()
// init tester
self.tester = LBCUITester(context: self.app)
}
func testButton() {
// get button
self.tester.getButton(with: "buttonIdentifier")
// validate title
.validate(value: "C")
// check state
.validate(isEnabled: true)
// tap action
.tap()
}
}
link |
Stars: 0 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics