Giter VIP home page Giter VIP logo

testrunner's Introduction

mit platform Lang SPM compatible Tests codebeat badge

TestRunner ๐Ÿƒ

Simplifies running UI-tests

Description:

  • TestRunner is a Swift package that simplifies running UI tests for iOS and macOS.
  • It allows you to create scenes that can be played and receive notifications upon their completion.
  • You can iterate through scenes in sequences, reuse common scenes such as LoginScene and LogoutScene, and operate asynchronously.

How does it work

TestRunner allows you to:

  • Create scenes that you can play and receive notifications upon their completion (asynchronously).
  • Iterate through scenes in sequences.
  • Reuse common scenes such as LoginScene and LogoutScene.
  • Operate asynchronously.

Key Concepts:

  • Step: A single interaction logic, usually encapsulated in an anonymous closure.
  • Scene: A series of steps.
  • Sequence: A series of scenes.

Demo:

Here is a QA Test prototype for debugging a playlist feature:

img

Installation

You can install TestRunner using Swift Package Manager. Simply add the following line to your Package.swift file:

.package(url: "https://github.com/eonist/TestRunner.git", from: "1.0.0")

Then add TestRunner as a dependency for your target:

.target(
    name: "MyTarget",
    dependencies: [
        "TestRunner",
    ]
),

Alternatively, you can add TestRunner to your project using Xcode. Simply go to File > Swift Packages > Add Package Dependency and enter the URL of this repository.

Example:

class SearchScene {
  override run(){
    let searchBar = XTElement.findFirst("SearchBar")
    searchBar.search("Eminem")
    let searchButton = XTElement.findFirst("SearchButton")
    searchButton.tap()
    onComplete()
  }
}
let sequence: [SceneKind.Type] = [LoginScene.self, SearchScene.self, LogoutScene.self]
let runner: SceneRunner = .init(sequence: sequence, onComplete: {})
runner.complete { Swift.print("All scenes completed ๐Ÿ") }
runner.app.launch()
runner.iterate() // ๐Ÿƒ

Dependencies:

Warning
Add this framework via XCode SPM-package-manager to the UITesting-target in xcode, not main target

Resources:

Todo:

  • Add example project (See TabNav-project, playlist-project, UITesting-project) ๐Ÿ‘ˆ๐Ÿ‘ˆ๐Ÿ‘ˆ
  • Maybe add ideas from AccessRunner project, might have advanced ways of doing things etc ๐Ÿ‘ˆ
  • Maybe use semaphore to make async -> sync ? ๐Ÿ‘ˆ
  • Clean up UITestSugar

testrunner's People

Contributors

eonist avatar orchidfire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

orchidfire

testrunner's Issues

Name suggestion for package

SpeedRunner, MeepMeep, RunSuite, LoopTest, Looper, Inzilio, RunSquad, RunScope, TestPipe, LightRunner, CheckPoint, Automata, StepLoop, AutoCheck, RiftLoop, Ivent, leap, Zen, Auomatix, Exits, Cycle, RunCycle, ReadyCheck, TrackMate, ScanRun, DevTester, TestWerk, Aparat, SteadySet, Clarity, RunRunRun, ScaleStack, RunCycle, AutoScale, TrustScape, Metrica, ZenTonic, BladeRunner, Automate, Kubi, Qontix, VerifyOne, SwiftRun, SpeedLeap, SightSet, Valerio, InSight, PulseRun, SmoothRun, RunWare, EasyBreazy, Testigo, PulsePilot, SafeRun, EliteScan, RapidLaunch, Vertigo, RihnoFire, MonoRail, TestFlow, CodeRun, QuickTest, TestPilot , TikiTaka, ignite, TrueRunner, Simulate, QuickRun, ZenSuite, QuadLoop, InfinityLoop,

Create different UITest types

enum UITestType {
   case basics // Covers the basics
   case comprehensive // Covers everything
   case mixAndMatch // Runs different scenes in random order
   case repeating(type: Self, count: Int) // Can repeat a test n-times
}
extension UITestType {
   var scenes: Scenes {
      switch self {
         case basics: return []
         ...
      }
   }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.