• Stars
    star
    285
  • Rank 141,235 (Top 3 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Swift framework containing a set of helpful XCTest extensions for writing UI automation tests
AutoMate, made by PGS Software

AutoMate • AppBuddy • Templates • ModelGenie

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 SwiftPM Compatible Platform License

AutoMate

Installation

There are three convinient ways to install AutoMate:

  • using CocoaPods with Podfile:

     pod 'AutoMate'
  • 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.

  • using Swift Package Manager, either via Xcode or in Package.swift:

     .package(url: "https://github.com/PGSSoft/AutoMate", from: "1.8.0"),

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

More Repositories

1

scrollscreenshot

Make Android screenshots of scrollable screen content
Java
718
star
2

3DSnakeAR

Well known game Snake written in Swift using ARKit.
Swift
479
star
3

ParallaxView

tvOS controls and extensions that add parallax effect to your application.
Swift
474
star
4

AndroidSDKPoster

Wall poster with detailed changelog of Android SDK versions 14-27, broken down into 30 categories
278
star
5

PuzzleMaker

Swift framework responsible for generating puzzles from the image
Swift
123
star
6

InAppPurchaseButton

A simple and customisable in-app purchase button, written in Swift.
Swift
92
star
7

ramlo

Documentation generator for RAML 1.0
HTML
64
star
8

AutoMate-AppBuddy

iOS UI automation tests helper framework, designed to work with the AutoMate
Swift
30
star
9

gimBUS

Event bus for Android with fine-grained delivery thread control
Java
22
star
10

AutoMate-Templates

Xcode templates helps to start with new UI tests utilizing Page Object pattern and AutoMate framework
Ruby
19
star
11

HttpClientMock

Library for mocking Java 11 HttpClient.
Java
19
star
12

vozilla

R
17
star
13

AutoMate-ModelGenie

Generates localized texts for privacy alerts, languages and countries settings for AutoMate framework
Swift
17
star
14

terraform-provider-mssql

MS SQL Terraform provider
Go
17
star
15

MessagesView

view for displaying messages similarly to messages iOS system app
Swift
16
star
16

GoldenRose

A tool for generating reports from Xcode results bundle
Ruby
16
star
17

ElasticOM

Elasticsearch Object Mapper for PHP 7
PHP
14
star
18

Pgs.CrossPlatform.FormattedText

Cross Platform C# Xamarin Formatted Text Label control enabling to add own tags [b][/b] or similar to HTML tags <b><b><H1></H2> to format text in any size and font
C#
13
star
19

php-docker-skeleton

Dockerized PHP enviroment. This repository is a docker boilerplate for web apps written in PHP.
Shell
12
star
20

HashId

Replace your integer url params in Symfony applications and hide under unpredictable strings.
PHP
12
star
21

XamarinTrackMe-Mobile

Track My Location WHAT: a simple one-click app to share your location: on-line, in a real time, active for 4 hours HOW: generate a link in your mobile app, share info of your current location with anyone you want via: e-mail, sms, Facebook, NFC, Messenger, communicators or any other way. You can stop sharing your location and create a new link any time. WHAT FOR: track your fleet, cargo, partner online, allow customers to track shipments or let your friends find you easily, while at concert or a big party in real time.
C#
12
star
22

PrestigeModel

Gamestate library for Prestige mobile game, similar to card game Splendor
Java
10
star
23

danger-ios_logs

Danger plugin to detect any NSLog/print entries left in the code
Ruby
8
star
24

uglyfier

Gradle script for downsizing Android resources in debug builds
8
star
25

espresso-doppio

Espresso doppio - toys that makes Espresso based ui tests easier
Java
7
star
26

PgsRestfonyBundle

Bundle to assist with creating classes for Doctrine Entity with aim to speed up creating Restful APIs
PHP
6
star
27

pgs-blog

PGS blog extras
HTML
6
star
28

java-spring-course-pwr-2017

Java/Spring course organized on Wrocław Uniwersity of Technology by PGS Software in Spring 2017.
Java
5
star
29

AndroidMvvmTemplates

FreeMarker
5
star
30

TrackMe-Backend

Asp.Net Single Page that display Map user location by its token + SignalR notification for mobile app
JavaScript
4
star
31

ForgetAdapters

An Android library, which (extremely) simplifies seeding lists with data
Java
2
star
32

Nancy.ProblemDetails

Unified error responses for Nancy 1.x (RFC7807)
C#
2
star
33

.net-course-pwr-2017

C#
2
star
34

gulp-recipe-browsersync-server

Receipe for serving files with autoreload
JavaScript
2
star
35

AndroidMVVM

Java
1
star
36

gulp-angular-sample-project

A sample project with gulp-recipe-loader using angular framework.
JavaScript
1
star
37

angular-redux-example

JavaScript
1
star
38

gulp-sample-project

A sample project using gulp recipes
JavaScript
1
star
39

gulp-recipe-loader

Automatic gulp recipe loading and task registration
JavaScript
1
star