Skip to content
This repository was archived by the owner on Apr 15, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions Example/UITests/FetchedResultsViewsUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ final class FetchedResultsViewsUITests: XCTestCase {
let app = XCUIApplication()

let getCollectionView = {
XCUIApplication().collectionViews.matching(identifier: Identifiers.fetchedResultsCollectionView.rawValue).firstMatch
XCUIApplication().collectionViews[Identifiers.fetchedResultsCollectionView.rawValue]
}

let getTableView = {
XCUIApplication().tables.matching(identifier: Identifiers.fetchedResultsTableView.rawValue).firstMatch
XCUIApplication().tables[Identifiers.fetchedResultsTableView.rawValue]
}

let getDeleteButton = {
Expand Down Expand Up @@ -148,34 +148,36 @@ final class FetchedResultsViewsUITests: XCTestCase {
func test_ThatActionButton_AddNewOption_AddsCell() {
fetchedResultsCollectionViewMenuItem.tap()

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

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

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

// THEN: one new cell appears in the collection view
let numberOfCellsInCollection = countElements(ofType: .cell, inView: collection) { $0.identifier }
XCTAssertEqual(numberOfCellsInCollection, 1, "\"Add new\" should add one new cell")

navigateBack()
getDeleteButton().tap()
fetchedResultsTableViewMenuItem.tap()

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

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

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

func test_ThatActionButton_DeleteSelectedOption_RemovesSelectedCells() {
Expand Down
4 changes: 2 additions & 2 deletions Example/UITests/StaticViewsUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ final class StaticViewsUITests: XCTestCase {
private let numberOfCellsInStaticTableView: Int = 9
private let numberOfCellsInStaticCollectionView: Int = 10

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

let app = XCUIApplication()

Expand Down
13 changes: 13 additions & 0 deletions Example/UITests/XCTestCase+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,17 @@ extension XCTestCase {
numberOfElementsTapped += 1
}
}

@discardableResult
func waitToAppearFor(element: XCUIElement, timeout: Double = 5.0) -> XCTWaiter.Result {
let waiter = XCTWaiter()
let nsPredicate = NSPredicate(format: "exists == true")
let expectations = [XCTNSPredicateExpectation(predicate: nsPredicate, object: element)]
let result = waiter.wait(for: expectations, timeout: timeout)

if result == .timedOut && element.exists && nsPredicate.evaluate(with: element) {
return .completed
}
return result
}
}
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

gem 'cocoapods', '~> 1.7.5'
gem 'cocoapods', '~> 1.8'

gem 'danger', '~> 6.0'
gem 'danger-swiftlint'
Expand Down
19 changes: 13 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,25 @@ GEM
tzinfo (~> 1.1)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
algoliasearch (1.27.0)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.0.3)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
cocoapods (1.7.5)
cocoapods (1.8.0)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.7.5)
cocoapods-core (= 1.8.0)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.3.1, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
Expand All @@ -33,9 +36,11 @@ GEM
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.10.0, < 2.0)
cocoapods-core (1.7.5)
xcodeproj (>= 1.11.1, < 2.0)
cocoapods-core (1.8.0)
activesupport (>= 4.0.2, < 6)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.0)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.4)
Expand Down Expand Up @@ -86,8 +91,10 @@ GEM
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
git (1.5.0)
httpclient (2.8.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.2.0)
kramdown (2.1.0)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
Expand Down Expand Up @@ -130,7 +137,7 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.7.5)
cocoapods (~> 1.8)
danger (~> 6.0)
danger-auto_label
danger-prose
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/DataSourceProvider.html
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,8 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/FetchedResultsController.html
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ <h4>Return Value</h4>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
8 changes: 4 additions & 4 deletions docs/Classes/FetchedResultsDelegateProvider.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ <h3 class="section-name">Properties</h3>
<li class="item">
<div>
<code>
<a name="/s:17JSQDataSourcesKit30FetchedResultsDelegateProviderC14cellParentView0J0_0iJ0QZSgXwvp"></a>
<a name="/s:17JSQDataSourcesKit30FetchedResultsDelegateProviderC14cellParentView0J0_0iJ0QZSgvp"></a>
<a name="//apple_ref/swift/Property/cellParentView" class="dashAnchor"></a>
<a class="token" href="#/s:17JSQDataSourcesKit30FetchedResultsDelegateProviderC14cellParentView0J0_0iJ0QZSgXwvp">cellParentView</a>
<a class="token" href="#/s:17JSQDataSourcesKit30FetchedResultsDelegateProviderC14cellParentView0J0_0iJ0QZSgvp">cellParentView</a>
</code>
</div>
<div class="height-container">
Expand Down Expand Up @@ -412,8 +412,8 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/TitledSupplementaryView.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Enums.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Enums/ReusableViewType.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
17 changes: 15 additions & 2 deletions docs/Guides.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,24 @@ <h1>Guides</h1>

</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/documentation.Getting Started"></a>
<a name="//apple_ref/swift/Guide/Getting Started" class="dashAnchor"></a>
<a class="direct-link" href="getting-started.html">Getting Started</a>
</code>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Protocols.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Protocols/CellParentViewProtocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ <h4>Return Value</h4>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Protocols/DataSourceProtocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ <h4>Return Value</h4>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/Protocols/ReusableViewConfigProtocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ <h4>Return Value</h4>
</section>
</section>
<section id="footer">
<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>
<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>
<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>
<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>
</section>
</article>
</div>
Expand Down
Loading