diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..01e893f --- /dev/null +++ b/Package.swift @@ -0,0 +1,20 @@ +// swift-tools-version:5.4 +import PackageDescription + +let package = Package( + name: "BrowserstackSwiftSDK", + platforms: [.iOS(.v14)], + products: [ + .library( + name: "BrowserstackSwiftSDK", + targets: ["BrowserstackSwiftSDK"] + ) + ], + targets: [ + .binaryTarget( + name: "BrowserstackSwiftSDK", + url: "https://sdk-assets.browserstack.com/browserstack-swift-sdk/releases/1.0.0/BrowserstackSwiftSDK.zip", + checksum: "6e76b5f20df8141fc9fc7673e60aeeb7bebf80699dab76ebeb4e0e76a8e23311" + ) + ] +) diff --git a/README.md b/README.md index cfe2fb3..b58ea19 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,35 @@ # browserstack-swift-sdk-artifacts Publishing repository for BrowserStack Swift SDK for Automation testing. + +## Installation +1. Select **File > Swift Packages > Add Package Dependency...**. +2. Add the Github URL of the Package file: + + ``` + https://github.com/browserstack/browserstack-swift-sdk-artifacts + ``` + +>If you receive an `artifact of binary target 'BrowserstackSwiftSDK' failed extraction: The operation couldn’t be completed. (TSCBasic.StringError error 1.)` error when extracting the package, please close Xcode, delete the Derrived Data folder, re-open Xcode, and try again. + +3. Select the BrowserstackSwiftSDK package product, select your target, and select Finish. +4. Add the below entry in the Info.plist file of your UI test target + ``` + NSPrincipalClass + BrowserstackSwiftSDK.BrowserstackSwiftSDK + ``` + + **Alternatively**, + Import the Browserstack Swift SDK module + + ``` + import BrowserstackSwiftSDK + ``` + + And then in the UI test target's class initializer add, + ``` + override class func setUp() { + /* Can be any class initializer */ + super.setUp() + let _ = BrowserstackSwiftSDK() + } + ```