Swiftpack.co - Package - albinekcom/XCUIElement-IsVisible

XCUIElement+IsVisible

Swift 4.1 Build Status

This extension adds a computed property isVisible to XCUIElement. It is useful in UI Testing for checking if a specified element is visible on the screen.

Installation

CocoaPods

Add the following line to the target UITests in your Podfile:

pod 'XCUIElement+IsVisible'

Swift Package Manager

Add the following line to dependencies in your Package.swift file:

.package(url: "https://github.com/albinekcom/XCUIElement-IsVisible.git", from: "0.0.1")

Manually

Add XCUIElement+IsVisible.swift file from Sources directory into your project.

Usage

  1. Add import statement in your class which inherits from XCTestCase (not needed if you install it manually):
import XCUIElement_IsVisible
  1. Receive desired XCUIElement in your test method and use its isVisible computed property:
func testExample() {
    let element = // (...)

    XCTAssertTrue(element.isVisible)
}

Check out Example project in Example directory.

Github

link
Stars: 1
Help us keep the lights on

Dependencies

Used By

Total: 0