A decoupled TestRail integration for your Xcode project to easily send results to TestRail.

Overview

(Super Easy) Xcode TestRail Integration

Build Status Version License Platform

This integration helps you to automatically send test results to TestRail. And yes, super easy and simple!

Add your TestRail credentials in Xcode, decide which test results should be sent to TestRail and you're done!

1. Installation

This integration is available through CocoaPods. To install it, simply add the following line to your Podfile:

You usually only need to install the integration for your test targets. Open your podfile and add this to your test target.

target 'MyTestTarget' do
    pod 'XcodeTestrail'
end

Then just install your pods.

pod install

2. Setup TestRail credentials

Now configure your credentials for the TestRail API. Just add this snippet in a testrail.conf file in the root directory of your project.

TESTRAIL_DOMAIN=xxx.testrail.io
TESTRAIL_USER=xxx
TESTRAIL_PWD=xxxx

3. Setup Mode

3.1 Send result to specific Run in TestRail

Just assign the Run ID of TestRail in your testrail.conf and all results will be sent to this run.

Results will only be saved, if the sent TestCaseID is also existing in that run inside TestRail.

TESTRAIL_RUN_ID=161

3.2 Create new Run in TestRail for every Xcode run

Sometimes you want to create test runs dynamically inside TestRail. For this, just assign the ProjectID and the optional MilestoneID of TestRail in your testrail.conf.

The integration will then start a new run in TestRail and send the results to this one. It is also possible to provide a custom (or dynamically created) name for the new test run.

TESTRAIL_PROJECT_ID=14                      // required project id
TESTRAIL_MILESTONE_ID=5                     // optional, a milestone if yo have one
TESTRAIL_RUN_NAME=XCODE RUN iPhone 14       // the name you want to use for this test run
TESTRAIL_CLOSE_RUN=true                     // optional, if you want to close a run automatically. default is FALSE

4. Register Plugin

Just register the TestRail integration in the setup of your test files. Also make sure to import the module with the @testable keyword, otherwise TestRail will not be found!

There's nothing more that is required to register the TestRail reporter.

@testable import XcodeTestrail

override func setUpWithError() throws
{
    try super.setUpWithError()

    TestRail().register();
}

5. Map Test Cases

We're almost done. You can now map TestRail test cases to your Xcode tests. Please use the TestRail case ID as a suffix inside the Xcode test title. The plugin will automatically extract it, and send the results to your test run in TestRail. The case ID needs to be at the end and separated with an _ from the rest of the title.

public func testMyFeature_C6437()
{
    // ...
}

That's it!

You can now start Xcode, and all your results should be sent to TestRail as soon as your mapped tests pass or fail!

CI/CD Pipelines

It's also possible to run the integration within a CI/CD pipeline. In most cases you probably want to create separate test runs for different devices.

I would recommend creating a Test Plan in TestRail. This plan can then contain different test runs for every device.

In your pipeline, just create a testrail.conf file and fill it with the RunID for the specific device test. You can either create the full file dynamically, or maybe create a template that comes without a run id. In that case we simply copy the template before we start the test, and then add our specific run id.

# template.conf
TESTRAIL_DOMAIN=xxx.testrail.io
TESTRAIL_USER=xxx
TESTRAIL_PWD=xxxx
# copy template before a new device test
cp ./template.conf src/testrail.conf

# assign our iPhone 14 Pro (iOS 16.0) Run ID for our Release Plan in TestRail (R166)
echo "TESTRAIL_RUN_ID=166" >> src/testrail.conf

# start our Xcode tests for iPhone 14 Pro, iOS 16.0
xcodebuild test -workspace xxx -scheme xxx -testPlan UITestsPlan -destination 'platform=iOS Simulator,name=iPhone 14 Pro,OS=16.0'

License

XcodeTestrail is available under the MIT license. See the LICENSE file for more info.

