Swiftpack.co - pocketal/TestKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by pocketal.
pocketal/TestKit 0.0.3
UITesting framework
⭐️ 1
🕓 6 weeks ago
.package(url: "https://github.com/pocketal/TestKit.git", from: "0.0.3")

TestKit

Swift Platforms Swift Package Manager

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

Configuration :

Add the Swift Package Manager in the UI Target

dependencies: [
    .package(url: "https://github.com/pocketal/TestKit.git")
]

Import framework

import XCTest

Init tester :

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()
    }
}

GitHub

link
Stars: 1
Last commit: 14 hours ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Dependencies

Release Notes

TestKit 0.0.3
6 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics