• Stars
    star
    344
  • Rank 123,066 (Top 3 %)
  • Language
    Objective-C
  • License
    Other
  • Created over 8 years ago
  • Updated about 1 month ago

Reviews

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

Repository Details

Enable network mocks and more in UI Tests

SBTUITestTunnel

CI

Version License Platform Swift Package Manager

Overview

Apple introduced a new UI Testing feature starting from Xcode 7 that is, quoting Will Turner on stage at the WWDC, a huge expansion of the testing technology in the developer tools. The framework is easy to use and the integration with the IDE is great however there is a major problem with the way tests are launched. Testing code runs as a separate process which prevents to directly share data with the app under test making it hard to do things like dynamically inject data or stub network calls.

SBTUITestTunnel extends UI testing functionality allowing to dynamically:

  • stub network calls
  • download/upload files from/to the app's sandbox
  • monitor network calls
  • rewrite network calls
  • block cookies
  • interact with NSUserDefaults
  • define custom blocks of codes executed in the application target
  • fine grain fast-scrolling in table/collection/scroll views
  • CLLocationManager stubbing
  • UNUserNotificationCenter stubbing

The library supports concurrent parallel testing, so multiple Simulators can be used at once.

The library consists of two separated components which communicate with each other, one to be instantiate in the application's target and the other in the testing target.

Should I use this?

SBTUITestTunnel is intended to extend Apple's XCTest framework, not to replace it. It all boils down to a single subclass of XCUIApplication which comes with the additional features listed above, so it is very easy to integrate with your existing testing code.

Documentation

  • Installation: Describes how to install the library
  • Setup: Describes how to integrate the library in your code
  • Usage: Describes how to use the library
  • Example: Describes how to setup and use the example app

Additional resources?

We made additional resources available to improve the UI Testing experience:

  • Mendoza: parallelize UI tests over multiple physical machines
  • Cachi: parse Xcode's 11 .xcresult bundles
  • SBTUITestTunnelHost: access the mac host from your test target

Thanks

Kudos to the developers of the following pods which we use in SBTUITestTunnel:

Contributions

Contributions are welcome! If you have a bug to report, feel free to help out by opening a new issue or sending a pull request.

Authors

Tomas Camin (@tomascamin)

License

SBTUITestTunnel is available under the Apache License, Version 2.0. See the LICENSE file for more info.

More Repositories

1

Masaccio

An Android library providing a useful widget class which automatically detects the presence of faces in the source image and crop it accordingly so to achieve the best visual result.
Java
520
star
2

PodBuilder

A tool to precompile CocoaPods pods
Ruby
284
star
3

Mendoza

Dispatch Apple's UI Tests over multiple physical machines
Swift
64
star
4

SBTUITestTunnelHost

Add Mac host tunnel to your XCTests
Swift
61
star
5

Cachi

Parse and visualize .xcresult tests on a web interface
Swift
59
star
6

Esito

Esito ambition is to be your return type for suspending functions.
Kotlin
59
star
7

Bariloche

An argument-parsing library designed for building declarative commandline interfaces in Swift
Swift
46
star
8

Frost

This library provides a useful widget class mimicking the behavior of edit texts in a web form, which retains the entered values in a local history and automatically suggests previously stored texts as soon as the user starts typing.
Java
44
star
9

sbtuitestbrowser

A web interface to visualize xcodebuild's UI tests results
Swift
39
star
10

CachiKit

A swift library to parse Xcode's .xcresult files
Swift
15
star
11

Pellicola

A replacement for UIImagePickerController with multiselection support.
Swift
8
star
12

SBTActionController

SBTActionController acts as a Faรงade for UIActionSheet and UIAlertController
Objective-C
6
star
13

GitHub-PowdeR

A Chrome and Safari extension to collapse and hide a configurable set of files from diffs in GitHub PRs
JavaScript
2
star
14

homebrew-made

Binaries made by Subito
Ruby
2
star
15

packer

Packer AMI building introduction
HCL
1
star