Skip to content
Swift framework containing a set of helpful XCTest extensions for writing UI automation tests
Branch: master
Clone or download
dzoanb Merge pull request #17 from PGSSoft/ios-12.2-translations
Added translations for iOS 12.2
Latest commit 68fdcc9 May 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AutoMate.xcodeproj Cleanups May 12, 2019
AutoMate.xcworkspace swift 4.2 update Sep 24, 2018
AutoMate Added translations for iOS 12.2 May 14, 2019
AutoMateExample Updated AppBuddy May 12, 2019
AutoMateTests Added translations for iOS 12.2 May 14, 2019
Documentation PAI-97 Add "Application Is Running Inside a UI Test Environment" Jun 29, 2017
assets PAI-82 Added new movie Mar 15, 2017
docs Update documentation. Oct 26, 2018
fastlane Reverted iOS simulator version to 12.0 May 12, 2019
.gitignore Added documentation Apr 6, 2017
.jazzy.yaml Fixed building for Xcode 9.2. Jan 1, 2018
.ruby-version Updated dependencies May 12, 2019
.swift-version Migrated to swift 5 + resolved public modifier is redundant for insta… May 8, 2019
.swiftlint.yml Cleanups May 12, 2019
.travis.yml Reverted iOS simulator version to 12.0 May 12, 2019
AutoMate.podspec Added 1.7.0 version stub May 12, 2019
Changelog.md Updated AppBuddy May 12, 2019
Dangerfile PAI-124 Improve Jenkinsfile for GitHub Jun 26, 2017
Gemfile Cleanups May 12, 2019
Gemfile.lock Cleanups May 12, 2019
Jenkinsfile Added translations for iOS 12.2 May 14, 2019
LICENSE PAI-87 Add LICENSE, README, podspec, Travis, Jenkins and Fastlane con… Feb 24, 2017
Makefile Regenerated documentation Nov 14, 2017
README.md Cleanups May 12, 2019
Release-Checklist.md

README.md

AutoMate, made by PGS Software

AutoMateAppBuddyTemplatesModelGenie

AutoMate

AutoMate is a Swift framework containing a set of helpful XCTest extensions for writing UI automation tests. It provides strongly typed, extensible wrapper around launch arguments and environment variables, which can be used for language, locale and keyboard type configuration on the device. With the AutoMate-AppBuddy it can also disable animations in the application and manage events, reminders and contacts.

Swift 5 Travis CocoaPods Compatible Documentation Carthage Compatible Platform License

AutoMate

Installation

The most convenient way to install it is by using CocoaPods with Podfile:

pod 'AutoMate'

or using Carthage and add a line to Cartfile.private:

github "PGSSoft/AutoMate"

Cartfile.private should be used because AutoMate framework will be used by UI Tests target only not by the tested application.

Usage

Full documentation is available at https://pgssoft.github.io/AutoMate/.

  1. Create a new UI test case class.

  2. Import AutoMate framework to UI tests files:

    import AutoMate
  3. Use TestLauncher in the setup() method to configure application settings and launch the application:

    let app = XCUIApplication()
    TestLauncher(options: [
        SystemLanguages([.English, .German]),
        SystemLocale(language: .English, country: .Canada),
        SoftwareKeyboards([.EnglishCanada, .GermanGermany])
    ]).configure(app).launch()
  4. Use AutoMate's extensions in your tests. For example:

    func testSomething() {
        let app = XCUIApplication()
        let button = app.button.element
    
        // helper for waiting until element is visible
        waitForVisibleElement(button, timeout: 20)
        button.tap()
    
        // isVisible - helper to check that element both exists and is hittable
        XCTAssertFalse(button.isVisible)
    }

Features (or ToDo)

  • Set keyboards
  • Set locale
  • Set languages
  • Custom arguments
  • Custom keyboards, locales and languages
  • XCTest extensions
  • Added CoreData launch arguments
  • Disable UIView animations (with AutoMate-AppBuddy)
  • Strong-typed helpers: locators, page object templates (with AutoMate-Templates)
  • Base XCTestCase template (with AutoMate-Templates)
  • Most permissions alerts (like: LocationWhenInUseAlert, CalendarAlert, PhotosAlert) (with AutoMate-ModelGenie)
  • Managing events, reminders and contacts (with AutoMate-AppBuddy)
  • Companion library for the application (AutoMate-AppBuddy)
  • Improve launch options type safety
  • Smart coordinates
  • Check if application is running in UI test environment (with AutoMate-AppBuddy)
  • Stubbing network requests
  • Stubbing contacts, events and reminders
  • Taking screenshots
  • Clearing application data
  • Stubbing notifications

Example application

Repository contains example application under AutoMateExample directory. Structure of the application is simple, but the project contains extensive suite of UI tests to showcase capabilities of the library.

Development

Full documentation is available at https://pgssoft.github.io/AutoMate/.

If you want to provide your custom launch argument or launch environment you have to implement LaunchOption protocol or one of its extensions, such as LaunchArgumentWithSingleValue:

enum CustomParameter: String, LaunchArgumentWithSingleValue, LaunchArgumentValue {
    var key: String {
        return "AppParameter"
    }
    case value1
    case value2
}

Then, you can pass it to the TestBuilder:

let launcher = TestLauncher(options: [
    CustomParameter.value1
])

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/PGSSoft/AutoMate.

License

The project is available as open source under the terms of the MIT License.

About

The project maintained by software development agency PGS Software. See our other open-source projects or contact us to develop your product.

Follow us

Twitter URL
Twitter Follow

You can’t perform that action at this time.