Swiftpack.co - rokridi/TestKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by rokridi.
rokridi/TestKit 0.0.3
UITesting framework
⭐️ 0
🕓 1 year ago
.package(url: "https://github.com/rokridi/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: 0
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

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