You might also like...
RNH Tracker is a GPS logger for iOS (iPhone, iPad, iPod) Track your location and send your logs to RNH Regatta :-)

RNH Tracker for iOS + WatchOS RNH Tracker is a GPS logger for iOS (iPhone, iPad, iPod) with offline map cache support. Track your location, add waypoi

Sample iOS integration project

Sample integration of SweeprMobile SDK To quickly build the app: Fill-in the URLs and passwords inside env-default file Generate BuildConfig.swift bas

Codeless Appodeal integration into Unity project.
Codeless Appodeal integration into Unity project.

Codeless out of the box Appodeal integration into Unity project. Contains global config file which provide you ability to setup Appodeal without any line of code.

MultiPeer-Progress-iOS - Swift project to demo the use of the MultiPeer framework to send files between iOS devices and show the progress
An xcconfig (Xcode configuration) file for easily turning on a boatload of warnings in your project or its targets.

Warnings This is an xcconfig file to make it easy for you to turn on a large suite of useful warnings in your Xcode project. These warnings catch bugs

A danger-swift plug-in to manage/post danger checking results with markdown style

DangerSwiftShoki A danger-swift plug-in to manage/post danger checking results with markdown style Install DangerSwiftShoki SwiftPM (Recommended) Add

A macOS auxiliary app to choose results from cloud input methods

CloudInputAssist Introduction 介绍 一个 macOS 辅助应用程序,用于使用云输入法(例如谷歌云输入法)API 提供辅助的候选词结果。 Motivation 动机 使用不联网的本地输入法时,长句的候选词往往不太理想,尤其是使用双拼输入时。这种情况下,借助一些输入法的云计

QR code detector. Simple usage, you can get recognition results via delegate or callback.

SPQRCode QR code detector. Simple usage, you can get recognition results via delegate or callback. Installation Swift Package Manager CocoaPods Manual

Put a big red line through w3schools.com links in duckduckgo search results
Put a big red line through w3schools.com links in duckduckgo search results

please-no-w3schools Put a big red line through w3schools.com links in duckduckgo search results. This browser extension only adds no-w3schools.css to

A utility application to capture and review search results from Swift Package Index.

SPISearch An app (macOS & iOS) to explore the search results from Swift Package Index. Testflight Links: SPIIndex (iOS and macOS apps) Search Ranking

Automatically generate GraphQL queries and decode results into Swift objects, and also interact with arbitrary GitHub API endpoints

GitHub API and GraphQL Client This package provides a generic GitHub API client (GithubApiClient) as well as Codable-like GitHub GraphQL querying and

Exclude files and folders from Alfred’s search results
Exclude files and folders from Alfred’s search results

Ignore in Alfred Alfred Workflow Exclude files and folders from Alfred’s search results ⤓ Download Workflow About The macOS metadata search API only a

PinpointKit is an open-source iOS library in Swift that lets your testers and users send feedback with annotated screenshots using a simple gesture.
PinpointKit is an open-source iOS library in Swift that lets your testers and users send feedback with annotated screenshots using a simple gesture.

PinpointKit is an open-source iOS library in Swift that lets your testers and users send feedback with annotated screenshots using a simple gesture. F

send your valuable codes here.

Hacktoberfest2021 # Hacktoberfest 2021 Hacktoberfest encourages participation in the open source community, which grows bigger every year. Complete th

NextLevel is a Swift camera system designed for easy integration, customized media capture, and image streaming in iOS
NextLevel is a Swift camera system designed for easy integration, customized media capture, and image streaming in iOS

NextLevel is a Swift camera system designed for easy integration, customized media capture, and image streaming in iOS. Integration can optionally leverage AVFoundation or ARKit.

Swift AWS Lambda to automatically assign engineers to pull requests with a Slack integration
Swift AWS Lambda to automatically assign engineers to pull requests with a Slack integration

PR Assigner A Swift AWS Lambda to automatically assign engineers to pull requests with a Slack integration. Features 🙅

