Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pgssoft/automate-appbuddy

iOS UI automation tests helper framework, designed to work with the AutoMate
https://github.com/pgssoft/automate-appbuddy

automation ios swift-framework uiautomation xctest xcuitest

Last synced: 2 months ago
JSON representation

iOS UI automation tests helper framework, designed to work with the AutoMate

Awesome Lists containing this project

README

        


AutoMate, made by PGS Software




AutoMate
AppBuddy
Templates
ModelGenie


# AutoMate AppBuddy

`AppBuddy` is a helper framework for UI automation tests, designed to work with the [`AutoMate`](https://github.com/PGSSoft/AutoMate). It can disable animations in the application and manage events, reminders and contacts.

[![Swift 5](https://img.shields.io/badge/Swift-5-orange.svg?style=flat)](https://swift.org)
[![Travis](https://img.shields.io/travis/PGSSoft/AutoMate-AppBuddy.svg)](https://travis-ci.org/PGSSoft/AutoMate-AppBuddy)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/AutoMate-AppBuddy.svg)](https://cocoapods.org/pods/AutoMate-AppBuddy)
[![Documentation](https://img.shields.io/badge/docs-100%25-D15B45.svg?style=flat)](https://pgssoft.github.io/AutoMate-AppBuddy/)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Platform](https://img.shields.io/cocoapods/p/AutoMate-AppBuddy.svg)](https://cocoapods.org/pods/AutoMate-AppBuddy)
[![License](https://img.shields.io/github/license/PGSSoft/AutoMate-AppBuddy.svg)](https://github.com/PGSSoft/AutoMate-AppBuddy/blob/master/LICENSE)

## Installation

### CocoaPods

The most convenient way to install it is by using [CocoaPods](https://cocoapods.org) with Podfile:

```ruby
pod 'AutoMate-AppBuddy'
```

### Carthage
For Carthage [Carthage](https://github.com/Carthage/Carthage) add a line to `Cartfile.private`:

```
github "PGSSoft/AutoMate-AppBuddy"
```

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

### Swift Package Manager
You can just add AutoMate AppBuddy package to your project by entering it's repository URL

```
https://github.com/PGSSoft/AutoMate-AppBuddy
```

### Note

`AppBuddy` should be linked with target application, not with the test target.

## Usage

Full documentation is available at [https://pgssoft.github.io/AutoMate-AppBuddy/](https://pgssoft.github.io/AutoMate-AppBuddy/).

1. Duplicate existing application target.
2. Import `AutoMate_AppBuddy` framework to app delegate.

```swift
import AutoMate_AppBuddy
```

3. Setup `LaunchEnvironmentManager` in `application(_:didFinishLaunchingWithOptions:)`.

```swift
let launchEnvironmentManager = LaunchEnvironmentManager()
launchEnvironmentManager.add(handler: defaultEventKitHander, for: .events)
launchEnvironmentManager.add(handler: defaultEventKitHander, for: .reminders)
launchEnvironmentManager.add(handler: defaultContactsHander, for: .contacts)
launchEnvironmentManager.add(handler: defaultIsInUITestHandler, for: .isInUITest)
launchEnvironmentManager.add(handler: AnimationHandler(), for: .animation)
launchEnvironmentManager.setup()
```

## Features (or ToDo)

- [x] Disable UIView animations
- [x] Managing events, reminders and contacts
- [ ] Two way communication
- [ ] Stubbing network requests
- [ ] Stubbing contacts, events and reminders
- [ ] Stubbing notifications
- [ ] Taking screenshots
- [ ] Clearing application data
- [ ] Simulating push notifications

## Example application

[`AutoMate`](https://github.com/PGSSoft/AutoMate) 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-AppBuddy/](https://pgssoft.github.io/AutoMate-AppBuddy/).

If you want to handle your custom launch environments, you have to implement `Handler` protocol, e.g.

```swift
struct CustomHandler: Handler {
func handle(key: String, value: String) {
if value == "production" {

}
}
}

launchEnvironmentManager.add(handler: CustomHandler(), for: "SERVER")
```

## Contributing

Bug reports and pull requests are welcome on GitHub at [https://github.com/PGSSoft/AutoMate-AppBuddy](https://github.com/PGSSoft/AutoMate-AppBuddy).

## License

The project is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

## About
The project maintained by software development agency [PGS Software](https://www.pgs-soft.com).
See our other [open-source projects](https://github.com/PGSSoft) or [contact us](https://www.pgs-soft.com/contact-us) to develop your product.

## Follow us

[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=https://github.com/PGSSoft/AutoMate-AppBuddy)
[![Twitter Follow](https://img.shields.io/twitter/follow/pgssoftware.svg?style=social&label=Follow)](https://twitter.com/pgssoftware)