Skip to content

Commit

Permalink
Added XCUIElementQuery extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
adil-hussain-84 committed Mar 19, 2021
1 parent fd86df3 commit 807e5f4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import PackageDescription

let package = Package(
name: "XCTestExtensions",
platforms: [
.iOS(.v9), .macOS(.v10_11), .tvOS(.v9), .watchOS(.v2)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
Expand Down
22 changes: 22 additions & 0 deletions Sources/XCTestExtensions/XCUIElementQueryExtension.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// XCUIElementQueryExtension.swift
// HifdhTrackerUITests
//
// Created by Adil Hussain on 19/03/2021.
// Copyright © 2021 Tazkiya Tech. All rights reserved.
//

import XCTest

extension XCUIElementQuery {

/**
* Asserts that the number of elements that match this query is `count`.
*
* # Reference
* [XCUIElementQuery.count](https://developer.apple.com/documentation/xctest/xcuielementquery/1500625-count)
*/
public func assertCount(count: Int) {
XCTAssertEqual(count, self.count)
}
}

0 comments on commit 807e5f4

Please sign in to comment.