AutoMate • AppBuddy • Templates • ModelGenie
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.
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"),
Full documentation is available at https://pgssoft.github.io/AutoMate/.
Create a new UI test case class.
Import AutoMate
framework to UI tests files:
import AutoMate
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()
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)
}
XCTest
extensionsAutoMate-AppBuddy
)AutoMate-Templates
)AutoMate-Templates
)LocationWhenInUseAlert
, CalendarAlert
, PhotosAlert
) (with AutoMate-ModelGenie
)AutoMate-AppBuddy
)AutoMate-AppBuddy
)AutoMate-AppBuddy
)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.
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
])
Bug reports and pull requests are welcome on GitHub at https://github.com/PGSSoft/AutoMate.
The project is available as open source under the terms of the MIT License.
The project maintained by software development agency PGS Software. See our other open-source projects or contact us to develop your product.
link |
Stars: 285 |
Last commit: 21 weeks ago |
Released on 2020-07-18.
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics