All Projects → fromkk → Lunch

fromkk / Lunch

Licence: MIT license
Lunch is helper of UI Test with Swift.

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Lunch

catbird
Mock server for UI tests
Stars: ✭ 32 (-41.82%)
Mutual labels:  ui-testing, ui-tests
Quiz App
A repository reflecting the progress made on the "How to Build iOS Apps with Swift, TDD & Clean Architecture" YouTube series, by Caio & Mike.
Stars: ✭ 230 (+318.18%)
Mutual labels:  ui-testing
Nightwatch Boilerplate
boilerplate for nightwatch.js with selenium
Stars: ✭ 16 (-70.91%)
Mutual labels:  ui-testing
Dagger2
Kotlin Dagger2 example project
Stars: ✭ 145 (+163.64%)
Mutual labels:  ui-testing
Scrutiny
Randomly test state machines (such as your UI) by randomly navigating through transitions
Stars: ✭ 46 (-16.36%)
Mutual labels:  ui-testing
Happo.io
Happo is a cross-browser screenshot testing service
Stars: ✭ 154 (+180%)
Mutual labels:  ui-testing
Youku Sdk Tool Woodpecker
In-app-debug tool for iOS
Stars: ✭ 600 (+990.91%)
Mutual labels:  ui-testing
scenarioo
Scenarioo Docu Viewer for Automated Documentation using UI/E2E-Tests
Stars: ✭ 62 (+12.73%)
Mutual labels:  ui-testing
Green Coffee
Android library that allows you to run your acceptance tests written in Gherkin in your Android instrumentation tests.
Stars: ✭ 219 (+298.18%)
Mutual labels:  ui-testing
Sakuli
Sakuli is an end-2-end testing and monitoring tool for web sites and common UIs with multiple monitoring integrations
Stars: ✭ 115 (+109.09%)
Mutual labels:  ui-testing
Katasuperheroeskotlin
Super Heroes Kata for Android Developers in Kotlin. The main goal is to practice UI Testing.
Stars: ✭ 77 (+40%)
Mutual labels:  ui-testing
Uitestingexample
Example code from my blog post about UI testing
Stars: ✭ 57 (+3.64%)
Mutual labels:  ui-testing
Ui Testing Cheat Sheet
How do I test this with UI Testing?
Stars: ✭ 2,039 (+3607.27%)
Mutual labels:  ui-testing
Selenium Toys
Selenium Toys
Stars: ✭ 14 (-74.55%)
Mutual labels:  ui-testing
xappium.uitest
Xappium.UITest is a UITest helper framework built on top of Appium. This aims at making it easier to write and run UI Tests.
Stars: ✭ 60 (+9.09%)
Mutual labels:  ui-testing
Ui Testing Best Practices
The largest UI testing best practices list (last update: January 2021)
Stars: ✭ 783 (+1323.64%)
Mutual labels:  ui-testing
Device Automator
An easy to use, Espresso like, syntax on top of the Android UI Automator testing framework
Stars: ✭ 63 (+14.55%)
Mutual labels:  ui-testing
Bookstore Ios
 Sample iOS App - A collection of examples and patterns for Unit Testing, UI Testing, handling Result/Optionals, writing documentation, and more. Details in README.
Stars: ✭ 147 (+167.27%)
Mutual labels:  ui-testing
ios-ui-automation-overview
An overview of popular iOS UI testing solutions.
Stars: ✭ 23 (-58.18%)
Mutual labels:  ui-testing
Cookbook
android-ui-testing.github.io/Cookbook/home/
Stars: ✭ 273 (+396.36%)
Mutual labels:  ui-testing

Build Status

Lunch

Lunch is helper of UI Test with Swift.

Requirements

  • Swift 4.0 or later
  • iOS 9 or later

Installation

Carthage

  • Insert github "fromkk/Lunch" to your Cartfile .
  • Run carthage update
  • Link your app with Lunch.framework in Carthage/Build
  • Link your UI test target with LunchTest.framework in Carthage/Build

Usage

In App target adopt protocol Creatable.

import Lunch

struct Creator: Creatable {
    func create<T>(_ identifier: String, userInfo: [AnyHashable : Any]?) -> T? {
        switch identifier {
        case "LunchViewController":
            return self.lunchViewController() as? T
        default:
            return nil
        }
    }
}

extension Creatable {
    func lunchViewController() -> LunchViewController {
        let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
        return storyboard.instantiateInitialViewController() as! LunchViewController
    }
}
// AppDelegate.swift
import Lunch

let creator = Creator()
let rootViewController: UIViewController
#if DEBUG
if let viewController: UIViewController = Launcher(with: creator).launch() {
    rootViewController = viewController
} else {
    rootViewController = creator.lunchViewController()
}
#else
rootViewController = creator.lunchViewController()
#endif
window?.rootViewController = rootViewController

NOTE: If you want change rootViewController after Run Xcode, set LAUNCH_VIEW_CONTROLLER key and viewController name to value in Environment Variables of your scheme.

In UI Test target.

1 Add component and adopt protocol PageObjectsRepresentable.

import XCTest
import LunchTest

struct LunchViewControllerPage: PageObjectsRepresentable {
    var app: XCUIApplication
    init(app: XCUIApplication) {
        self.app = app
    }

    var lunchLabel: XCUIElement {
        return self.app.staticTexts["lunchLabel"]
    }
}

2 Add your tests and adopt protocol ViewControllerTestable

import XCTest
import LunchTest

class LunchViewControllerTests: XCTestCase, ViewControllerTestable {

    var viewControllerName: String {
        return "LunchViewController"
    }

    override func setUp() {
        super.setUp()

        continueAfterFailure = false
    }

    func testLunchLabel() {
        let launcher = Launcher(targetViewController: self)
        let app = launcher.launch()

        let page = LunchViewControllerPage(app: app)
        XCTAssertTrue(page.lunchLabel.exists)
        XCTAssertEqual(page.lunchLabel.label, "Lunch")
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].