A small todo list with realm integration

RealmToDo Project Setup Install CocoaPods Open project directory in terminal and run pod install command Open Workspace of project *.xcworkspace Examp

A drink tracker for iOS with Untappd and HealthKit integration.
A drink tracker for iOS with Untappd and HealthKit integration.

Good Spirits is a drink tracking iOS app that helps you stay under the government limits for "low-risk" drinking. Includes charts and stats, the abili

Google Analytics tracker for Apple tvOS provides an easy integration of Google Analytics’ measurement protocol for Apple TV.

Google Analytics tracker for Apple tvOS by Adswerve About Google Analytics tracker for Apple tvOS provides an easy integration of Google Analytics’ me

Releases(1.2.0)
  • 1.2.0(Oct 11, 2022)

    Added

    • Added new option to also have Test Runs automatically created in TestRail. Please see the README for more.

    Changed

    • You can now also provide a RunID with a leading "R". The framework will automatically remove it for you.
    • Stability improvements in API connection
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Oct 8, 2022)

    Changed

    • Improved debug print output for the integration summary. This will now only be displayed once when starting the tests.

    Fixed

    • Fixed problem where results where sent multiple times to TestRail in larger setups
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Oct 7, 2022)

Owner
Christian
I’m a software developer for iOS, Windows, Web and Android/Java technologies. I work at dasistweb GmbH and I'm the founder of www.live-score-app.com
Christian
This repository contains 🎨 My Xcode theme that I use. It is compatible with all versions of Xcode.

DRL Xcodetheme Installation Automatic (via script) ./install.sh which will install the file in Xcode FontAndColorThemes directory. Restart Xcode Go t

durul dalkanat 19 Oct 21, 2022
Solarized Dark Theme for Xcode. Compatible with all modern versions of Xcode since 2013!

Solarized Dark for Xcode Note I've moved away from using Solarized to a Night-Shift/Dark-Mode-friendly palette of my own creation; Cognac. It's availa

Arthur Ariel Sabintsev 363 Sep 19, 2022
Trackable is a simple analytics integration helper library. It’s especially designed for easy and comfortable integration with existing projects.

Trackable Trackable is a simple analytics integration helper library. It’s especially designed for easy and comfortable integration with existing proj

Vojta Stavik 145 Apr 14, 2022
Swift Framework for TestRail's API

QuizTrain ?? ?? QuizTrain is a framework created at Venmo allowing you to interact with TestRail's API using Swift. It supports iOS, macOS, tvOS, and

Venmo 18 Mar 17, 2022
Util for executing shell commands, and getting the results easily(data, string, and any decodable).

ShellExecutor Util for executing shell commands, and getting the results easily(data, string, and any decodable). Requirements Xcode 14.0+ Swift 5.7+

Yozone Wang 2 Jul 30, 2022
XCode and Swift game based on the generation of random cards and some functions related to the comparison of the results.

war-card-game-V1 XCode and Swift game based on the generation of random cards and some functions related to the comparison of the results. Once a card

Eduard 1 Dec 10, 2021
A project that uses the Flickr image search API and shows the results in a 3-column scrollable collection view

FlickrImagesDemo FlickrImagesDemo is a project that uses the Flickr image search API and shows the results in a 3-column scrollable collection view. 


प्रणय पवार 0 Dec 9, 2021
Xgist - Xcode extension to send code to GitHub's Gist

Xgist Xgist is a Xcode extension to send code to GitHub's Gist. The extension will send your code selection to Gist and automatically copy the Gist UR

Fernando Bunn 76 Jul 2, 2022
Joseph Heck 20 Oct 15, 2022
Synx - A command-line tool that reorganizes your Xcode project folder to match your Xcode groups

A command-line tool that reorganizes your Xcode project folder to match your Xcode groups. Xcode Finder Installation $ gem install synx Usage Basic ⚠

Venmo 6.1k Nov 17, 2022