Skip to content

Commit

Permalink
Update README to include explicit Swift examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
CooperCorona committed Aug 10, 2023
1 parent 2f396e6 commit 7563d73
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ accessibility label) on all elements on the screen.
To install GTXiLib on all the tests of a specific test class add the following
snippet of code to it.

In Objective-C. Note that GTX is installed in the class `+ (void)setUp`, not the instance `- (void)setUp`.

```objective-c
// Include the GTXiLib umbrella header.

Expand All @@ -37,6 +39,17 @@ snippet of code to it.
}
```

In Swift. Note that GTX is installed in the class `class func setUp`, not the instance `func setUp()`.

```swift
override class func setUp() {
super.setUp()

let checksToBeInstalled = GTXChecksCollection.allGTXChecks()!
GTXiLib.install(on: GTXTestSuite(allTestsIn: self)!, checks: checksToBeInstalled, elementExcludeLists: [])
}
```

Once installed, GTX will run all registered accessibility checks before test
case tearDown and fail the test if any accessibility checks fail. With the above
snippet of code your tests will now begin to catch issues where you have added
Expand Down

0 comments on commit 7563d73

Please sign in to comment.