<commit_before># JAMTestHelper

A few additions to XCTest geared towards UI Testing in Xcode 7 and iOS 9.

```swift
- (void)testLikeButton {
    let button = app.buttons["Like"]

    button.tap()
    waitForActivityIndicatorToFinish()

    let label = app.staticTexts["1 like"]
    waitForElementToExist(label)

    button.tap()
    waitForElementToNotExist(label)
}
```

## Helpers

- `waitForElementToExist()` - waits until `element.exists` is true
- `waitForElementToNotExist()` - waits until `element.exists` is false
- `waitForActivityIndicatorToFinish()` - waits until the (assumed) only activity indicator stops animating

Both of these helpers work by ticking the run loop a tenth of a second in between checks. If the element does not meet the condition after two seconds an exception is raised.

Exceptions are used over `XCTFail()` so the tests' tests, `JAMTestHelperTests.swift` can run valid assertions. See that file for more details.
<commit_msg>Note Xcode 7 Beta 4 requirement in README<commit_after># JAMTestHelper

> Requires Xcode 7 Beta 4

A few additions to XCTest geared towards UI Testing in Xcode 7 and iOS 9.

```swift
- (void)testLikeButton {
    let button = app.buttons["Like"]

    button.tap()
    waitForActivityIndicatorToFinish()

    let label = app.staticTexts["1 like"]
    waitForElementToExist(label)

    button.tap()
    waitForElementToNotExist(label)
}
```

## Helpers

- `waitForElementToExist()` - waits until `element.exists` is true
- `waitForElementToNotExist()` - waits until `element.exists` is false
- `waitForActivityIndicatorToFinish()` - waits until the (assumed) only activity indicator stops animating

Both of these helpers work by ticking the run loop a tenth of a second in between checks. If the element does not meet the condition after two seconds an exception is raised.

Exceptions are used over `XCTFail()` so the tests' tests, `JAMTestHelperTests.swift` can run valid assertions. See that file for more details.

{'fraction_non_alphanumeric': 0.08244815376833586, 'fraction_numerical': 0.005058168942842691, 'mean_word_length': 4.389645776566757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4567005', 'n_tokens_mistral': 618, 'n_tokens_neox': 563, 'n_words': 226}