Giter Site home page Giter Site logo

uitestingplus's Introduction

License Platforms Documentation

UITestingPlus

Utilities for working with XCUI testing.

Integration

dependencies: [
    .package(url: "https://github.com/ChimeHQ/UITestingPlus", branch: "main")
]

XCUIApplication Extensions

Menus

var windowMenuItemTitles: [String]
var windowMenuItemWindowTitles: [String]
var recentMenuItemTitles: [String]

Windows

func launchWithNoWindows()
func closeExistingWindows()
var frontWindow: XCUIElement
func resetLaunchEnvironmentAndArguments()
func quit()

Documents

func saveFrontmostDocument() throws
func closeFrontmostDocument() throws
func createNewDocument() throws
func saveDocument(in window: XCUIElement) throws
func saveDocument(in window: XCUIElement, to url: URL, overwrite: Bool = true) throws
func openDocument(with url: URL) -> XCUIElement

Built-in Applications

static let springboard: XCUIApplication
static let safari: XCUIApplication
static let settings: XCUIApplication
static let files: XCUIApplication
static let photos: XCUIApplication

XCUIElement Extensions

Text Editing

func replaceTextWith(_ string: String)
func replaceTextWithPasteboard()
func appendText(_ string: String)
func deleteText()

func stringValue(in range: NSRange? = nil) throws -> String
func navigateTextView(to line: Int, column: Int) throws

Existance

func waitForNonExistence(timeout: TimeInterval) -> Bool

Classes

  • HittableElementExpectation

Suggestions or Feedback

We'd love to hear from you! Get in touch via an issue or pull request.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

uitestingplus's People

Contributors

chrisvasselli avatar icanzilb avatar mattmassicotte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

uitestingplus's Issues

CocoaPods support

I still prefer CocoaPods over SPM, would love if this package were published there as well!

ld: warning: Could not find or use auto-linked framework 'XCTest'

When I added the package locally, I didn't have any trouble using it. But when I tried to add it as a dependency using SPM, I get linker errors (see below).

Per some googling, updating my own project to enable the build setting "Enable Testing Search Paths" did seem to fix the issue. But it feels like there should be a solution that doesn't require modifying a build setting on the target project.

I tried adding swiftSettings: [.define("ENABLE_TESTING_SEARCH_PATHS")] to Package.swift but it didn't seem to fix the issue. I also tried updating the Package.swift to add linkerSettings: [ .linkedFramework("XCTest")] to the UITestingPlus target, but that led to a ld: framework not found XCTest error instead.

I'm not an SPM expert, so I could use some help figuring out what the appropriate solution is.

