Latest 0.0.4
Homepage https://github.com/rwbutler/Skylark
License MIT
Platforms ios 9.3
Frameworks XCTest
Authors

Skylark

CI Status
Version
Carthage compatible
License
Platform

Features

  • [x] Execute feature files containing scenarios written using Gherkin
  • [x] Scenario outlines with examples
  • [x] Tag expressions
  • [x] Retry failed scenarios

Advantages

  • [x] Easy set up – just add Skylark.framework to your UI testing target in Xcode.
  • [x] No context switching between different languages – write all your test code in Swift.
  • [x] The –retry flag allows tests to be retried a number of times so that a flaky test will not cause the build to be marked as a failure in your CI process (so long as it succeeds the majority of the time) however the test will be marked as flaky.
  • [x] Many common steps in your scenarios will work out of the box such as checking a particular screen or element has been displayed.

Usage

To get started import the Skylark and XCTest frameworks into your UI testing target, create an XCTestCase subclass as usual and instantiate an instance of the test runner. Ensure that your feature file has been added to your UI test bundle with the file extension .feature then invoke test(featureFile:) to run your scenarios.

import Foundation
import Skylark
import XCTest

class MyUITests: XCTestCase {
    // Obtain test runner instance
    lazy var testRunner = Skylark.testRunner(testCase: self)

    // Run scenarios from feature file
    func testFromFeatureFile() {
        testRunner.test(featureFile: "Main")
    }

}

Skylark endeavors to limit the amount of additional Swift code you need to write on top of your feature files to get your tests to run. To this end, most existence checks (checking whether an element is displayed onscreen) and interaction checks e.g. tapping buttons will work out of the box. To take advantage of this functionality, simply create a JSON file with the file extension .screen describing the elements on a screen e.g.

{
    "name": "Main",
    "buttons": {
        "Test": "test-button"
    }
}

In the above the keys are the names of the elements as you would refer to them in your feature files and the values are the accessibility identifiers assigned to your UIKit elements (label text may be used where no accessibility identifier has been assigned).

For steps that require a little more work to set up the test runner provides a number of methods for registering steps to be executed. Using these you can provide the Swift code to be executed when a given step is encountered.

Installation

Cocoapods

CocoaPods is a dependency manager which integrates dependencies into your Xcode workspace. To install it using RubyGems run:

gem install cocoapods

To install Skylark using Cocoapods, simply add the following line to your Podfile:

pod "Skylark"

Then run the command:

pod install

For more information see here.

Carthage

Carthage is a dependency manager which produces a binary for manual integration into your project. It can be installed via Homebrew using the commands:

brew update
brew install carthage

In order to integrate Skylark into your project via Carthage, add the following line to your project’s Cartfile:

github "rwbutler/Skylark"

From the macOS Terminal run carthage update --platform iOS to build the framework then drag Skylark.framework into your Xcode project.

For more information see here.

Author

Ross Butler

License

Skylark is available under the MIT license. See the LICENSE file for more info.

Additional Software

Frameworks

  • Connectivity – Improves on Reachability for determining Internet connectivity in your iOS application.
  • Skylark – Fully Swift BDD testing framework for writing Cucumber scenarios using Gherkin syntax.
  • TailorSwift – A collection of useful Swift Core Library / Foundation framework extensions.
  • TypographyKit – Consistent & accessible visual styling on iOS with Dynamic Type support.

Tools

Connectivity Skylark TypographyKit Palette
Connectivity Skylark TypographyKit Palette

Latest podspec

{
    "name": "Skylark",
    "version": "0.0.4",
    "summary": "Pure Swift BDD testing framework for writing Cucumber scenarios using Gherkin syntax",
    "swift_version": "4.2",
    "description": "Implementation of Cucumber written in pure Swift using XCTest. Allows the execution of feature files containing scenarios written in Gherkin syntax.",
    "homepage": "https://github.com/rwbutler/Skylark",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Ross Butler": "[email protected]"
    },
    "source": {
        "git": "https://github.com/rwbutler/Skylark.git",
        "tag": "0.0.4"
    },
    "platforms": {
        "ios": "9.3"
    },
    "frameworks": "XCTest",
    "source_files": "Skylark/Classes/**/*.swift"
}

Pin It on Pinterest

Share This