Skip to content
This repository was archived by the owner on Apr 15, 2020. It is now read-only.

Commit 46815ef

Browse files
authored
[8.1.0] generate docs, fix tests, prep release (#133)
* [8.1.0] generate docs * [Gems] update cocoapods 1.8.0 * Fix UI Tests, improve reliability
1 parent ab4470d commit 46815ef

30 files changed

Lines changed: 158 additions & 101 deletions

Example/UITests/FetchedResultsViewsUITests.swift

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ final class FetchedResultsViewsUITests: XCTestCase {
2828
let app = XCUIApplication()
2929

3030
let getCollectionView = {
31-
XCUIApplication().collectionViews.matching(identifier: Identifiers.fetchedResultsCollectionView.rawValue).firstMatch
31+
XCUIApplication().collectionViews[Identifiers.fetchedResultsCollectionView.rawValue]
3232
}
3333

3434
let getTableView = {
35-
XCUIApplication().tables.matching(identifier: Identifiers.fetchedResultsTableView.rawValue).firstMatch
35+
XCUIApplication().tables[Identifiers.fetchedResultsTableView.rawValue]
3636
}
3737

3838
let getDeleteButton = {
@@ -148,34 +148,36 @@ final class FetchedResultsViewsUITests: XCTestCase {
148148
func test_ThatActionButton_AddNewOption_AddsCell() {
149149
fetchedResultsCollectionViewMenuItem.tap()
150150

151-
// GIVEN: initial number of cells in the collection
151+
// GIVEN: initial empty collection
152152
let collection = getCollectionView()
153-
let numberOfCellsBeforeInCollection = countElements(ofType: .cell, inView: collection) { $0.identifier }
154153

155154
// WHEN: "Add new" option is tapped
156155
getShareButton().tap()
157156
app.sheets["You must select items first"].buttons["Add new"].tap()
158157

159-
// THEN: a new cell appears in the collection view
160-
let numberOfCellsAfterInCollection = countElements(ofType: .cell, inView: collection) { $0.identifier }
161-
XCTAssertEqual(numberOfCellsAfterInCollection,
162-
numberOfCellsBeforeInCollection + 1,
163-
"\"Add new\" should add one new cell")
158+
let result1 = waitToAppearFor(element: collection.cells.element(boundBy: 0))
159+
XCTAssertEqual(result1, .completed)
160+
161+
// THEN: one new cell appears in the collection view
162+
let numberOfCellsInCollection = countElements(ofType: .cell, inView: collection) { $0.identifier }
163+
XCTAssertEqual(numberOfCellsInCollection, 1, "\"Add new\" should add one new cell")
164164

165165
navigateBack()
166+
getDeleteButton().tap()
166167
fetchedResultsTableViewMenuItem.tap()
167168

168-
// GIVEN: initial number of cells in the table view
169+
// GIVEN: initial empty table
169170
let table = getTableView()
170-
let numberOfCellsBeforeInTable = countElements(ofType: .cell, inView: table) { $0.identifier }
171171

172172
// WHEN: "Add new" option is tapped
173173
getShareButton().tap()
174174
app.sheets["You must select items first"].buttons["Add new"].tap()
175+
let result2 = waitToAppearFor(element: table.cells.element(boundBy: 0))
176+
XCTAssertEqual(result2, .completed)
175177

176-
// THEN: a new cell appears in the table view
177-
let numberOfCellsAfterInTable = countElements(ofType: .cell, inView: table) { $0.identifier }
178-
XCTAssertEqual(numberOfCellsAfterInTable, numberOfCellsBeforeInTable + 1, "\"Add new\" should add one new cell")
178+
// THEN: one new cell appears in the table view
179+
let numberOfCellsInTable = countElements(ofType: .cell, inView: table) { $0.identifier }
180+
XCTAssertEqual(numberOfCellsInTable, 1, "\"Add new\" should add one new cell")
179181
}
180182

181183
func test_ThatActionButton_DeleteSelectedOption_RemovesSelectedCells() {

Example/UITests/StaticViewsUITests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ final class StaticViewsUITests: XCTestCase {
2323
private let numberOfCellsInStaticTableView: Int = 9
2424
private let numberOfCellsInStaticCollectionView: Int = 10
2525

26-
private let staticTableViewMenuItem = XCUIApplication().tables.element.cells.element(boundBy: 0)
27-
private let staticCollectionViewMenuItem = XCUIApplication().tables.element.cells.element(boundBy: 1)
26+
private let staticTableViewMenuItem = XCUIApplication().tables[Identifiers.mainTableView.rawValue].cells.element(boundBy: 0)
27+
private let staticCollectionViewMenuItem = XCUIApplication().tables[Identifiers.mainTableView.rawValue].cells.element(boundBy: 1)
2828

2929
let app = XCUIApplication()
3030

Example/UITests/XCTestCase+Extensions.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,17 @@ extension XCTestCase {
119119
numberOfElementsTapped += 1
120120
}
121121
}
122+
123+
@discardableResult
124+
func waitToAppearFor(element: XCUIElement, timeout: Double = 5.0) -> XCTWaiter.Result {
125+
let waiter = XCTWaiter()
126+
let nsPredicate = NSPredicate(format: "exists == true")
127+
let expectations = [XCTNSPredicateExpectation(predicate: nsPredicate, object: element)]
128+
let result = waiter.wait(for: expectations, timeout: timeout)
129+
130+
if result == .timedOut && element.exists && nsPredicate.evaluate(with: element) {
131+
return .completed
132+
}
133+
return result
134+
}
122135
}

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
22

3-
gem 'cocoapods', '~> 1.7.5'
3+
gem 'cocoapods', '~> 1.8'
44

55
gem 'danger', '~> 6.0'
66
gem 'danger-swiftlint'

Gemfile.lock

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,25 @@ GEM
99
tzinfo (~> 1.1)
1010
addressable (2.7.0)
1111
public_suffix (>= 2.0.2, < 5.0)
12+
algoliasearch (1.27.0)
13+
httpclient (~> 2.8, >= 2.8.3)
14+
json (>= 1.5.1)
1215
atomos (0.1.3)
1316
claide (1.0.3)
1417
claide-plugins (0.9.2)
1518
cork
1619
nap
1720
open4 (~> 1.3)
18-
cocoapods (1.7.5)
21+
cocoapods (1.8.0)
1922
activesupport (>= 4.0.2, < 5)
2023
claide (>= 1.0.2, < 2.0)
21-
cocoapods-core (= 1.7.5)
24+
cocoapods-core (= 1.8.0)
2225
cocoapods-deintegrate (>= 1.0.3, < 2.0)
2326
cocoapods-downloader (>= 1.2.2, < 2.0)
2427
cocoapods-plugins (>= 1.0.0, < 2.0)
2528
cocoapods-search (>= 1.0.0, < 2.0)
2629
cocoapods-stats (>= 1.0.0, < 2.0)
27-
cocoapods-trunk (>= 1.3.1, < 2.0)
30+
cocoapods-trunk (>= 1.4.0, < 2.0)
2831
cocoapods-try (>= 1.1.0, < 2.0)
2932
colored2 (~> 3.1)
3033
escape (~> 0.0.4)
@@ -33,9 +36,11 @@ GEM
3336
molinillo (~> 0.6.6)
3437
nap (~> 1.0)
3538
ruby-macho (~> 1.4)
36-
xcodeproj (>= 1.10.0, < 2.0)
37-
cocoapods-core (1.7.5)
39+
xcodeproj (>= 1.11.1, < 2.0)
40+
cocoapods-core (1.8.0)
3841
activesupport (>= 4.0.2, < 6)
42+
algoliasearch (~> 1.0)
43+
concurrent-ruby (~> 1.0)
3944
fuzzy_match (~> 2.0.4)
4045
nap (~> 1.0)
4146
cocoapods-deintegrate (1.0.4)
@@ -86,8 +91,10 @@ GEM
8691
fuzzy_match (2.0.4)
8792
gh_inspector (1.1.3)
8893
git (1.5.0)
94+
httpclient (2.8.3)
8995
i18n (0.9.5)
9096
concurrent-ruby (~> 1.0)
97+
json (2.2.0)
9198
kramdown (2.1.0)
9299
kramdown-parser-gfm (1.1.0)
93100
kramdown (~> 2.0)
@@ -130,7 +137,7 @@ PLATFORMS
130137
ruby
131138

132139
DEPENDENCIES
133-
cocoapods (~> 1.7.5)
140+
cocoapods (~> 1.8)
134141
danger (~> 6.0)
135142
danger-auto_label
136143
danger-prose

docs/Classes.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ <h4>Declaration</h4>
244244
</section>
245245
</section>
246246
<section id="footer">
247-
<p>&copy; 2019 <a class="link" href="https://twitter.com/jesse_squires" target="_blank" rel="external">Jesse Squires</a>. All rights reserved. (Last updated: 2019-03-06)</p>
248-
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
247+
<p>&copy; 2019 <a class="link" href="https://twitter.com/jesse_squires" target="_blank" rel="external">Jesse Squires</a>. All rights reserved. (Last updated: 2019-09-24)</p>
248+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
249249
</section>
250250
</article>
251251
</div>

docs/Classes/DataSourceProvider.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ <h4>Declaration</h4>
474474
</section>
475475
</section>
476476
<section id="footer">
477-
<p>&copy; 2019 <a class="link" href="https://twitter.com/jesse_squires" target="_blank" rel="external">Jesse Squires</a>. All rights reserved. (Last updated: 2019-03-06)</p>
478-
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
477+
<p>&copy; 2019 <a class="link" href="https://twitter.com/jesse_squires" target="_blank" rel="external">Jesse Squires</a>. All rights reserved. (Last updated: 2019-09-24)</p>
478+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
479479
</section>
480480
</article>
481481
</div>

docs/Classes/FetchedResultsController.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ <h4>Return Value</h4>
259259
</section>
260260
</section>
261261
<section id="footer">
262-
<p>&copy; 2019 <a class="link" href="https://twitter.com/jesse_squires" target="_blank" rel="external">Jesse Squires</a>. All rights reserved. (Last updated: 2019-03-06)</p>
263-
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
262+
<p>&copy; 2019 <a class="link" href="https://twitter.com/jesse_squires" target="_blank" rel="external">Jesse Squires</a>. All rights reserved. (Last updated: 2019-09-24)</p>
263+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
264264
</section>
265265
</article>
266266
</div>

docs/Classes/FetchedResultsDelegateProvider.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ <h3 class="section-name">Properties</h3>
164164
<li class="item">
165165
<div>
166166
<code>
167-
<a name="/s:17JSQDataSourcesKit30FetchedResultsDelegateProviderC14cellParentView0J0_0iJ0QZSgXwvp"></a>
167+
<a name="/s:17JSQDataSourcesKit30FetchedResultsDelegateProviderC14cellParentView0J0_0iJ0QZSgvp"></a>
168168
<a name="//apple_ref/swift/Property/cellParentView" class="dashAnchor"></a>
169-
<a class="token" href="#/s:17JSQDataSourcesKit30FetchedResultsDelegateProviderC14cellParentView0J0_0iJ0QZSgXwvp">cellParentView</a>
169+
<a class="token" href="#/s:17JSQDataSourcesKit30FetchedResultsDelegateProviderC14cellParentView0J0_0iJ0QZSgvp">cellParentView</a>
170170
</code>
171171
</div>
172172
<div class="height-container">
@@ -412,8 +412,8 @@ <h4>Declaration</h4>
412412
</section>
413413
</section>
414414
<section id="footer">
415-
<p>&copy; 2019 <a class="link" href="https://twitter.com/jesse_squires" target="_blank" rel="external">Jesse Squires</a>. All rights reserved. (Last updated: 2019-03-06)</p>
416-
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
415+
<p>&copy; 2019 <a class="link" href="https://twitter.com/jesse_squires" target="_blank" rel="external">Jesse Squires</a>. All rights reserved. (Last updated: 2019-09-24)</p>
416+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
417417
</section>
418418
</article>
419419
</div>

docs/Classes/TitledSupplementaryView.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ <h4>Declaration</h4>
249249
</section>
250250
</section>
251251
<section id="footer">
252-
<p>&copy; 2019 <a class="link" href="https://twitter.com/jesse_squires" target="_blank" rel="external">Jesse Squires</a>. All rights reserved. (Last updated: 2019-03-06)</p>
253-
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
252+
<p>&copy; 2019 <a class="link" href="https://twitter.com/jesse_squires" target="_blank" rel="external">Jesse Squires</a>. All rights reserved. (Last updated: 2019-09-24)</p>
253+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.11.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
254254
</section>
255255
</article>
256256
</div>

0 commit comments

Comments
 (0)