Ld /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/Nihongo.app/Nihongo normal (in target 'StudyJapanese' from project 'StudyJapanese')
    cd /Users/chris/Code/SerpentiSei/StudyJapanese
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios15.0-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk -L/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/EagerLinkingTBDs -L/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk/usr/lib/swift -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/EagerLinkingTBDs -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PackageFrameworks -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PackageFrameworks -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PackageFrameworks -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PackageFrameworks -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PackageFrameworks -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PackageFrameworks -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PackageFrameworks -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PackageFrameworks -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PackageFrameworks -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PackageFrameworks -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PackageFrameworks -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/AMPopTip -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/ARChromeActivity -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/CHCSVParser-iOS -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/CocoaLumberjack -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/DeviceKit-iOS14.0 -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/Down -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/Ensembles -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/FMDB-iOS -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/Introspect-iOS14.0 -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/KINWebBrowser -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/MLPAutoCompleteTextField -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/MZAppearance -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/MZFormSheetPresentationController -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PocketSVG -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/PromisesObjC -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/RevenueCat -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/SSZipArchive-iOS -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/SimulatorStatusMagic -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/SwifterSwift -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/TTTAttributedLabel -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/TUSafariActivity -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/UIColor-Utilities -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/WrappingHStack-iOS14.0 -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/nanopb -F/Users/chris/Code/SerpentiSei/StudyJapanese/Pods/OpenSSL-Universal/Frameworks -F/Users/chris/Code/SerpentiSei/StudyJapanese/Pods/Reveal-SDK/RevealServer -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/XCFrameworkIntermediates/OpenSSL-Universal -F/Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/XCFrameworkIntermediates/Reveal-SDK -filelist /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/StudyJapanese.build/Light-iphonesimulator/StudyJapanese.build/Objects-normal/arm64/Nihongo.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/StudyJapanese.build/Light-iphonesimulator/StudyJapanese.build/Objects-normal-ubsan/arm64/Nihongo_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -debug_variant -fobjc-arc -fobjc-link-runtime -fsanitize\=undefined -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/StudyJapanese.build/Light-iphonesimulator/StudyJapanese.build/Objects-normal-ubsan/arm64/StudyJapanese.swiftmodule -ObjC -all_load -liconv -lsqlite3 -lstdc++ -lxml2 -lz -framework AMPopTip -framework ARChromeActivity -framework CFNetwork -framework CHCSVParser -framework CloudKit -framework CocoaLumberjack -framework CoreData -framework CoreGraphics -framework CoreText -framework DeviceKit -framework Down -framework Ensembles -framework FBLPromises -framework FMDB -framework Introspect -framework KINWebBrowser -framework MLPAutoCompleteTextField -framework MZAppearance -framework MZFormSheetPresentationController -framework OpenSSL -framework PocketSVG -framework QuartzCore -framework RevealServer -framework RevenueCat -framework SSZipArchive -framework Security -framework SimulatorStatusMagic -framework StoreKit -framework SwifterSwift -framework TTTAttributedLabel -framework TUSafariActivity -framework UIColor_Utilities -framework UIKit -framework WrappingHStack -framework nanopb -weak_framework SwiftUI -weak_framework WebKit -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/StudyJapanese.build/Light-iphonesimulator/StudyJapanese.build/Nihongo.app-Simulated.xcent -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __ents_der -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/StudyJapanese.build/Light-iphonesimulator/StudyJapanese.build/Nihongo.app-Simulated.xcent.der -lz -lsqlite3 -framework SystemConfiguration -framework Security -framework CloudKit -lxml2 -framework Tokenizer -framework DictionaryFramework -framework Pods_AllTargets_iOS_NihongoAppAndVariants_StudyJapanese -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/StudyJapanese.build/Light-iphonesimulator/StudyJapanese.build/Objects-normal-ubsan/arm64/Nihongo_dependency_info.dat -o /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Products/Light-iphonesimulator/Nihongo.app/Nihongo -Xlinker -add_ast_path -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/UITestingPlus.build/Light-iphonesimulator/UITestingPlus.build/Objects-normal-ubsan/arm64/UITestingPlus.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/swift-collections.build/Light-iphonesimulator/Collections.build/Objects-normal-ubsan/arm64/Collections.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/swift-collections.build/Light-iphonesimulator/DequeModule.build/Objects-normal-ubsan/arm64/DequeModule.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/swift-collections.build/Light-iphonesimulator/OrderedCollections.build/Objects-normal-ubsan/arm64/OrderedCollections.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/swift-algorithms.build/Light-iphonesimulator/Algorithms.build/Objects-normal-ubsan/arm64/Algorithms.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/swift-numerics.build/Light-iphonesimulator/RealModule.build/Objects-normal-ubsan/arm64/RealModule.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/TelemetryClient.build/Light-iphonesimulator/TelemetryClient.build/Objects-normal-ubsan/arm64/TelemetryClient.swiftmodule -Xlinker -add_ast_path -Xlinker /Users/chris/Library/Developer/Xcode/DerivedData/StudyJapanese-glbneyedpsgxhscqueifpekwaofk/Build/Intermediates.noindex/AnimationSequence.build/Light-iphonesimulator/AnimationSequence.build/Objects-normal-ubsan/arm64/AnimationSequence.swiftmodule

ld: warning: Could not find or use auto-linked library 'XCTestSwiftSupport'
ld: warning: Could not find or use auto-linked framework 'XCTest'
Undefined symbols for architecture arm64:
  "_$s6XCTest7XCTFail_4file4lineySS_s12StaticStringVSutF", referenced from:
      _$sSo11XCUIElementC13UITestingPlusE11stringValue2inSSSo8_NSRangeVSg_tKF in UITestingPlus.o
  "_OBJC_CLASS_$_XCTNSPredicateExpectation", referenced from:
      objc-class-ref in UITestingPlus.o
      _$s13UITestingPlus26HittableElementExpectationCN in UITestingPlus.o
  "_OBJC_CLASS_$_XCTWaiter", referenced from:
      objc-class-ref in UITestingPlus.o
  "_OBJC_CLASS_$_XCTestExpectation", referenced from:
      objc-class-ref in UITestingPlus.o
  "_OBJC_CLASS_$_XCUIApplication", referenced from:
      objc-class-ref in UITestingPlus.o
  "_OBJC_CLASS_$_XCUIElement", referenced from:
      objc-class-ref in UITestingPlus.o
  "_OBJC_METACLASS_$_XCTNSPredicateExpectation", referenced from:
      _OBJC_METACLASS_$__TtC13UITestingPlus26HittableElementExpectation in UITestingPlus.o
  "_XCUIIdentifierCloseWindow", referenced from:
      _$sSo11XCUIElementC13UITestingPlusE17closeWindowButtonABvg in UITestingPlus.o
  "__swift_FORCE_LOAD_$_XCTestSwiftSupport", referenced from:
      __swift_FORCE_LOAD_$_XCTestSwiftSupport_$_UITestingPlus in UITestingPlus.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)```

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.