Description
QuizTrain is a framework created at Venmo allowing you to interact with TestRail's API using Swift. It supports iOS, macOS, tvOS, and watchOS. To use QuizTrain you must have a valid TestRail license and instance to access. It is open source software released under the MIT License.
QuizTrain alternatives and similar libraries
Based on the "Testing" category.
Alternatively, view QuizTrain alternatives based on common mentions on social networks and blogs.
-
OHHTTPStubs
Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers! -
UI Testing Cheat Sheet
How do I test this with UI Testing? -
XCTest
The XCTest Project, A Swift core library for providing unit test support -
Mockingjay
An elegant library for stubbing HTTP requests with ease in Swift -
Mocker
Mock Alamofire and URLSession requests without touching your code implementation -
Buildasaur
Automatic testing of your Pull Requests on GitHub and BitBucket using Xcode Server. Keep your team productive and safe. Get up and running in minutes. @buildasaur -
Erik
Erik is an headless browser based on WebKit. An headless browser allow to run functional tests, to access and manipulate webpages using javascript. -
Spectre
BDD Framework and test runner for Swift projects and playgrounds -
Mussel
A framework for easily testing Push Notifications and Routing in XCUITests -
Mockit
A simple mocking framework for Swift, inspired by the famous http://mockito.org/ -
AutoMockable
AutoMocker is a Swift framework that leverages the type system to let you easily create mocked instances of your data types. -
Guava
A Swift test double library. Guava - looks like an apple but it's not.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of QuizTrain or a related project?
README
QuizTrain 📝🚆
QuizTrain is a framework created at Venmo allowing you to interact with TestRail's API using Swift. It supports iOS, macOS, tvOS, and watchOS.
To use QuizTrain you must have a valid TestRail license and instance to access.
Licensing
QuizTrain is open source software released under the MIT License. See the [LICENSE](LICENSE) file for details.
Installation
Carthage
After upgrading to the latest version of Carthage add the following to your Cartfile
or Cartfile.private
file:
github "venmo/QuizTrain" ~> 2.1.0
See Adding frameworks to an application for further instructions. Once complete import QuizTrain
in any Swift files you wish to use QuizTrain in.
Cocoapods
In your Podfile
add the following line to your target and save the file:
pod 'QuizTrain', '~> 2.1.0'
Run pod install
, open your project .xcworkspace
file, and you should now be able to import QuizTrain
into your code.
Usage
Create an ObjectAPI
to get, add, update, delete, and close items on your TestRail instance.
let objectAPI = ObjectAPI(username: "[email protected]", secret: "your_api_key_or_password", hostname: "yourInstance.testrail.net", port: 443, scheme: "https")
Alternatively you can use API
directly if you would rather work with basic Swift types. Generally it is better to use ObjectAPI
as API
is a lower level of abstraction. For differences see comments in [API.swift](QuizTrain/Network/API.swift) and [ObjectAPI.swift](QuizTrain/Network/ObjectAPI.swift).
Example Project
See the QuizTrain Example project to view how you can integrate QuizTrain with your unit tests and UI tests on iOS.
Example Code
Below shows a limited number of examples. For all examples see [ObjectAPITests.swift](QuizTrainTests/Network/ObjectAPITests.swift).
Get all Cases in a Project
objectAPI.getCases(inProjectWithId: 5) { (outcome) in
switch outcome {
case .failure(let error):
print(error.debugDescription)
case .success(let cases):
print(cases) // Do something with cases.
}
}
Add a Case
let section: Section = ...
let newCase = NewCase(estimate: nil, milestoneId: nil, priorityId: nil, refs: nil, templateId: nil, title: "New Case Title", typeId: nil, customFields: nil)
objectAPI.addCase(newCase, to: section) { (outcome) in
switch outcome {
case .failure(let error):
print(error.debugDescription)
case .success(let `case`):
print(`case`.title) // Do something with the newly created `case`.
}
}
Update a Suite
var suite: Suite = ...
suite.description = "Updated description for this suite."
suite.name = "Updated name of this suite."
objectAPI.updateSuite(suite) { (outcome) in
switch outcome {
case .failure(let error):
print(error.debugDescription)
case .success(let updatedSuite):
print(updatedSuite.description) // "Updated description for this suite."
print(updatedSuite.name) // "Updated name of this suite."
}
}
Delete a Section
let section: Section = ...
objectAPI.deleteSection(section) { (outcome) in
switch outcome {
case .failure(let error):
print(error.debugDescription)
case .success(_): // nil on successful deletes
print("The section has been successfully deleted.")
}
}
Close a Plan
let plan: Plan = ...
objectAPI.closePlan(plan) { (outcome) in
switch outcome {
case .failure(let error):
print(error.debugDescription)
case .success(let closedPlan):
print(closedPlan.isCompleted) // true
print(closedPlan.completedOn) // timestamp
}
}
Get a Relationship
let milestone: Milestone = ...
milestone.parent(objectAPI) { (outcome) in
switch outcome {
case .failure(let error):
print(error.debugDescription)
case .success(let optionalParent):
if let parent = optionalParent {
print("Milestone \(milestone.id) has a parent with an id of \(parent.id).")
} else {
print("Milestone \(milestone.id) does not have a parent.")
}
}
}
Get Completed Runs in a Project using a single Filter
let filters = [Filter(named: "is_completed", matching: true)]
objectAPI.getRuns(inProjectWithId: 3, filteredBy: filters) { (outcome) in
switch outcome {
case .failure(let error):
print(error.debugDescription)
case .success(let completedRuns):
for completedRun in completedRuns {
print(completedRun.isCompleted) // true
}
}
}
Get Plans in a Project using multiple Filters
let project: Project = ...
let filters = [Filter(named: "offset", matching: 3),
Filter(named: "limit", matching: 5)]
objectAPI.getPlans(in: project, filteredBy: filters) { (outcome) in
switch outcome {
case .failure(let error):
print(error.debugDescription)
case .success(let plans): // There will be 5 or less plans.
for plan in plans {
print(plan.name)
}
}
}
Errors
See the [Errors document](ERRORS.md).
Testing
See the [QuizTrainTests Readme](QuizTrainTests/README.md).
Entities
[Image of Entities](Entities.png)
*Note that all licence references and agreements mentioned in the QuizTrain README section above
are relevant to that project's source code only.